├── model ├── init.go ├── room_test.go └── user.go ├── vendor ├── github.com │ ├── modern-go │ │ ├── reflect2 │ │ │ ├── reflect2_amd64.s │ │ │ ├── relfect2_386.s │ │ │ ├── relfect2_arm.s │ │ │ ├── relfect2_arm64.s │ │ │ ├── relfect2_mipsx.s │ │ │ ├── relfect2_s390x.s │ │ │ ├── relfect2_amd64p32.s │ │ │ ├── relfect2_mips64x.s │ │ │ ├── relfect2_ppc64x.s │ │ │ ├── go_below_17.go │ │ │ ├── go_above_17.go │ │ │ ├── go_below_19.go │ │ │ ├── go_above_19.go │ │ │ ├── test.sh │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── safe_struct.go │ │ │ ├── reflect2_kind.go │ │ │ ├── unsafe_ptr.go │ │ │ ├── safe_field.go │ │ │ ├── unsafe_eface.go │ │ │ └── unsafe_iface.go │ │ └── concurrent │ │ │ ├── go_above_19.go │ │ │ ├── test.sh │ │ │ ├── log.go │ │ │ ├── executor.go │ │ │ └── go_below_19.go │ ├── gin-gonic │ │ └── gin │ │ │ ├── wercker.yml │ │ │ ├── codecov.yml │ │ │ ├── doc.go │ │ │ ├── context_appengine.go │ │ │ ├── response_writer_1.7.go │ │ │ ├── json │ │ │ ├── json.go │ │ │ └── jsoniter.go │ │ │ ├── coverage.sh │ │ │ ├── test_helpers.go │ │ │ ├── binding │ │ │ ├── query.go │ │ │ ├── xml.go │ │ │ ├── msgpack.go │ │ │ ├── protobuf.go │ │ │ ├── json.go │ │ │ ├── form.go │ │ │ └── default_validator.go │ │ │ ├── response_writer_1.8.go │ │ │ ├── render │ │ │ ├── data.go │ │ │ ├── xml.go │ │ │ ├── yaml.go │ │ │ ├── redirect.go │ │ │ ├── msgpack.go │ │ │ ├── text.go │ │ │ ├── reader.go │ │ │ └── render.go │ │ │ ├── CONTRIBUTING.md │ │ │ ├── deprecated.go │ │ │ ├── LICENSE │ │ │ └── fs.go │ ├── golang │ │ ├── snappy │ │ │ ├── go.mod │ │ │ ├── decode_amd64.go │ │ │ ├── AUTHORS │ │ │ ├── encode_amd64.go │ │ │ ├── CONTRIBUTORS │ │ │ └── LICENSE │ │ ├── glog │ │ │ └── README │ │ └── protobuf │ │ │ └── LICENSE │ ├── ipipdotnet │ │ └── ipdb-go │ │ │ ├── go.mod │ │ │ └── city.free.ipdb │ ├── mattn │ │ └── go-isatty │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── isatty_others.go │ │ │ ├── isatty_linux.go │ │ │ ├── isatty_android.go │ │ │ ├── isatty_solaris.go │ │ │ ├── isatty_bsd.go │ │ │ ├── LICENSE │ │ │ └── README.md │ ├── ugorji │ │ └── go │ │ │ ├── codec │ │ │ ├── go.mod │ │ │ ├── goversion_vendor_gte_go17.go │ │ │ ├── goversion_vendor_lt_go15.go │ │ │ ├── goversion_unexportedembeddedptr_gte_go110.go │ │ │ ├── goversion_unexportedembeddedptr_lt_go110.go │ │ │ ├── goversion_vendor_eq_go15.go │ │ │ ├── goversion_vendor_eq_go16.go │ │ │ ├── codecgen.go │ │ │ ├── goversion_makemap_lt_go19.go │ │ │ ├── goversion_arrayof_gte_go15.go │ │ │ ├── goversion_makemap_gte_go19.go │ │ │ ├── goversion_arrayof_lt_go15.go │ │ │ ├── goversion_unsupported_lt_go14.go │ │ │ └── gen-enc-chan.go.tmpl │ │ │ └── LICENSE │ ├── noxue │ │ └── zero │ │ │ ├── glide.yaml │ │ │ ├── glide.lock │ │ │ ├── def.go │ │ │ ├── LICENSE │ │ │ ├── session.go │ │ │ ├── README.md │ │ │ └── message.go │ ├── go-playground │ │ └── validator │ │ │ ├── logo.png │ │ │ ├── translations.go │ │ │ ├── Makefile │ │ │ └── LICENSE │ ├── jinzhu │ │ ├── gorm │ │ │ ├── test_all.sh │ │ │ ├── model.go │ │ │ ├── interface.go │ │ │ ├── docker-compose.yml │ │ │ ├── callback_row_query.go │ │ │ └── License │ │ └── inflection │ │ │ ├── wercker.yml │ │ │ └── LICENSE │ ├── dgrijalva │ │ └── jwt-go │ │ │ ├── doc.go │ │ │ ├── LICENSE │ │ │ └── signing_method.go │ ├── garyburd │ │ └── redigo │ │ │ ├── redis │ │ │ ├── go18.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ └── pool17.go │ │ │ └── internal │ │ │ └── commandinfo.go │ ├── json-iterator │ │ └── go │ │ │ ├── test.sh │ │ │ ├── build.sh │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── fuzzy_mode_convert_table.md │ │ │ ├── jsoniter.go │ │ │ ├── pool.go │ │ │ ├── LICENSE │ │ │ ├── any_nil.go │ │ │ ├── any_int64.go │ │ │ ├── any_int32.go │ │ │ ├── any_uint64.go │ │ │ ├── iter_array.go │ │ │ ├── any_uint32.go │ │ │ └── any_float.go │ ├── gin-contrib │ │ └── sse │ │ │ ├── writer.go │ │ │ └── LICENSE │ ├── go-sql-driver │ │ └── mysql │ │ │ ├── appengine.go │ │ │ ├── result.go │ │ │ ├── transaction.go │ │ │ ├── CONTRIBUTING.md │ │ │ ├── utils_go18.go │ │ │ └── utils_go17.go │ └── syndtr │ │ └── goleveldb │ │ ├── leveldb │ │ ├── errors.go │ │ ├── storage │ │ │ ├── file_storage_nacl.go │ │ │ └── file_storage_plan9.go │ │ ├── filter.go │ │ ├── util │ │ │ ├── crc32.go │ │ │ ├── range.go │ │ │ └── hash.go │ │ ├── comparer │ │ │ └── bytes_comparer.go │ │ └── storage.go │ │ └── LICENSE └── gopkg.in │ ├── yaml.v2 │ ├── go.mod │ ├── NOTICE │ ├── writerc.go │ └── LICENSE.libyaml │ └── go-playground │ └── validator.v8 │ ├── logo.png │ └── LICENSE ├── .gitignore ├── readme.md ├── utils ├── init.go ├── copy.go ├── pass.go ├── ip.go ├── db.go ├── sms.go └── Msg.go ├── ipipfree.ipdb ├── static └── avatar │ ├── Avatar0.png │ ├── Avatar1.png │ ├── Avatar10.png │ ├── Avatar11.png │ ├── Avatar12.png │ ├── Avatar13.png │ ├── Avatar14.png │ ├── Avatar15.png │ ├── Avatar16.png │ ├── Avatar17.png │ ├── Avatar18.png │ ├── Avatar19.png │ ├── Avatar2.png │ ├── Avatar20.png │ ├── Avatar21.png │ ├── Avatar22.png │ ├── Avatar23.png │ ├── Avatar24.png │ ├── Avatar25.png │ ├── Avatar26.png │ ├── Avatar27.png │ ├── Avatar28.png │ ├── Avatar29.png │ ├── Avatar3.png │ ├── Avatar30.png │ ├── Avatar31.png │ ├── Avatar32.png │ ├── Avatar33.png │ ├── Avatar34.png │ ├── Avatar35.png │ ├── Avatar36.png │ ├── Avatar37.png │ ├── Avatar38.png │ ├── Avatar39.png │ ├── Avatar4.png │ ├── Avatar40.png │ ├── Avatar41.png │ ├── Avatar42.png │ ├── Avatar43.png │ ├── Avatar44.png │ ├── Avatar45.png │ ├── Avatar46.png │ ├── Avatar47.png │ ├── Avatar48.png │ ├── Avatar49.png │ ├── Avatar5.png │ ├── Avatar50.png │ ├── Avatar51.png │ ├── Avatar52.png │ ├── Avatar53.png │ ├── Avatar54.png │ ├── Avatar55.png │ ├── Avatar56.png │ ├── Avatar57.png │ ├── Avatar58.png │ ├── Avatar59.png │ ├── Avatar6.png │ ├── Avatar60.png │ ├── Avatar61.png │ ├── Avatar62.png │ ├── Avatar63.png │ ├── Avatar64.png │ ├── Avatar65.png │ ├── Avatar66.png │ ├── Avatar67.png │ ├── Avatar68.png │ ├── Avatar69.png │ ├── Avatar7.png │ ├── Avatar70.png │ ├── Avatar71.png │ ├── Avatar72.png │ ├── Avatar73.png │ ├── Avatar74.png │ ├── Avatar75.png │ ├── Avatar76.png │ ├── Avatar77.png │ ├── Avatar78.png │ ├── Avatar79.png │ ├── Avatar8.png │ ├── Avatar80.png │ ├── Avatar81.png │ ├── Avatar82.png │ ├── Avatar83.png │ ├── Avatar84.png │ ├── Avatar85.png │ ├── Avatar86.png │ ├── Avatar87.png │ ├── Avatar88.png │ ├── Avatar89.png │ ├── Avatar9.png │ ├── Avatar90.png │ ├── Avatar91.png │ ├── Avatar92.png │ ├── Avatar93.png │ ├── Avatar94.png │ ├── Avatar95.png │ ├── Avatar96.png │ ├── Avatar97.png │ ├── Avatar98.png │ ├── Avatar99.png │ ├── Avatar100.png │ ├── Avatar101.png │ ├── Avatar102.png │ ├── Avatar103.png │ ├── Avatar104.png │ ├── Avatar105.png │ ├── Avatar106.png │ ├── Avatar107.png │ ├── Avatar108.png │ ├── Avatar109.png │ ├── Avatar110.png │ ├── Avatar111.png │ ├── Avatar112.png │ ├── Avatar113.png │ ├── Avatar114.png │ ├── Avatar115.png │ ├── Avatar116.png │ ├── Avatar117.png │ ├── Avatar118.png │ ├── Avatar119.png │ ├── Avatar120.png │ ├── Avatar121.png │ ├── Avatar122.png │ ├── Avatar123.png │ ├── Avatar124.png │ ├── Avatar125.png │ ├── Avatar126.png │ ├── Avatar127.png │ ├── Avatar128.png │ ├── Avatar129.png │ ├── Avatar130.png │ ├── Avatar131.png │ ├── Avatar132.png │ ├── Avatar133.png │ ├── Avatar134.png │ ├── Avatar135.png │ ├── Avatar136.png │ ├── Avatar137.png │ ├── Avatar138.png │ ├── Avatar139.png │ ├── Avatar140.png │ ├── Avatar141.png │ ├── Avatar142.png │ ├── Avatar143.png │ ├── Avatar144.png │ ├── Avatar145.png │ ├── Avatar146.png │ ├── Avatar147.png │ ├── Avatar148.png │ ├── Avatar149.png │ ├── Avatar150.png │ ├── Avatar151.png │ ├── Avatar152.png │ ├── Avatar153.png │ ├── Avatar154.png │ ├── Avatar155.png │ ├── Avatar156.png │ ├── Avatar157.png │ ├── Avatar158.png │ ├── Avatar159.png │ ├── Avatar160.png │ ├── Avatar161.png │ ├── Avatar162.png │ ├── Avatar163.png │ ├── Avatar164.png │ ├── Avatar165.png │ ├── Avatar166.png │ ├── Avatar167.png │ ├── Avatar168.png │ ├── Avatar169.png │ ├── Avatar170.png │ ├── Avatar171.png │ ├── Avatar172.png │ ├── Avatar173.png │ ├── Avatar174.png │ ├── Avatar175.png │ ├── Avatar176.png │ ├── Avatar177.png │ ├── Avatar178.png │ ├── Avatar179.png │ ├── Avatar180.png │ ├── Avatar181.png │ ├── Avatar182.png │ ├── Avatar183.png │ ├── Avatar184.png │ ├── Avatar185.png │ ├── Avatar186.png │ ├── Avatar187.png │ ├── Avatar188.png │ ├── Avatar189.png │ ├── Avatar190.png │ ├── Avatar191.png │ ├── Avatar192.png │ ├── Avatar193.png │ ├── Avatar194.png │ ├── Avatar195.png │ ├── Avatar196.png │ ├── Avatar197.png │ ├── Avatar198.png │ └── Avatar199.png ├── srv ├── init.go ├── user_test.go └── room_test.go ├── init.go ├── templates └── user │ └── login.html ├── controller └── init.go ├── game ├── game_test.go ├── StateSelectBanker_test.go ├── card │ ├── constants.go │ └── check_cards_test.go ├── StateShowCard.go └── clubUser.go ├── common ├── error.go └── common.go ├── event └── event_test.go ├── config.yml ├── dao ├── auth.go ├── user.go ├── init.go ├── room.go └── club.go ├── config └── config.go ├── app.go ├── domain ├── user.go └── room.go ├── middleware └── auth.go └── enum └── enum.go /model/init.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/reflect2_amd64.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_386.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm64.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mipsx.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_s390x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | /lv.db 3 | *.exe 4 | qipai 5 | /log -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mips64x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/default -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # qipai 2 | 3 | 对应的游戏前端项目:https://github.com/noxue/qipai_client 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/golang/snappy 2 | -------------------------------------------------------------------------------- /utils/init.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | func init() { 4 | initIpIp() 5 | initLv() 6 | } -------------------------------------------------------------------------------- /vendor/github.com/ipipdotnet/ipdb-go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ipipdotnet/ipdb-go 2 | -------------------------------------------------------------------------------- /ipipfree.ipdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/ipipfree.ipdb -------------------------------------------------------------------------------- /model/room_test.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import "testing" 4 | 5 | func TestRoom(t *testing.T) { 6 | 7 | } -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /static/avatar/Avatar0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar0.png -------------------------------------------------------------------------------- /static/avatar/Avatar1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar1.png -------------------------------------------------------------------------------- /static/avatar/Avatar10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar10.png -------------------------------------------------------------------------------- /static/avatar/Avatar11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar11.png -------------------------------------------------------------------------------- /static/avatar/Avatar12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar12.png -------------------------------------------------------------------------------- /static/avatar/Avatar13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar13.png -------------------------------------------------------------------------------- /static/avatar/Avatar14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar14.png -------------------------------------------------------------------------------- /static/avatar/Avatar15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar15.png -------------------------------------------------------------------------------- /static/avatar/Avatar16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar16.png -------------------------------------------------------------------------------- /static/avatar/Avatar17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar17.png -------------------------------------------------------------------------------- /static/avatar/Avatar18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar18.png -------------------------------------------------------------------------------- /static/avatar/Avatar19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar19.png -------------------------------------------------------------------------------- /static/avatar/Avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar2.png -------------------------------------------------------------------------------- /static/avatar/Avatar20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar20.png -------------------------------------------------------------------------------- /static/avatar/Avatar21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar21.png -------------------------------------------------------------------------------- /static/avatar/Avatar22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar22.png -------------------------------------------------------------------------------- /static/avatar/Avatar23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar23.png -------------------------------------------------------------------------------- /static/avatar/Avatar24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar24.png -------------------------------------------------------------------------------- /static/avatar/Avatar25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar25.png -------------------------------------------------------------------------------- /static/avatar/Avatar26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar26.png -------------------------------------------------------------------------------- /static/avatar/Avatar27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar27.png -------------------------------------------------------------------------------- /static/avatar/Avatar28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar28.png -------------------------------------------------------------------------------- /static/avatar/Avatar29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar29.png -------------------------------------------------------------------------------- /static/avatar/Avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar3.png -------------------------------------------------------------------------------- /static/avatar/Avatar30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar30.png -------------------------------------------------------------------------------- /static/avatar/Avatar31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar31.png -------------------------------------------------------------------------------- /static/avatar/Avatar32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar32.png -------------------------------------------------------------------------------- /static/avatar/Avatar33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar33.png -------------------------------------------------------------------------------- /static/avatar/Avatar34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar34.png -------------------------------------------------------------------------------- /static/avatar/Avatar35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar35.png -------------------------------------------------------------------------------- /static/avatar/Avatar36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar36.png -------------------------------------------------------------------------------- /static/avatar/Avatar37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar37.png -------------------------------------------------------------------------------- /static/avatar/Avatar38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar38.png -------------------------------------------------------------------------------- /static/avatar/Avatar39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar39.png -------------------------------------------------------------------------------- /static/avatar/Avatar4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar4.png -------------------------------------------------------------------------------- /static/avatar/Avatar40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar40.png -------------------------------------------------------------------------------- /static/avatar/Avatar41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar41.png -------------------------------------------------------------------------------- /static/avatar/Avatar42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar42.png -------------------------------------------------------------------------------- /static/avatar/Avatar43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar43.png -------------------------------------------------------------------------------- /static/avatar/Avatar44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar44.png -------------------------------------------------------------------------------- /static/avatar/Avatar45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar45.png -------------------------------------------------------------------------------- /static/avatar/Avatar46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar46.png -------------------------------------------------------------------------------- /static/avatar/Avatar47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar47.png -------------------------------------------------------------------------------- /static/avatar/Avatar48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar48.png -------------------------------------------------------------------------------- /static/avatar/Avatar49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar49.png -------------------------------------------------------------------------------- /static/avatar/Avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar5.png -------------------------------------------------------------------------------- /static/avatar/Avatar50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar50.png -------------------------------------------------------------------------------- /static/avatar/Avatar51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar51.png -------------------------------------------------------------------------------- /static/avatar/Avatar52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar52.png -------------------------------------------------------------------------------- /static/avatar/Avatar53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar53.png -------------------------------------------------------------------------------- /static/avatar/Avatar54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar54.png -------------------------------------------------------------------------------- /static/avatar/Avatar55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar55.png -------------------------------------------------------------------------------- /static/avatar/Avatar56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar56.png -------------------------------------------------------------------------------- /static/avatar/Avatar57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar57.png -------------------------------------------------------------------------------- /static/avatar/Avatar58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar58.png -------------------------------------------------------------------------------- /static/avatar/Avatar59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar59.png -------------------------------------------------------------------------------- /static/avatar/Avatar6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar6.png -------------------------------------------------------------------------------- /static/avatar/Avatar60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar60.png -------------------------------------------------------------------------------- /static/avatar/Avatar61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar61.png -------------------------------------------------------------------------------- /static/avatar/Avatar62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar62.png -------------------------------------------------------------------------------- /static/avatar/Avatar63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar63.png -------------------------------------------------------------------------------- /static/avatar/Avatar64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar64.png -------------------------------------------------------------------------------- /static/avatar/Avatar65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar65.png -------------------------------------------------------------------------------- /static/avatar/Avatar66.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar66.png -------------------------------------------------------------------------------- /static/avatar/Avatar67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar67.png -------------------------------------------------------------------------------- /static/avatar/Avatar68.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar68.png -------------------------------------------------------------------------------- /static/avatar/Avatar69.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar69.png -------------------------------------------------------------------------------- /static/avatar/Avatar7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar7.png -------------------------------------------------------------------------------- /static/avatar/Avatar70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar70.png -------------------------------------------------------------------------------- /static/avatar/Avatar71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar71.png -------------------------------------------------------------------------------- /static/avatar/Avatar72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar72.png -------------------------------------------------------------------------------- /static/avatar/Avatar73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar73.png -------------------------------------------------------------------------------- /static/avatar/Avatar74.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar74.png -------------------------------------------------------------------------------- /static/avatar/Avatar75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar75.png -------------------------------------------------------------------------------- /static/avatar/Avatar76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar76.png -------------------------------------------------------------------------------- /static/avatar/Avatar77.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar77.png -------------------------------------------------------------------------------- /static/avatar/Avatar78.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar78.png -------------------------------------------------------------------------------- /static/avatar/Avatar79.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar79.png -------------------------------------------------------------------------------- /static/avatar/Avatar8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar8.png -------------------------------------------------------------------------------- /static/avatar/Avatar80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar80.png -------------------------------------------------------------------------------- /static/avatar/Avatar81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar81.png -------------------------------------------------------------------------------- /static/avatar/Avatar82.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar82.png -------------------------------------------------------------------------------- /static/avatar/Avatar83.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar83.png -------------------------------------------------------------------------------- /static/avatar/Avatar84.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar84.png -------------------------------------------------------------------------------- /static/avatar/Avatar85.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar85.png -------------------------------------------------------------------------------- /static/avatar/Avatar86.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar86.png -------------------------------------------------------------------------------- /static/avatar/Avatar87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar87.png -------------------------------------------------------------------------------- /static/avatar/Avatar88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar88.png -------------------------------------------------------------------------------- /static/avatar/Avatar89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar89.png -------------------------------------------------------------------------------- /static/avatar/Avatar9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar9.png -------------------------------------------------------------------------------- /static/avatar/Avatar90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar90.png -------------------------------------------------------------------------------- /static/avatar/Avatar91.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar91.png -------------------------------------------------------------------------------- /static/avatar/Avatar92.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar92.png -------------------------------------------------------------------------------- /static/avatar/Avatar93.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar93.png -------------------------------------------------------------------------------- /static/avatar/Avatar94.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar94.png -------------------------------------------------------------------------------- /static/avatar/Avatar95.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar95.png -------------------------------------------------------------------------------- /static/avatar/Avatar96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar96.png -------------------------------------------------------------------------------- /static/avatar/Avatar97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar97.png -------------------------------------------------------------------------------- /static/avatar/Avatar98.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar98.png -------------------------------------------------------------------------------- /static/avatar/Avatar99.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar99.png -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ugorji/go/codec 2 | 3 | require github.com/ugorji/go v1.1.2 4 | -------------------------------------------------------------------------------- /static/avatar/Avatar100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar100.png -------------------------------------------------------------------------------- /static/avatar/Avatar101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar101.png -------------------------------------------------------------------------------- /static/avatar/Avatar102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar102.png -------------------------------------------------------------------------------- /static/avatar/Avatar103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar103.png -------------------------------------------------------------------------------- /static/avatar/Avatar104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar104.png -------------------------------------------------------------------------------- /static/avatar/Avatar105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar105.png -------------------------------------------------------------------------------- /static/avatar/Avatar106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar106.png -------------------------------------------------------------------------------- /static/avatar/Avatar107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar107.png -------------------------------------------------------------------------------- /static/avatar/Avatar108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar108.png -------------------------------------------------------------------------------- /static/avatar/Avatar109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar109.png -------------------------------------------------------------------------------- /static/avatar/Avatar110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar110.png -------------------------------------------------------------------------------- /static/avatar/Avatar111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar111.png -------------------------------------------------------------------------------- /static/avatar/Avatar112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar112.png -------------------------------------------------------------------------------- /static/avatar/Avatar113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar113.png -------------------------------------------------------------------------------- /static/avatar/Avatar114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar114.png -------------------------------------------------------------------------------- /static/avatar/Avatar115.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar115.png -------------------------------------------------------------------------------- /static/avatar/Avatar116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar116.png -------------------------------------------------------------------------------- /static/avatar/Avatar117.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar117.png -------------------------------------------------------------------------------- /static/avatar/Avatar118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar118.png -------------------------------------------------------------------------------- /static/avatar/Avatar119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar119.png -------------------------------------------------------------------------------- /static/avatar/Avatar120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar120.png -------------------------------------------------------------------------------- /static/avatar/Avatar121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar121.png -------------------------------------------------------------------------------- /static/avatar/Avatar122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar122.png -------------------------------------------------------------------------------- /static/avatar/Avatar123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar123.png -------------------------------------------------------------------------------- /static/avatar/Avatar124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar124.png -------------------------------------------------------------------------------- /static/avatar/Avatar125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar125.png -------------------------------------------------------------------------------- /static/avatar/Avatar126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar126.png -------------------------------------------------------------------------------- /static/avatar/Avatar127.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar127.png -------------------------------------------------------------------------------- /static/avatar/Avatar128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar128.png -------------------------------------------------------------------------------- /static/avatar/Avatar129.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar129.png -------------------------------------------------------------------------------- /static/avatar/Avatar130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar130.png -------------------------------------------------------------------------------- /static/avatar/Avatar131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar131.png -------------------------------------------------------------------------------- /static/avatar/Avatar132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar132.png -------------------------------------------------------------------------------- /static/avatar/Avatar133.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar133.png -------------------------------------------------------------------------------- /static/avatar/Avatar134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar134.png -------------------------------------------------------------------------------- /static/avatar/Avatar135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar135.png -------------------------------------------------------------------------------- /static/avatar/Avatar136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar136.png -------------------------------------------------------------------------------- /static/avatar/Avatar137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar137.png -------------------------------------------------------------------------------- /static/avatar/Avatar138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar138.png -------------------------------------------------------------------------------- /static/avatar/Avatar139.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar139.png -------------------------------------------------------------------------------- /static/avatar/Avatar140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar140.png -------------------------------------------------------------------------------- /static/avatar/Avatar141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar141.png -------------------------------------------------------------------------------- /static/avatar/Avatar142.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar142.png -------------------------------------------------------------------------------- /static/avatar/Avatar143.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar143.png -------------------------------------------------------------------------------- /static/avatar/Avatar144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar144.png -------------------------------------------------------------------------------- /static/avatar/Avatar145.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar145.png -------------------------------------------------------------------------------- /static/avatar/Avatar146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar146.png -------------------------------------------------------------------------------- /static/avatar/Avatar147.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar147.png -------------------------------------------------------------------------------- /static/avatar/Avatar148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar148.png -------------------------------------------------------------------------------- /static/avatar/Avatar149.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar149.png -------------------------------------------------------------------------------- /static/avatar/Avatar150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar150.png -------------------------------------------------------------------------------- /static/avatar/Avatar151.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar151.png -------------------------------------------------------------------------------- /static/avatar/Avatar152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar152.png -------------------------------------------------------------------------------- /static/avatar/Avatar153.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar153.png -------------------------------------------------------------------------------- /static/avatar/Avatar154.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar154.png -------------------------------------------------------------------------------- /static/avatar/Avatar155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar155.png -------------------------------------------------------------------------------- /static/avatar/Avatar156.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar156.png -------------------------------------------------------------------------------- /static/avatar/Avatar157.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar157.png -------------------------------------------------------------------------------- /static/avatar/Avatar158.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar158.png -------------------------------------------------------------------------------- /static/avatar/Avatar159.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar159.png -------------------------------------------------------------------------------- /static/avatar/Avatar160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar160.png -------------------------------------------------------------------------------- /static/avatar/Avatar161.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar161.png -------------------------------------------------------------------------------- /static/avatar/Avatar162.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar162.png -------------------------------------------------------------------------------- /static/avatar/Avatar163.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar163.png -------------------------------------------------------------------------------- /static/avatar/Avatar164.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar164.png -------------------------------------------------------------------------------- /static/avatar/Avatar165.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar165.png -------------------------------------------------------------------------------- /static/avatar/Avatar166.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar166.png -------------------------------------------------------------------------------- /static/avatar/Avatar167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar167.png -------------------------------------------------------------------------------- /static/avatar/Avatar168.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar168.png -------------------------------------------------------------------------------- /static/avatar/Avatar169.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar169.png -------------------------------------------------------------------------------- /static/avatar/Avatar170.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar170.png -------------------------------------------------------------------------------- /static/avatar/Avatar171.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar171.png -------------------------------------------------------------------------------- /static/avatar/Avatar172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar172.png -------------------------------------------------------------------------------- /static/avatar/Avatar173.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar173.png -------------------------------------------------------------------------------- /static/avatar/Avatar174.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar174.png -------------------------------------------------------------------------------- /static/avatar/Avatar175.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar175.png -------------------------------------------------------------------------------- /static/avatar/Avatar176.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar176.png -------------------------------------------------------------------------------- /static/avatar/Avatar177.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar177.png -------------------------------------------------------------------------------- /static/avatar/Avatar178.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar178.png -------------------------------------------------------------------------------- /static/avatar/Avatar179.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar179.png -------------------------------------------------------------------------------- /static/avatar/Avatar180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar180.png -------------------------------------------------------------------------------- /static/avatar/Avatar181.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar181.png -------------------------------------------------------------------------------- /static/avatar/Avatar182.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar182.png -------------------------------------------------------------------------------- /static/avatar/Avatar183.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar183.png -------------------------------------------------------------------------------- /static/avatar/Avatar184.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar184.png -------------------------------------------------------------------------------- /static/avatar/Avatar185.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar185.png -------------------------------------------------------------------------------- /static/avatar/Avatar186.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar186.png -------------------------------------------------------------------------------- /static/avatar/Avatar187.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar187.png -------------------------------------------------------------------------------- /static/avatar/Avatar188.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar188.png -------------------------------------------------------------------------------- /static/avatar/Avatar189.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar189.png -------------------------------------------------------------------------------- /static/avatar/Avatar190.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar190.png -------------------------------------------------------------------------------- /static/avatar/Avatar191.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar191.png -------------------------------------------------------------------------------- /static/avatar/Avatar192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar192.png -------------------------------------------------------------------------------- /static/avatar/Avatar193.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar193.png -------------------------------------------------------------------------------- /static/avatar/Avatar194.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar194.png -------------------------------------------------------------------------------- /static/avatar/Avatar195.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar195.png -------------------------------------------------------------------------------- /static/avatar/Avatar196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar196.png -------------------------------------------------------------------------------- /static/avatar/Avatar197.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar197.png -------------------------------------------------------------------------------- /static/avatar/Avatar198.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar198.png -------------------------------------------------------------------------------- /static/avatar/Avatar199.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/static/avatar/Avatar199.png -------------------------------------------------------------------------------- /srv/init.go: -------------------------------------------------------------------------------- 1 | package srv 2 | 3 | func init() { 4 | initUser() 5 | // 开线程定时删除应该解散的房间 6 | deleteAllInvalidRooms() 7 | } 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/glide.yaml: -------------------------------------------------------------------------------- 1 | package: . 2 | import: 3 | - package: github.com/satori/go.uuid 4 | version: ^1.2.0 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattn/go-isatty 2 | 3 | require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /init.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "math/rand" 5 | "time" 6 | ) 7 | 8 | func init() { 9 | // 指定随机数种子 10 | rand.Seed(time.Now().Unix()) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | notify: 3 | gitter: 4 | default: 5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/vendor/github.com/go-playground/validator/logo.png -------------------------------------------------------------------------------- /vendor/github.com/ipipdotnet/ipdb-go/city.free.ipdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/vendor/github.com/ipipdotnet/ipdb-go/city.free.ipdb -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyarong/golang-noxue-qipai_server/HEAD/vendor/gopkg.in/go-playground/validator.v8/logo.png -------------------------------------------------------------------------------- /templates/user/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 用户登录 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/test_all.sh: -------------------------------------------------------------------------------- 1 | dialects=("postgres" "mysql" "mssql" "sqlite") 2 | 3 | for dialect in "${dialects[@]}" ; do 4 | DEBUG=false GORM_DIALECT=${dialect} go test 5 | done 6 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html 2 | // 3 | // See README.md for more info. 4 | package jwt 5 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_17.go: -------------------------------------------------------------------------------- 1 | //+build !go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package gin implements a HTTP web framework called gin. 3 | 4 | See https://gin-gonic.github.io/gin/ for more information about gin. 5 | */ 6 | package gin // import "github.com/gin-gonic/gin" 7 | -------------------------------------------------------------------------------- /controller/init.go: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | var R *gin.Engine 8 | 9 | func init() { 10 | R = gin.Default() 11 | R.Static("/static","./static") 12 | user() 13 | } 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= 2 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 3 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_17.go: -------------------------------------------------------------------------------- 1 | //+build go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | //go:linkname resolveTypeOff reflect.resolveTypeOff 8 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 9 | -------------------------------------------------------------------------------- /game/game_test.go: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func a() int { 8 | return 1 9 | } 10 | 11 | func b() int { 12 | return 2 13 | } 14 | 15 | 16 | func TestDoArgs(t *testing.T) { 17 | for{ 18 | println(a(),b()) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/glide.lock: -------------------------------------------------------------------------------- 1 | hash: aad64274191d97fbca8037fc4f9d98608c8aadef0e6efd8e7202ee4547db7f0c 2 | updated: 2018-05-30T20:17:17.11422+08:00 3 | imports: 4 | - name: github.com/satori/go.uuid 5 | version: f58768cc1a7a7e77a3bd49e98cdd21419399b6a3 6 | testImports: [] 7 | -------------------------------------------------------------------------------- /common/error.go: -------------------------------------------------------------------------------- 1 | package common 2 | // 错误的信息 3 | const ( 4 | ErrAccessTokenEmpty = "access token is empty" 5 | ErrAppIDEmpty = "appid empty" 6 | ErrRefreshTokenEmpty = "refresh token is empty" 7 | ErrOpenIDEmpty = "openid is empty" 8 | ErrCertCertEmpty = "cert path is empty " 9 | ) -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | const genCheckVendor = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | var genCheckVendor = false 9 | -------------------------------------------------------------------------------- /utils/copy.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "encoding/xml" 4 | 5 | // 通过xml解析的结构体,des必须是引用 6 | func Copy(src, des interface{})bool{ 7 | bs,err:=xml.Marshal(src) 8 | if err!=nil { 9 | return false 10 | } 11 | err = xml.Unmarshal(bs,des) 12 | if err!=nil { 13 | return false 14 | } 15 | return true 16 | } -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/def.go: -------------------------------------------------------------------------------- 1 | package zero 2 | 3 | const ( 4 | // STUnknown Unknown 5 | STUnknown = iota 6 | // STInited Inited 7 | STInited 8 | // STRunning Running 9 | STRunning 10 | // STStop Stop 11 | STStop 12 | ) 13 | 14 | const ( 15 | // MsgHeartbeat heartbeat 16 | MsgHeartbeat = iota 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = false 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map is a wrapper for sync.Map introduced in go1.9 8 | type Map struct { 9 | sync.Map 10 | } 11 | 12 | // NewMap creates a thread safe Map 13 | func NewMap() *Map { 14 | return &Map{} 15 | } 16 | -------------------------------------------------------------------------------- /event/event_test.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import "testing" 4 | 5 | func TestSend(t *testing.T) { 6 | Send(101010,"UserJoinRoom",101012,101013,101014) 7 | } 8 | 9 | func TestGet(t *testing.T) { 10 | Get(101010) 11 | } 12 | 13 | func TestDoArg(t *testing.T) { 14 | str:=doArgs([]interface{}{1,"sss",3,2.3}) 15 | print(str) 16 | } -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | func init() { 10 | defaultAppEngine = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6,!go1.7 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 11 | -------------------------------------------------------------------------------- /utils/pass.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "crypto/md5" 5 | "fmt" 6 | ) 7 | 8 | func PassEncode(password string) string { 9 | has := md5.Sum([]byte(password)) 10 | return fmt.Sprintf("%x", has) 11 | } 12 | 13 | func PassCompare(password, hashStr string) bool { 14 | if PassEncode(password) == hashStr { 15 | return true 16 | } 17 | return false 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/response_writer_1.7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | // ResponseWriter ... 10 | type ResponseWriter interface { 11 | responseWriterBase 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype, cap) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/codecgen.go: -------------------------------------------------------------------------------- 1 | // +build codecgen generated 2 | 3 | package codec 4 | 5 | // this file is here, to set the codecgen variable to true 6 | // when the build tag codecgen is set. 7 | // 8 | // this allows us do specific things e.g. skip missing fields tests, 9 | // when running in codecgen mode. 10 | 11 | func init() { 12 | codecgen = true 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/log.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "io/ioutil" 7 | ) 8 | 9 | // ErrorLogger is used to print out error, can be set to writer other than stderr 10 | var ErrorLogger = log.New(os.Stderr, "", 0) 11 | 12 | // InfoLogger is used to print informational message, default to off 13 | var InfoLogger = log.New(ioutil.Discard, "", 0) -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | return reflect.MakeMap(t) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list github.com/modern-go/reflect2-tests/... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/reflect2 $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/json/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !jsoniter 6 | 7 | package json 8 | 9 | import "encoding/json" 10 | 11 | var ( 12 | Marshal = json.Marshal 13 | MarshalIndent = json.MarshalIndent 14 | NewDecoder = json.NewDecoder 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | echo "mode: count" > coverage.out 6 | 7 | for d in $(go list ./... | grep -E 'gin$|binding$|render$' | grep -v 'examples'); do 8 | go test -v -covermode=count -coverprofile=profile.out $d 9 | if [ -f profile.out ]; then 10 | cat profile.out | grep -v "mode:" >> coverage.out 11 | rm profile.out 12 | fi 13 | done 14 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | appkey: quiwyeuqiweyrwqoiueyrqweoiury 2 | lvdb: lv.db 3 | debug: false 4 | db: 5 | url: root:123456@/test?charset=utf8mb4&parseTime=True&loc=Local 6 | sms: 7 | key: LTAITBp6uTMAfXA2 8 | secret: LDciOEtGumVXnc1CToFh6g8Wi2ecRH 9 | sign: 不学网 # 签名 10 | reg_tpl_code: SMS_155370082 # 注册模板编号 11 | loginTplCode: SMS_119082858 # 登录模板编号 12 | wechat: 13 | id: wx95ffdfe60fda9906 14 | secret: 9c1da975fd9777f709e1d4349065aa46 -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/model.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "time" 4 | 5 | // Model base model definition, including fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`, which could be embedded in your models 6 | // type User struct { 7 | // gorm.Model 8 | // } 9 | type Model struct { 10 | ID uint `gorm:"primary_key"` 11 | CreatedAt time.Time 12 | UpdatedAt time.Time 13 | DeletedAt *time.Time `sql:"index"` 14 | } 15 | -------------------------------------------------------------------------------- /dao/auth.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "errors" 5 | "qipai/enum" 6 | "qipai/model" 7 | ) 8 | 9 | type authDao struct { 10 | } 11 | 12 | var Auth authDao 13 | 14 | func (authDao) Get(userType enum.UserType, name string) (auth model.Auth, err error) { 15 | ret := Db().Where("user_type=? and name=?", userType, name).First(&auth) 16 | if ret.RecordNotFound() { 17 | err = errors.New("账号或密码错误") 18 | return 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | return reflect.ArrayOf(count, elem) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then 6 | mkdir -p /tmp/build-golang/src/github.com/json-iterator 7 | ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go 8 | fi 9 | export GOPATH=/tmp/build-golang 10 | go get -u github.com/golang/dep/cmd/dep 11 | cd /tmp/build-golang/src/github.com/json-iterator/go 12 | exec $GOPATH/bin/dep ensure -update 13 | -------------------------------------------------------------------------------- /srv/user_test.go: -------------------------------------------------------------------------------- 1 | package srv 2 | 3 | import ( 4 | "qipai/enum" 5 | "qipai/model" 6 | "testing" 7 | ) 8 | 9 | func TestUserSrv_Register(t *testing.T) { 10 | user :=model.User{ 11 | Nick:"admin", 12 | } 13 | user.Auths = append(user.Auths,model.Auth{ 14 | Name:"13788888888", 15 | Pass:"137888888888", 16 | UserType:enum.MobilePass, 17 | }) 18 | 19 | err:=User.Register(&user) 20 | if err!=nil { 21 | t.Error(err) 22 | return 23 | } 24 | t.Log("注册成功") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | if size < 0 { 12 | return reflect.MakeMapWithSize(t, 4) 13 | } 14 | return reflect.MakeMapWithSize(t, size) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | panic("codec: reflect.ArrayOf unsupported in this go version") 14 | } 15 | -------------------------------------------------------------------------------- /utils/ip.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "github.com/ipipdotnet/ipdb-go" 5 | "log" 6 | ) 7 | 8 | var db *ipdb.BaseStation 9 | 10 | func initIpIp() { 11 | var err error 12 | db, err = ipdb.NewBaseStation("ipipfree.ipdb") 13 | if err != nil { 14 | log.Fatal(err) 15 | } 16 | } 17 | 18 | func GetAddress(ip string) string { 19 | ips, err := db.FindMap(ip, "CN") 20 | if err != nil { 21 | return "unknown" 22 | } 23 | 24 | return ips["region_name"] + " " + ips["city_name"] 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | 3 | build: 4 | steps: 5 | - setup-go-workspace 6 | 7 | # Gets the dependencies 8 | - script: 9 | name: go get 10 | code: | 11 | go get 12 | 13 | # Build the project 14 | - script: 15 | name: go build 16 | code: | 17 | go build ./... 18 | 19 | # Test the project 20 | - script: 21 | name: go test 22 | code: | 23 | go test ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/json/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build jsoniter 6 | 7 | package json 8 | 9 | import "github.com/json-iterator/go" 10 | 11 | var ( 12 | json = jsoniter.ConfigCompatibleWithStandardLibrary 13 | Marshal = json.Marshal 14 | MarshalIndent = json.MarshalIndent 15 | NewDecoder = json.NewDecoder 16 | ) 17 | -------------------------------------------------------------------------------- /srv/room_test.go: -------------------------------------------------------------------------------- 1 | package srv 2 | 3 | import ( 4 | "qipai/dao" 5 | "qipai/model" 6 | "testing" 7 | ) 8 | 9 | func TestRoom(t *testing.T) { 10 | var ids []int 11 | dao.Db().Raw("select id from rooms where deleted_at is null and club_id=0 and now()-created_at>10").Pluck("id",&ids) 12 | dao.Db().Unscoped().Where("id in (?)", ids).Delete(model.Room{}) 13 | } 14 | // 15 | //func TestRoomSrv_DealCards(t *testing.T) { 16 | // err:=Room.DealCards(101013) 17 | // if err!=nil { 18 | // t.Error(err) 19 | // } 20 | //} 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/translations.go: -------------------------------------------------------------------------------- 1 | package validator 2 | 3 | import ut "github.com/go-playground/universal-translator" 4 | 5 | // TranslationFunc is the function type used to register or override 6 | // custom translations 7 | type TranslationFunc func(ut ut.Translator, fe FieldError) string 8 | 9 | // RegisterTranslationsFunc allows for registering of translations 10 | // for a 'ut.Translator' for use within the 'TranslationFunc' 11 | type RegisterTranslationsFunc func(ut ut.Translator) error 12 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import "net/http" 8 | 9 | // CreateTestContext returns a fresh engine and context for testing purposes 10 | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) { 11 | r = New() 12 | c = r.allocateContext() 13 | c.reset() 14 | c.writermem.reset(w) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build appengine js 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on js and appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [solve-meta] 11 | analyzer-name = "dep" 12 | analyzer-version = 1 13 | inputs-digest = "daee8a88b3498b61c5640056665b8b9eea062006f5e596bbb6a3ed9119a11ec7" 14 | solver-name = "gps-cdcl" 15 | solver-version = 1 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/Makefile: -------------------------------------------------------------------------------- 1 | GOCMD=go 2 | 3 | linters-install: 4 | $(GOCMD) get -u github.com/alecthomas/gometalinter 5 | gometalinter --install 6 | 7 | lint: linters-install 8 | gometalinter --vendor --disable-all --enable=vet --enable=vetshadow --enable=golint --enable=maligned --enable=megacheck --enable=ineffassign --enable=misspell --enable=errcheck --enable=goconst ./... 9 | 10 | test: 11 | $(GOCMD) test -cover -race ./... 12 | 13 | bench: 14 | $(GOCMD) test -bench=. -benchmem ./... 15 | 16 | .PHONY: test lint linters-install -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /game/StateSelectBanker_test.go: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestCreateCard(t *testing.T) { 10 | var cards []int 11 | var n1 = 9 12 | 13 | for i := 0; i < 10; i++ { 14 | time.Sleep(time.Millisecond*100) 15 | result := createCard(cards, n1) 16 | v := result[3]%13 + 1 + result[4]%13 + 1 17 | if v != n1 { 18 | t.Error("错误") 19 | return 20 | } 21 | var tResult []int 22 | for i := 0; i < 5; i++ { 23 | tResult = append(tResult,result[i]%13 + 1) 24 | } 25 | fmt.Println(result,tResult, v) 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | // +build !android 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | type queryBinding struct{} 10 | 11 | func (queryBinding) Name() string { 12 | return "query" 13 | } 14 | 15 | func (queryBinding) Bind(req *http.Request, obj interface{}) error { 16 | values := req.URL.Query() 17 | if err := mapForm(obj, values); err != nil { 18 | return err 19 | } 20 | return validate(obj) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/interface.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "database/sql" 4 | 5 | // SQLCommon is the minimal database connection functionality gorm requires. Implemented by *sql.DB. 6 | type SQLCommon interface { 7 | Exec(query string, args ...interface{}) (sql.Result, error) 8 | Prepare(query string) (*sql.Stmt, error) 9 | Query(query string, args ...interface{}) (*sql.Rows, error) 10 | QueryRow(query string, args ...interface{}) *sql.Row 11 | } 12 | 13 | type sqlDb interface { 14 | Begin() (*sql.Tx, error) 15 | } 16 | 17 | type sqlTx interface { 18 | Commit() error 19 | Rollback() error 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.4 5 | 6 | package codec 7 | 8 | // This codec package will only work for go1.4 and above. 9 | // This is for the following reasons: 10 | // - go 1.4 was released in 2014 11 | // - go runtime is written fully in go 12 | // - interface only holds pointers 13 | // - reflect.Value is stabilized as 3 words 14 | 15 | func init() { 16 | panic("codec: go 1.3 and below are not supported") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/response_writer_1.8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | // Copyright 2018 Gin Core Team. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | // ResponseWriter ... 14 | type ResponseWriter interface { 15 | responseWriterBase 16 | // get the http.Pusher for server push 17 | Pusher() http.Pusher 18 | } 19 | 20 | func (w *responseWriter) Pusher() (pusher http.Pusher) { 21 | if pusher, ok := w.ResponseWriter.(http.Pusher); ok { 22 | return pusher 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Data struct { 10 | ContentType string 11 | Data []byte 12 | } 13 | 14 | // Render (Data) writes data with custom ContentType. 15 | func (r Data) Render(w http.ResponseWriter) (err error) { 16 | r.WriteContentType(w) 17 | _, err = w.Write(r.Data) 18 | return 19 | } 20 | 21 | func (r Data) WriteContentType(w http.ResponseWriter) { 22 | writeContentType(w, []string{r.ContentType}) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type XML struct { 13 | Data interface{} 14 | } 15 | 16 | var xmlContentType = []string{"application/xml; charset=utf-8"} 17 | 18 | func (r XML) Render(w http.ResponseWriter) error { 19 | r.WriteContentType(w) 20 | return xml.NewEncoder(w).Encode(r.Data) 21 | } 22 | 23 | func (r XML) WriteContentType(w http.ResponseWriter) { 24 | writeContentType(w, xmlContentType) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_android.go: -------------------------------------------------------------------------------- 1 | // +build android 2 | 3 | package isatty 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | // IsTerminal return true if the file descriptor is terminal. 13 | func IsTerminal(fd uintptr) bool { 14 | var termios syscall.Termios 15 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 16 | return err == 0 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/errors" 11 | ) 12 | 13 | // Common errors. 14 | var ( 15 | ErrNotFound = errors.ErrNotFound 16 | ErrReadOnly = errors.New("leveldb: read-only mode") 17 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 18 | ErrIterReleased = errors.New("leveldb: iterator released") 19 | ErrClosed = errors.New("leveldb: closed") 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | - With issues: 4 | - Use the search tool before opening a new issue. 5 | - Please provide source code and commit sha if you found a bug. 6 | - Review existing issues and provide feedback or react to them. 7 | 8 | - With pull requests: 9 | - Open your pull request against `master` 10 | - Your pull request should have no more than two commits, if not you should squash them. 11 | - It should pass all tests in the available continuous integrations systems such as TravisCI. 12 | - You should add/modify tests to cover your proposed code changes. 13 | - If your pull request contains a new feature, please document it on the README. 14 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/executor.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import "context" 4 | 5 | // Executor replace go keyword to start a new goroutine 6 | // the goroutine should cancel itself if the context passed in has been cancelled 7 | // the goroutine started by the executor, is owned by the executor 8 | // we can cancel all executors owned by the executor just by stop the executor itself 9 | // however Executor interface does not Stop method, the one starting and owning executor 10 | // should use the concrete type of executor, instead of this interface. 11 | type Executor interface { 12 | // Go starts a new goroutine controlled by the context 13 | Go(handler func(ctx context.Context)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [[projects]] 11 | name = "github.com/modern-go/reflect2" 12 | packages = ["."] 13 | revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" 14 | version = "1.0.1" 15 | 16 | [solve-meta] 17 | analyzer-name = "dep" 18 | analyzer-version = 1 19 | inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" 20 | solver-name = "gps-cdcl" 21 | solver-version = 1 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | 18 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 19 | // terminal. This is also always false on this environment. 20 | func IsCygwinTerminal(fd uintptr) bool { 21 | return false 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | 20 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 21 | // terminal. This is also always false on this environment. 22 | func IsCygwinTerminal(fd uintptr) bool { 23 | return false 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "gopkg.in/yaml.v2" 11 | ) 12 | 13 | type YAML struct { 14 | Data interface{} 15 | } 16 | 17 | var yamlContentType = []string{"application/x-yaml; charset=utf-8"} 18 | 19 | func (r YAML) Render(w http.ResponseWriter) error { 20 | r.WriteContentType(w) 21 | 22 | bytes, err := yaml.Marshal(r.Data) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | w.Write(bytes) 28 | return nil 29 | } 30 | 31 | func (r YAML) WriteContentType(w http.ResponseWriter) { 32 | writeContentType(w, yamlContentType) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | mysql: 5 | image: 'mysql:latest' 6 | ports: 7 | - 9910:3306 8 | environment: 9 | - MYSQL_DATABASE=gorm 10 | - MYSQL_USER=gorm 11 | - MYSQL_PASSWORD=gorm 12 | - MYSQL_RANDOM_ROOT_PASSWORD="yes" 13 | postgres: 14 | image: 'postgres:latest' 15 | ports: 16 | - 9920:5432 17 | environment: 18 | - POSTGRES_USER=gorm 19 | - POSTGRES_DB=gorm 20 | - POSTGRES_PASSWORD=gorm 21 | mssql: 22 | image: 'mcmoe/mssqldocker:latest' 23 | ports: 24 | - 9930:1433 25 | environment: 26 | - ACCEPT_EULA=Y 27 | - SA_PASSWORD=LoremIpsum86 28 | - MSSQL_DB=gorm 29 | - MSSQL_USER=gorm 30 | - MSSQL_PASSWORD=LoremIpsum86 31 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Label}}: 2 | switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { 3 | case timeout{{.Sfx}} == 0: // only consume available 4 | for { 5 | select { 6 | case b{{.Sfx}} := <-{{.Chan}}: 7 | {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) 8 | default: 9 | break {{.Label}} 10 | } 11 | } 12 | case timeout{{.Sfx}} > 0: // consume until timeout 13 | tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) 14 | for { 15 | select { 16 | case b{{.Sfx}} := <-{{.Chan}}: 17 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 18 | case <-tt{{.Sfx}}.C: 19 | // close(tt.C) 20 | break {{.Label}} 21 | } 22 | } 23 | default: // consume until close 24 | for b{{.Sfx}} := range {{.Chan}} { 25 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "gopkg.in/yaml.v2" 5 | "io/ioutil" 6 | "log" 7 | ) 8 | 9 | var Config Conf 10 | 11 | type Conf struct { 12 | Debug bool 13 | AppKey string 14 | Db Db 15 | Lvdb string 16 | Sms Sms 17 | Wechat Wechat 18 | } 19 | 20 | type Db struct { 21 | Url string 22 | } 23 | 24 | type Sms struct { 25 | Key string 26 | Secret string 27 | Sign string 28 | RegTplCode string 29 | LoginTplCode string 30 | } 31 | 32 | type Wechat struct { 33 | Id string 34 | Secret string 35 | } 36 | 37 | func init() { 38 | 39 | data, err := ioutil.ReadFile("config.yml") 40 | if err != nil { 41 | log.Panicln(err.Error()) 42 | } 43 | 44 | err = yaml.Unmarshal(data, &Config) 45 | if err != nil { 46 | log.Panicln(err.Error()) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map implements a thread safe map for go version below 1.9 using mutex 8 | type Map struct { 9 | lock sync.RWMutex 10 | data map[interface{}]interface{} 11 | } 12 | 13 | // NewMap creates a thread safe map 14 | func NewMap() *Map { 15 | return &Map{ 16 | data: make(map[interface{}]interface{}, 32), 17 | } 18 | } 19 | 20 | // Load is same as sync.Map Load 21 | func (m *Map) Load(key interface{}) (elem interface{}, found bool) { 22 | m.lock.RLock() 23 | elem, found = m.data[key] 24 | m.lock.RUnlock() 25 | return 26 | } 27 | 28 | // Load is same as sync.Map Store 29 | func (m *Map) Store(key interface{}, elem interface{}) { 30 | m.lock.Lock() 31 | m.data[key] = elem 32 | m.lock.Unlock() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_nacl.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build nacl 8 | 9 | package storage 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 17 | return nil, syscall.ENOTSUP 18 | } 19 | 20 | func setFileLock(f *os.File, readOnly, lock bool) error { 21 | return syscall.ENOTSUP 22 | } 23 | 24 | func rename(oldpath, newpath string) error { 25 | return syscall.ENOTSUP 26 | } 27 | 28 | func isErrInvalid(err error) bool { 29 | return false 30 | } 31 | 32 | func syncDir(name string) error { 33 | return syscall.ENOTSUP 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "log" 9 | 10 | "github.com/gin-gonic/gin/binding" 11 | ) 12 | 13 | // BindWith binds the passed struct pointer using the specified binding engine. 14 | // See the binding package. 15 | func (c *Context) BindWith(obj interface{}, b binding.Binding) error { 16 | log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to 17 | be deprecated, please check issue #662 and either use MustBindWith() if you 18 | want HTTP 400 to be automatically returned if any error occur, or use 19 | ShouldBindWith() if you need to manage the error.`) 20 | return c.MustBindWith(obj, b) 21 | } 22 | -------------------------------------------------------------------------------- /app.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "qipai/controller" 6 | "qipai/game" 7 | _ "qipai/router" 8 | "time" 9 | "zero" 10 | 11 | "github.com/golang/glog" 12 | ) 13 | 14 | var debug bool 15 | 16 | func init() { 17 | flag.BoolVar(&debug, "d", false, "是否开启调试") 18 | flag.Parse() 19 | } 20 | 21 | func main() { 22 | go func() { 23 | err := controller.R.Run(":9988") 24 | if err != nil { 25 | glog.Fatalln(err) 26 | } 27 | }() 28 | 29 | host := ":8899" 30 | ss, err := zero.NewSocketService(host) 31 | if err != nil { 32 | glog.Fatal(err) 33 | } 34 | 35 | ss.SetHeartBeat(5*time.Second, 120*time.Second) 36 | 37 | ss.RegMessageHandler(game.HandleMessage) 38 | ss.RegConnectHandler(game.HandleConnect) 39 | ss.RegDisconnectHandler(game.HandleDisconnect) 40 | 41 | glog.Infoln("服务器启动成功,监听地址" + host) 42 | 43 | ss.Serv() 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | 22 | ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] 23 | 24 | [[constraint]] 25 | name = "github.com/modern-go/reflect2" 26 | version = "1.0.1" 27 | -------------------------------------------------------------------------------- /domain/user.go: -------------------------------------------------------------------------------- 1 | package domain 2 | 3 | import ( 4 | "qipai/enum" 5 | "zero" 6 | ) 7 | 8 | type ReqLogin struct { 9 | Type enum.UserType `form:"type" json:"type" binding:"required"` 10 | Name string `form:"name" json:"name" binding:"required"` 11 | Pass string `form:"pass" json:"pass" binding:"required"` 12 | Session *zero.Session `json:"-"` 13 | } 14 | 15 | 16 | type ReqReg struct { 17 | UserType enum.UserType `form:"type" json:"type" binding:"required"` 18 | Nick string `form:"nick" json:"nick" binding:"required"` 19 | Pass string `form:"pass" json:"pass" binding:"required"` 20 | Name string `form:"name" json:"name" binding:"required"` 21 | Code string `form:"code" json:"code" binding:"required"` 22 | } 23 | 24 | 25 | 26 | type ReqLoginByToken struct { 27 | Token string `json:"token"` 28 | } -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "encoding/xml" 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | type xmlBinding struct{} 15 | 16 | func (xmlBinding) Name() string { 17 | return "xml" 18 | } 19 | 20 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error { 21 | return decodeXML(req.Body, obj) 22 | } 23 | 24 | func (xmlBinding) BindBody(body []byte, obj interface{}) error { 25 | return decodeXML(bytes.NewReader(body), obj) 26 | } 27 | func decodeXML(r io.Reader, obj interface{}) error { 28 | decoder := xml.NewDecoder(r) 29 | if err := decoder.Decode(obj); err != nil { 30 | return err 31 | } 32 | return validate(obj) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /game/card/constants.go: -------------------------------------------------------------------------------- 1 | package card 2 | 3 | const ( 4 | CardType_Fangpian int = iota + 1 //方片 5 | CardType_Meihua //梅花 6 | CardType_Hongtao //红桃 7 | CardType_Heitao //黑桃 8 | CardType_Xiaowang //小王 9 | CardType_Dawang //大王 10 | ) 11 | 12 | const ( 13 | DouniuType_Meiniu int = iota //没牛 14 | DouniuType_Niu1 //牛1 15 | DouniuType_Niu2 //牛2 16 | DouniuType_Niu3 //牛3 17 | DouniuType_Niu4 //牛4 18 | DouniuType_Niu5 //牛5 19 | DouniuType_Niu6 //牛6 20 | DouniuType_Niu7 //牛7 21 | DouniuType_Niu8 //牛8 22 | DouniuType_Niu9 //牛9 23 | DouniuType_Niuniu //牛牛 24 | DouniuType_Wuhua //五花牛 25 | DouniuType_Zhadan //炸弹牛 26 | DouniuType_Wuxiao //五小牛 27 | ) 28 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/redirect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | type Redirect struct { 13 | Code int 14 | Request *http.Request 15 | Location string 16 | } 17 | 18 | func (r Redirect) Render(w http.ResponseWriter) error { 19 | // todo(thinkerou): go1.6 not support StatusPermanentRedirect(308) 20 | // when we upgrade go version we can use http.StatusPermanentRedirect 21 | if (r.Code < 300 || r.Code > 308) && r.Code != 201 { 22 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code)) 23 | } 24 | http.Redirect(w, r.Request, r.Location, r.Code) 25 | return nil 26 | } 27 | 28 | func (r Redirect) WriteContentType(http.ResponseWriter) {} 29 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/callback_row_query.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "database/sql" 4 | 5 | // Define callbacks for row query 6 | func init() { 7 | DefaultCallback.RowQuery().Register("gorm:row_query", rowQueryCallback) 8 | } 9 | 10 | type RowQueryResult struct { 11 | Row *sql.Row 12 | } 13 | 14 | type RowsQueryResult struct { 15 | Rows *sql.Rows 16 | Error error 17 | } 18 | 19 | // queryCallback used to query data from database 20 | func rowQueryCallback(scope *Scope) { 21 | if result, ok := scope.InstanceGet("row_query_result"); ok { 22 | scope.prepareQuerySQL() 23 | 24 | if rowResult, ok := result.(*RowQueryResult); ok { 25 | rowResult.Row = scope.SQLDB().QueryRow(scope.SQL, scope.SQLVars...) 26 | } else if rowsResult, ok := result.(*RowsQueryResult); ok { 27 | rowsResult.Rows, rowsResult.Error = scope.SQLDB().Query(scope.SQL, scope.SQLVars...) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/ugorji/go/codec" 11 | ) 12 | 13 | type MsgPack struct { 14 | Data interface{} 15 | } 16 | 17 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"} 18 | 19 | func (r MsgPack) WriteContentType(w http.ResponseWriter) { 20 | writeContentType(w, msgpackContentType) 21 | } 22 | 23 | func (r MsgPack) Render(w http.ResponseWriter) error { 24 | return WriteMsgPack(w, r.Data) 25 | } 26 | 27 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error { 28 | writeContentType(w, msgpackContentType) 29 | var h codec.Handle = new(codec.MsgpackHandle) 30 | return codec.NewEncoder(w, h).Encode(obj) 31 | } 32 | -------------------------------------------------------------------------------- /middleware/auth.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "net/http" 6 | "qipai/utils" 7 | ) 8 | 9 | 10 | // JWTAuth 中间件,检查token 11 | func JWTAuth() gin.HandlerFunc { 12 | return func(c *gin.Context) { 13 | token := c.Request.Header.Get("token") 14 | if token == "" { 15 | c.JSON(http.StatusBadRequest, gin.H{ 16 | "msg": "请求未携带token,无权限访问", 17 | }) 18 | c.Abort() 19 | return 20 | } 21 | 22 | j := utils.NewJWT() 23 | // parseToken 解析token包含的信息 24 | claims, err := j.ParseToken(token) 25 | if err != nil { 26 | if err == utils.TokenExpired { 27 | c.JSON(http.StatusBadRequest, gin.H{ 28 | "msg": "授权已过期", 29 | }) 30 | c.Abort() 31 | return 32 | } 33 | c.JSON(http.StatusBadRequest, gin.H{ 34 | "msg": err.Error(), 35 | }) 36 | c.Abort() 37 | return 38 | } 39 | // 继续交由下一个路由处理,并将解析出的信息传递下去 40 | c.Set("user", claims) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | ignored = [] 28 | 29 | [[constraint]] 30 | name = "github.com/modern-go/concurrent" 31 | version = "1.0.0" 32 | 33 | [prune] 34 | go-tests = true 35 | unused-packages = true 36 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/safe_struct.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | type safeStructType struct { 4 | safeType 5 | } 6 | 7 | func (type2 *safeStructType) FieldByName(name string) StructField { 8 | field, found := type2.Type.FieldByName(name) 9 | if !found { 10 | panic("field " + name + " not found") 11 | } 12 | return &safeField{StructField: field} 13 | } 14 | 15 | func (type2 *safeStructType) Field(i int) StructField { 16 | return &safeField{StructField: type2.Type.Field(i)} 17 | } 18 | 19 | func (type2 *safeStructType) FieldByIndex(index []int) StructField { 20 | return &safeField{StructField: type2.Type.FieldByIndex(index)} 21 | } 22 | 23 | func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField { 24 | field, found := type2.Type.FieldByNameFunc(match) 25 | if !found { 26 | panic("field match condition not found in " + type2.Type.String()) 27 | } 28 | return &safeField{StructField: field} 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | type String struct { 14 | Format string 15 | Data []interface{} 16 | } 17 | 18 | var plainContentType = []string{"text/plain; charset=utf-8"} 19 | 20 | func (r String) Render(w http.ResponseWriter) error { 21 | WriteString(w, r.Format, r.Data) 22 | return nil 23 | } 24 | 25 | func (r String) WriteContentType(w http.ResponseWriter) { 26 | writeContentType(w, plainContentType) 27 | } 28 | 29 | func WriteString(w http.ResponseWriter, format string, data []interface{}) { 30 | writeContentType(w, plainContentType) 31 | if len(data) > 0 { 32 | fmt.Fprintf(w, format, data...) 33 | } else { 34 | io.WriteString(w, format) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "net/http" 11 | 12 | "github.com/ugorji/go/codec" 13 | ) 14 | 15 | type msgpackBinding struct{} 16 | 17 | func (msgpackBinding) Name() string { 18 | return "msgpack" 19 | } 20 | 21 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error { 22 | return decodeMsgPack(req.Body, obj) 23 | } 24 | 25 | func (msgpackBinding) BindBody(body []byte, obj interface{}) error { 26 | return decodeMsgPack(bytes.NewReader(body), obj) 27 | } 28 | 29 | func decodeMsgPack(r io.Reader, obj interface{}) error { 30 | cdc := new(codec.MsgpackHandle) 31 | if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil { 32 | return err 33 | } 34 | return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md: -------------------------------------------------------------------------------- 1 | | json type \ dest type | bool | int | uint | float |string| 2 | | --- | --- | --- | --- |--|--| 3 | | number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin| 4 | | string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin| 5 | | bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"| 6 | | object | true | 0 | 0 |0|originnal json| 7 | | array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json| -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/reader.go: -------------------------------------------------------------------------------- 1 | package render 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "strconv" 7 | ) 8 | 9 | type Reader struct { 10 | ContentType string 11 | ContentLength int64 12 | Reader io.Reader 13 | Headers map[string]string 14 | } 15 | 16 | // Render (Reader) writes data with custom ContentType and headers. 17 | func (r Reader) Render(w http.ResponseWriter) (err error) { 18 | r.WriteContentType(w) 19 | r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10) 20 | r.writeHeaders(w, r.Headers) 21 | _, err = io.Copy(w, r.Reader) 22 | return 23 | } 24 | 25 | func (r Reader) WriteContentType(w http.ResponseWriter) { 26 | writeContentType(w, []string{r.ContentType}) 27 | } 28 | 29 | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string]string) { 30 | header := w.Header() 31 | for k, v := range headers { 32 | if val := header[k]; len(val) == 0 { 33 | header[k] = []string{v} 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Package jsoniter implements encoding and decoding of JSON as defined in 2 | // RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json. 3 | // Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter 4 | // and variable type declarations (if any). 5 | // jsoniter interfaces gives 100% compatibility with code using standard lib. 6 | // 7 | // "JSON and Go" 8 | // (https://golang.org/doc/articles/json_and_go.html) 9 | // gives a description of how Marshal/Unmarshal operate 10 | // between arbitrary or predefined json objects and bytes, 11 | // and it applies to jsoniter.Marshal/Unmarshal as well. 12 | // 13 | // Besides, jsoniter.Iterator provides a different set of interfaces 14 | // iterating given bytes/string/reader 15 | // and yielding parsed elements one by one. 16 | // This set of interfaces reads input as required and gives 17 | // better performance. 18 | package jsoniter 19 | -------------------------------------------------------------------------------- /model/user.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "github.com/jinzhu/gorm" 5 | "qipai/enum" 6 | "qipai/utils" 7 | ) 8 | 9 | type Auth struct { 10 | gorm.Model 11 | UserType enum.UserType `gorm:"type:int;not null"` 12 | Name string `gorm:"size:50"` 13 | Pass string `gorm:"size:50" json:"-"` 14 | Verified bool 15 | UserId int 16 | User User `gorm:"foreignkey:UserId" json:"-"` 17 | Thirdly bool `json:"-"` 18 | } 19 | 20 | type User struct { 21 | gorm.Model 22 | Nick string `gorm:"size:20" json:"nick"` 23 | Avatar string `gorm:"size:255" json:"avatar"` 24 | Mobile string `gorm:"size:20" json:"mobile"` 25 | Sex int `json:"sex"` // 普通用户性别,1为男性,2为女性 26 | Ip string `gorm:"size:22" json:"ip"` 27 | Address string `gorm:"size:100" json:"address"` 28 | Card int `json:"card"` 29 | Auths []Auth ` json:"-"` 30 | } 31 | 32 | 33 | type SpecialUser struct { 34 | Uid uint 35 | } 36 | 37 | func (this *Auth) BeforeSave() (err error) { 38 | this.Pass = utils.PassEncode(this.Pass) 39 | return 40 | } 41 | -------------------------------------------------------------------------------- /utils/db.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb" 5 | "log" 6 | "qipai/config" 7 | "time" 8 | ) 9 | 10 | var Lv *lv 11 | 12 | type lv struct { 13 | db *leveldb.DB 14 | } 15 | 16 | func initLv() () { 17 | db, err := leveldb.OpenFile(config.Config.Lvdb, nil) 18 | if err != nil { 19 | log.Panic(err.Error()) 20 | } 21 | Lv = &lv{ 22 | db: db, 23 | } 24 | } 25 | 26 | func (this *lv) Get(key string) string { 27 | data, _ := this.db.Get([]byte(key), nil) 28 | return string(data) 29 | } 30 | 31 | func (this *lv) Put(key, value string)(err error) { 32 | err = this.db.Put([]byte(key), []byte(value), nil) 33 | return 34 | } 35 | 36 | func (this *lv) PutEx(key, value string, expired time.Duration) { 37 | this.Put(key, value) 38 | go func() { 39 | time.Sleep(expired) 40 | this.Del(key) 41 | }() 42 | } 43 | 44 | func (this *lv) Del(key string)(err error) { 45 | err = this.db.Delete([]byte(key), nil) 46 | return 47 | } 48 | 49 | func (this *lv) Close()(err error) { 50 | err = this.db.Close() 51 | return 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go16.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "io/ioutil" 9 | "net/http" 10 | 11 | "github.com/golang/protobuf/proto" 12 | ) 13 | 14 | type protobufBinding struct{} 15 | 16 | func (protobufBinding) Name() string { 17 | return "protobuf" 18 | } 19 | 20 | func (b protobufBinding) Bind(req *http.Request, obj interface{}) error { 21 | buf, err := ioutil.ReadAll(req.Body) 22 | if err != nil { 23 | return err 24 | } 25 | return b.BindBody(buf, obj) 26 | } 27 | 28 | func (protobufBinding) BindBody(body []byte, obj interface{}) error { 29 | if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil { 30 | return err 31 | } 32 | // Here it's same to return validate(obj), but util now we cann't add 33 | // `binding:""` to the struct which automatically generate by gen-proto 34 | return nil 35 | // return validate(obj) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Render interface { 10 | Render(http.ResponseWriter) error 11 | WriteContentType(w http.ResponseWriter) 12 | } 13 | 14 | var ( 15 | _ Render = JSON{} 16 | _ Render = IndentedJSON{} 17 | _ Render = SecureJSON{} 18 | _ Render = JsonpJSON{} 19 | _ Render = XML{} 20 | _ Render = String{} 21 | _ Render = Redirect{} 22 | _ Render = Data{} 23 | _ Render = HTML{} 24 | _ HTMLRender = HTMLDebug{} 25 | _ HTMLRender = HTMLProduction{} 26 | _ Render = YAML{} 27 | _ Render = MsgPack{} 28 | _ Render = Reader{} 29 | _ Render = AsciiJSON{} 30 | ) 31 | 32 | func writeContentType(w http.ResponseWriter, value []string) { 33 | header := w.Header() 34 | if val := header["Content-Type"]; len(val) == 0 { 35 | header["Content-Type"] = value 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/reflect2_kind.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | // DefaultTypeOfKind return the non aliased default type for the kind 9 | func DefaultTypeOfKind(kind reflect.Kind) Type { 10 | return kindTypes[kind] 11 | } 12 | 13 | var kindTypes = map[reflect.Kind]Type{ 14 | reflect.Bool: TypeOf(true), 15 | reflect.Uint8: TypeOf(uint8(0)), 16 | reflect.Int8: TypeOf(int8(0)), 17 | reflect.Uint16: TypeOf(uint16(0)), 18 | reflect.Int16: TypeOf(int16(0)), 19 | reflect.Uint32: TypeOf(uint32(0)), 20 | reflect.Int32: TypeOf(int32(0)), 21 | reflect.Uint64: TypeOf(uint64(0)), 22 | reflect.Int64: TypeOf(int64(0)), 23 | reflect.Uint: TypeOf(uint(0)), 24 | reflect.Int: TypeOf(int(0)), 25 | reflect.Float32: TypeOf(float32(0)), 26 | reflect.Float64: TypeOf(float64(0)), 27 | reflect.Uintptr: TypeOf(uintptr(0)), 28 | reflect.String: TypeOf(""), 29 | reflect.UnsafePointer: TypeOf(unsafe.Pointer(nil)), 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Dave Grijalva 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | 9 | -------------------------------------------------------------------------------- /dao/user.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "errors" 5 | "github.com/golang/glog" 6 | "github.com/jinzhu/gorm" 7 | "qipai/model" 8 | ) 9 | 10 | var User userDao 11 | 12 | type userDao struct { 13 | } 14 | 15 | func (userDao) Get(uid uint) (user model.User, err error) { 16 | ret := Db().First(&user, uid) 17 | if ret.Error != nil { 18 | err = errors.New("查询用户数据出错") 19 | glog.Errorln(ret.Error) 20 | return 21 | } 22 | 23 | if ret.RecordNotFound() { 24 | err = errors.New("该用户不存在") 25 | return 26 | } 27 | return 28 | } 29 | 30 | // 扣除房卡 31 | func (userDao) TakeCard(uid uint, cards int) (err error) { 32 | ret:=Db().Model(&model.User{}).Where("id=?", uid).Update("card", gorm.Expr("card-?", cards)) 33 | if ret.Error != nil { 34 | err = errors.New("扣除房卡出错") 35 | glog.Errorln(ret.Error) 36 | return 37 | } 38 | 39 | if ret.RecordNotFound() { 40 | err = errors.New("扣除房卡失败") 41 | return 42 | } 43 | return 44 | } 45 | 46 | // 是否是特殊用户 47 | func (userDao) IsSpecialUser(uid uint)(ok bool){ 48 | var user model.SpecialUser 49 | ret := Db().First(&user,uid) 50 | ok = !ret.RecordNotFound() 51 | return 52 | } 53 | -------------------------------------------------------------------------------- /domain/room.go: -------------------------------------------------------------------------------- 1 | package domain 2 | 3 | import "qipai/enum" 4 | 5 | type ReqCreateRoom struct { 6 | Players int `json:"players"` 7 | Score enum.ScoreType `json:"score"` 8 | Pay enum.PayType `json:"pay"` 9 | Count int `json:"count"` 10 | StartType enum.StartType `json:"start"` 11 | Times int `json:"times"` 12 | Tui bool `json:"tui"` 13 | } 14 | 15 | type ResRoomV struct { 16 | ID uint `json:"id"` 17 | Score enum.ScoreType `json:"score"` // 底分类型 18 | Pay enum.PayType `json:"pay"` // 支付方式 19 | Current int `json:"current"` // 当前第几局 20 | Count int `json:"count"` // 总共可以玩几局 21 | Uid uint `json:"uid"` // 房主用户编号 22 | StartType enum.StartType `json:"startType"` // 游戏开始方式 23 | Players int `json:"players"` // 玩家个数 24 | ClubId uint `json:"clubId"` // 属于哪个俱乐部 25 | TableId int `json:"tableId"` // 俱乐部第几桌 26 | Status enum.GameStatus `json:"status"` 27 | Times int `json:"times"` // 翻倍方式 28 | } 29 | -------------------------------------------------------------------------------- /utils/sms.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "qipai/config" 5 | 6 | "github.com/golang/glog" 7 | alisms "github.com/noxue/alisms" 8 | ) 9 | 10 | func SendSms(tplCode, mobile, code string) bool { 11 | 12 | if config.Config.Debug { 13 | glog.Infoln(mobile, "发送的验证码为:", code) 14 | return true 15 | } 16 | 17 | userInput := &alisms.UserParams{ 18 | AccessKeyId: config.Config.Sms.Key, 19 | AppSecret: config.Config.Sms.Secret, 20 | PhoneNumbers: mobile, 21 | SignName: config.Config.Sms.Sign, 22 | TemplateCode: tplCode, 23 | // 模板变量赋值,一定是json格式,注意转义 24 | TemplateParam: "{\"code\": \"" + code + "\"}", 25 | } 26 | ok, msg, err := alisms.SendMessage(userInput) 27 | if !ok { 28 | // 根据业务进行错误处理 29 | glog.Errorln(msg, err) 30 | } 31 | return ok 32 | } 33 | 34 | func SendSmsRegCode(mobile, code string) bool { 35 | return SendSms("SMS_155370082", mobile, code) 36 | } 37 | 38 | func SendSmsResetCode(mobile, code string) bool { 39 | return SendSms("SMS_155370082", mobile, code) 40 | } 41 | 42 | func SendSmsLoginCode(mobile, code string) bool { 43 | return SendSms("SMS_155370082", mobile, code) 44 | } 45 | -------------------------------------------------------------------------------- /common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | const ( 4 | // UnifiedOrderURL 微信统一下单 5 | UnifiedOrderURL = "https://api.mch.weixin.qq.com/pay/unifiedorder" 6 | ) 7 | 8 | // https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419317853&token=&lang=zh_CN 9 | const ( 10 | //https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code 11 | // AccessTokenURL code获取access_token 12 | AccessTokenURL = "https://api.weixin.qq.com/sns/oauth2/access_token" 13 | 14 | // RefreshTokenURL 重新获取access_token 15 | RefreshTokenURL = "https://api.weixin.qq.com/sns/oauth2/refresh_token" 16 | 17 | // UserInfoURL 通过access_token获取userInfo 18 | UserInfoURL = "https://api.weixin.qq.com/sns/userinfo" 19 | 20 | // CheckAccessTokenURL 检验授权凭证(access_token)是否有效 21 | CheckAccessTokenURL = "https://api.weixin.qq.com/sns/auth" 22 | 23 | // JsCode2SessionURL 临时登录凭证校验接口 24 | JsCode2SessionURL = "https://api.weixin.qq.com/sns/jscode2session" 25 | 26 | // SendRedPackURL 发送现金红包 27 | SendRedPackURL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack" 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 9b9387 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/pool.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | // IteratorPool a thread safe pool of iterators with same configuration 8 | type IteratorPool interface { 9 | BorrowIterator(data []byte) *Iterator 10 | ReturnIterator(iter *Iterator) 11 | } 12 | 13 | // StreamPool a thread safe pool of streams with same configuration 14 | type StreamPool interface { 15 | BorrowStream(writer io.Writer) *Stream 16 | ReturnStream(stream *Stream) 17 | } 18 | 19 | func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream { 20 | stream := cfg.streamPool.Get().(*Stream) 21 | stream.Reset(writer) 22 | return stream 23 | } 24 | 25 | func (cfg *frozenConfig) ReturnStream(stream *Stream) { 26 | stream.out = nil 27 | stream.Error = nil 28 | stream.Attachment = nil 29 | cfg.streamPool.Put(stream) 30 | } 31 | 32 | func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator { 33 | iter := cfg.iteratorPool.Get().(*Iterator) 34 | iter.ResetBytes(data) 35 | return iter 36 | } 37 | 38 | func (cfg *frozenConfig) ReturnIterator(iter *Iterator) { 39 | iter.Error = nil 40 | iter.Attachment = nil 41 | cfg.iteratorPool.Put(iter) 42 | } 43 | -------------------------------------------------------------------------------- /dao/init.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "log" 5 | "qipai/config" 6 | "qipai/model" 7 | 8 | _ "github.com/go-sql-driver/mysql" 9 | "github.com/jinzhu/gorm" 10 | ) 11 | 12 | var db *gorm.DB 13 | 14 | func Db() *gorm.DB { 15 | return db.New() 16 | } 17 | 18 | // 测试表,用于判断是否设置过 AUTO_INCREMENT 19 | type test struct { 20 | gorm.Model 21 | } 22 | 23 | func init() { 24 | var err error 25 | db, err = gorm.Open("mysql", config.Config.Db.Url) 26 | if err != nil { 27 | log.Panicln(err.Error()) 28 | } 29 | 30 | db = db.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;") 31 | 32 | db.LogMode(true) 33 | 34 | Db().AutoMigrate( 35 | &model.Auth{}, 36 | &model.User{}, 37 | &model.Room{}, 38 | &model.Club{}, 39 | &model.ClubRoom{}, 40 | &model.ClubUser{}, 41 | &model.Player{}, 42 | &model.Game{}, 43 | &model.SpecialUser{}, 44 | ) 45 | 46 | // 第一次创建,到此处还没有test表,才执行下面操作 47 | if !Db().HasTable(&test{}) { 48 | Db().Exec("alter table rooms AUTO_INCREMENT = 101010") 49 | Db().Exec("alter table clubs AUTO_INCREMENT = 101010") 50 | Db().Exec("alter table users AUTO_INCREMENT = 368751") 51 | } 52 | 53 | Db().AutoMigrate(&test{}) 54 | } 55 | -------------------------------------------------------------------------------- /game/StateShowCard.go: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | import ( 4 | "github.com/golang/glog" 5 | "github.com/noxue/utils/fsm" 6 | "qipai/dao" 7 | "qipai/utils" 8 | "time" 9 | "utils/argsUtil" 10 | ) 11 | 12 | func StateShowCard(action fsm.ActionType, args ...interface{}) (nextState fsm.StateType) { 13 | if action != ShowCardAction { 14 | return 15 | } 16 | 17 | var roomId uint 18 | e := argsUtil.NewArgsUtil(args...).To(&roomId) 19 | if e != nil { 20 | glog.Errorln(e) 21 | return 22 | } 23 | 24 | gs, err := dao.Game.GetCurrentGames(roomId) 25 | if err != nil { 26 | glog.Error(err) 27 | return 28 | } 29 | for _, g := range gs { 30 | pp := GetPlayer(g.PlayerId) 31 | if pp == nil { 32 | glog.V(3).Infoln("用户", g.PlayerId, "不在线,无法通知他看牌") 33 | continue 34 | } 35 | 36 | e := utils.Msg("").AddData("game", g).Send(BroadcastShowCard, pp.Session) 37 | if e != nil { 38 | glog.Error(e) 39 | } 40 | } 41 | 42 | g1, e := Games.Get(roomId) 43 | if e!=nil{ 44 | glog.Error(e) 45 | return 46 | } 47 | 48 | nextState = CompareCardState 49 | 50 | go func() { 51 | time.Sleep(time.Second*6) // 等待一秒后通知比牌 52 | g1.CompareCard() 53 | }() 54 | 55 | return 56 | } -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 json-iterator 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 - Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/sse/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-playground/validator/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dean Karn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dean Karn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2015 Ugorji Nwoke. 4 | All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Reporting Issues 4 | 5 | Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed). 6 | 7 | ## Contributing Code 8 | 9 | By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file. 10 | Don't forget to add yourself to the AUTHORS file. 11 | 12 | ### Code Review 13 | 14 | Everyone is invited to review and comment on pull requests. 15 | If it looks fine to you, comment with "LGTM" (Looks good to me). 16 | 17 | If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes. 18 | 19 | Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM". 20 | 21 | ## Development Ideas 22 | 23 | If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page. 24 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7,!go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | DynamicRecordSizingDisabled: cfg.DynamicRecordSizingDisabled, 27 | Renegotiation: cfg.Renegotiation, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /game/card/check_cards_test.go: -------------------------------------------------------------------------------- 1 | package card 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestGetPaixing(t *testing.T) { 9 | 10 | var cards []*Card 11 | 12 | card := &Card{ 13 | CardType: CardType_Meihua, 14 | CardNo: 3, 15 | CardId: 1, 16 | } 17 | cards = append(cards, card) 18 | 19 | card = &Card{ 20 | CardType: CardType_Fangpian, 21 | CardNo: 7, 22 | CardId: 2, 23 | } 24 | cards = append(cards, card) 25 | 26 | card = &Card{ 27 | CardType: CardType_Heitao, 28 | CardNo: 13, 29 | CardId: 3, 30 | } 31 | cards = append(cards, card) 32 | 33 | card = &Card{ 34 | CardType: CardType_Hongtao, 35 | CardNo: 1, 36 | CardId: 4, 37 | } 38 | cards = append(cards, card) 39 | 40 | card = &Card{ 41 | CardType: CardType_Meihua, 42 | CardNo: 7, 43 | CardId: 5, 44 | } 45 | cards = append(cards, card) 46 | 47 | paixing, cs := getPaixing(cards) 48 | print(paixing, cs) 49 | } 50 | 51 | func TestGetPaixing2(t *testing.T) { 52 | px, cards, err := GetPaixing("48|16|18|23|1") 53 | print(px, " ", cards, err) 54 | } 55 | 56 | func TestTTTT(t *testing.T) { 57 | var a interface{} 58 | c := 1 59 | a = c 60 | i := reflect.TypeOf(a) 61 | print(i.Kind(), i.Kind() == reflect.Array) 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "net/http" 11 | 12 | "github.com/gin-gonic/gin/json" 13 | ) 14 | 15 | // EnableDecoderUseNumber is used to call the UseNumber method on the JSON 16 | // Decoder instance. UseNumber causes the Decoder to unmarshal a number into an 17 | // interface{} as a Number instead of as a float64. 18 | var EnableDecoderUseNumber = false 19 | 20 | type jsonBinding struct{} 21 | 22 | func (jsonBinding) Name() string { 23 | return "json" 24 | } 25 | 26 | func (jsonBinding) Bind(req *http.Request, obj interface{}) error { 27 | return decodeJSON(req.Body, obj) 28 | } 29 | 30 | func (jsonBinding) BindBody(body []byte, obj interface{}) error { 31 | return decodeJSON(bytes.NewReader(body), obj) 32 | } 33 | 34 | func decodeJSON(r io.Reader, obj interface{}) error { 35 | decoder := json.NewDecoder(r) 36 | if EnableDecoderUseNumber { 37 | decoder.UseNumber() 38 | } 39 | if err := decoder.Decode(obj); err != nil { 40 | return err 41 | } 42 | return validate(obj) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_nil.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | type nilAny struct { 4 | baseAny 5 | } 6 | 7 | func (any *nilAny) LastError() error { 8 | return nil 9 | } 10 | 11 | func (any *nilAny) ValueType() ValueType { 12 | return NilValue 13 | } 14 | 15 | func (any *nilAny) MustBeValid() Any { 16 | return any 17 | } 18 | 19 | func (any *nilAny) ToBool() bool { 20 | return false 21 | } 22 | 23 | func (any *nilAny) ToInt() int { 24 | return 0 25 | } 26 | 27 | func (any *nilAny) ToInt32() int32 { 28 | return 0 29 | } 30 | 31 | func (any *nilAny) ToInt64() int64 { 32 | return 0 33 | } 34 | 35 | func (any *nilAny) ToUint() uint { 36 | return 0 37 | } 38 | 39 | func (any *nilAny) ToUint32() uint32 { 40 | return 0 41 | } 42 | 43 | func (any *nilAny) ToUint64() uint64 { 44 | return 0 45 | } 46 | 47 | func (any *nilAny) ToFloat32() float32 { 48 | return 0 49 | } 50 | 51 | func (any *nilAny) ToFloat64() float64 { 52 | return 0 53 | } 54 | 55 | func (any *nilAny) ToString() string { 56 | return "" 57 | } 58 | 59 | func (any *nilAny) WriteTo(stream *Stream) { 60 | stream.WriteNil() 61 | } 62 | 63 | func (any *nilAny) Parse() *Iterator { 64 | return nil 65 | } 66 | 67 | func (any *nilAny) GetInterface() interface{} { 68 | return nil 69 | } 70 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/unsafe_ptr.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | type UnsafePtrType struct { 9 | unsafeType 10 | } 11 | 12 | func newUnsafePtrType(cfg *frozenConfig, type1 reflect.Type) *UnsafePtrType { 13 | return &UnsafePtrType{ 14 | unsafeType: *newUnsafeType(cfg, type1), 15 | } 16 | } 17 | 18 | func (type2 *UnsafePtrType) IsNil(obj interface{}) bool { 19 | if obj == nil { 20 | return true 21 | } 22 | objEFace := unpackEFace(obj) 23 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype) 24 | return type2.UnsafeIsNil(objEFace.data) 25 | } 26 | 27 | func (type2 *UnsafePtrType) UnsafeIsNil(ptr unsafe.Pointer) bool { 28 | if ptr == nil { 29 | return true 30 | } 31 | return *(*unsafe.Pointer)(ptr) == nil 32 | } 33 | 34 | func (type2 *UnsafePtrType) LikePtr() bool { 35 | return true 36 | } 37 | 38 | func (type2 *UnsafePtrType) Indirect(obj interface{}) interface{} { 39 | objEFace := unpackEFace(obj) 40 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype) 41 | return type2.UnsafeIndirect(objEFace.data) 42 | } 43 | 44 | func (type2 *UnsafePtrType) UnsafeIndirect(ptr unsafe.Pointer) interface{} { 45 | return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr)) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/signing_method.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | var signingMethods = map[string]func() SigningMethod{} 8 | var signingMethodLock = new(sync.RWMutex) 9 | 10 | // Implement SigningMethod to add new methods for signing or verifying tokens. 11 | type SigningMethod interface { 12 | Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid 13 | Sign(signingString string, key interface{}) (string, error) // Returns encoded signature or error 14 | Alg() string // returns the alg identifier for this method (example: 'HS256') 15 | } 16 | 17 | // Register the "alg" name and a factory function for signing method. 18 | // This is typically done during init() in the method's implementation 19 | func RegisterSigningMethod(alg string, f func() SigningMethod) { 20 | signingMethodLock.Lock() 21 | defer signingMethodLock.Unlock() 22 | 23 | signingMethods[alg] = f 24 | } 25 | 26 | // Get a signing method from an "alg" string 27 | func GetSigningMethod(alg string) (method SigningMethod) { 28 | signingMethodLock.RLock() 29 | defer signingMethodLock.RUnlock() 30 | 31 | if methodF, ok := signingMethods[alg]; ok { 32 | method = methodF() 33 | } 34 | return 35 | } 36 | -------------------------------------------------------------------------------- /utils/Msg.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/golang/glog" 6 | "zero" 7 | ) 8 | 9 | type Message struct { 10 | data map[string]interface{} `json:"data"` 11 | } 12 | 13 | func Msg(msgStr string) *Message { 14 | m := &Message{ 15 | data: make(map[string]interface{}), 16 | } 17 | m.data["code"] = 0 18 | if msgStr != "" { 19 | m.data["msg"] = msgStr 20 | } 21 | return m 22 | } 23 | 24 | func (this *Message) Code(code int) *Message { 25 | this.data["code"] = code 26 | return this 27 | } 28 | 29 | func (this *Message) AddData(key string, data interface{}) *Message { 30 | this.data[key] = data 31 | return this 32 | } 33 | 34 | func (this *Message) ToJson() string { 35 | jsonData, _ := json.Marshal(this.data) 36 | return string(jsonData) 37 | } 38 | 39 | func (this *Message) ToBytes() []byte { 40 | jsonData, _ := json.Marshal(this.data) 41 | return jsonData 42 | } 43 | 44 | func (this *Message) GetData() map[string]interface{}{ 45 | return this.data 46 | } 47 | 48 | // 发送到客户端 49 | func (this *Message) Send(msgID int32, s *zero.Session) (err error) { 50 | message := zero.NewMessage(msgID, this.ToBytes()) 51 | if s == nil { 52 | glog.Warningln("session为nil指针,发送的消息编号为是:", msgID) 53 | return 54 | } 55 | err = s.GetConn().SendMessage(message) 56 | return 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/fs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "net/http" 9 | "os" 10 | ) 11 | 12 | type onlyfilesFS struct { 13 | fs http.FileSystem 14 | } 15 | 16 | type neuteredReaddirFile struct { 17 | http.File 18 | } 19 | 20 | // Dir returns a http.Filesystem that can be used by http.FileServer(). It is used internally 21 | // in router.Static(). 22 | // if listDirectory == true, then it works the same as http.Dir() otherwise it returns 23 | // a filesystem that prevents http.FileServer() to list the directory files. 24 | func Dir(root string, listDirectory bool) http.FileSystem { 25 | fs := http.Dir(root) 26 | if listDirectory { 27 | return fs 28 | } 29 | return &onlyfilesFS{fs} 30 | } 31 | 32 | // Open conforms to http.Filesystem. 33 | func (fs onlyfilesFS) Open(name string) (http.File, error) { 34 | f, err := fs.fs.Open(name) 35 | if err != nil { 36 | return nil, err 37 | } 38 | return neuteredReaddirFile{f}, nil 39 | } 40 | 41 | // Readdir overrides the http.File default implementation. 42 | func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) { 43 | // this disables directory listing 44 | return nil, nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/pool17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gary Burd 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | // +build go1.7 16 | 17 | package redis 18 | 19 | import "context" 20 | 21 | // GetContext gets a connection using the provided context. 22 | // 23 | // The provided Context must be non-nil. If the context expires before the 24 | // connection is complete, an error is returned. Any expiration on the context 25 | // will not affect the returned connection. 26 | // 27 | // If the function completes without error, then the application must close the 28 | // returned connection. 29 | func (p *Pool) GetContext(ctx context.Context) (Conn, error) { 30 | pc, err := p.get(ctx) 31 | if err != nil { 32 | return errorConn{err}, err 33 | } 34 | return &activeConn{p: p, pc: pc}, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package comparer 8 | 9 | import "bytes" 10 | 11 | type bytesComparer struct{} 12 | 13 | func (bytesComparer) Compare(a, b []byte) int { 14 | return bytes.Compare(a, b) 15 | } 16 | 17 | func (bytesComparer) Name() string { 18 | return "leveldb.BytewiseComparator" 19 | } 20 | 21 | func (bytesComparer) Separator(dst, a, b []byte) []byte { 22 | i, n := 0, len(a) 23 | if n > len(b) { 24 | n = len(b) 25 | } 26 | for ; i < n && a[i] == b[i]; i++ { 27 | } 28 | if i >= n { 29 | // Do not shorten if one string is a prefix of the other 30 | } else if c := a[i]; c < 0xff && c+1 < b[i] { 31 | dst = append(dst, a[:i+1]...) 32 | dst[len(dst)-1]++ 33 | return dst 34 | } 35 | return nil 36 | } 37 | 38 | func (bytesComparer) Successor(dst, b []byte) []byte { 39 | for i, c := range b { 40 | if c != 0xff { 41 | dst = append(dst, b[:i+1]...) 42 | dst[len(dst)-1]++ 43 | return dst 44 | } 45 | } 46 | return nil 47 | } 48 | 49 | // DefaultComparer are default implementation of the Comparer interface. 50 | // It uses the natural ordering, consistent with bytes.Compare. 51 | var DefaultComparer = bytesComparer{} 52 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Suryandaru Triandana 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package storage 8 | 9 | import ( 10 | "os" 11 | ) 12 | 13 | type plan9FileLock struct { 14 | f *os.File 15 | } 16 | 17 | func (fl *plan9FileLock) release() error { 18 | return fl.f.Close() 19 | } 20 | 21 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 22 | var ( 23 | flag int 24 | perm os.FileMode 25 | ) 26 | if readOnly { 27 | flag = os.O_RDONLY 28 | } else { 29 | flag = os.O_RDWR 30 | perm = os.ModeExclusive 31 | } 32 | f, err := os.OpenFile(path, flag, perm) 33 | if os.IsNotExist(err) { 34 | f, err = os.OpenFile(path, flag|os.O_CREATE, perm|0644) 35 | } 36 | if err != nil { 37 | return 38 | } 39 | fl = &plan9FileLock{f: f} 40 | return 41 | } 42 | 43 | func rename(oldpath, newpath string) error { 44 | if _, err := os.Stat(newpath); err == nil { 45 | if err := os.Remove(newpath); err != nil { 46 | return err 47 | } 48 | } 49 | 50 | return os.Rename(oldpath, newpath) 51 | } 52 | 53 | func syncDir(name string) error { 54 | f, err := os.Open(name) 55 | if err != nil { 56 | return err 57 | } 58 | defer f.Close() 59 | if err := f.Sync(); err != nil { 60 | return err 61 | } 62 | return nil 63 | } 64 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/session.go: -------------------------------------------------------------------------------- 1 | package zero 2 | 3 | import ( 4 | uuid "github.com/satori/go.uuid" 5 | ) 6 | 7 | // Session struct 8 | type Session struct { 9 | sID string 10 | uID string 11 | conn *Conn 12 | settings map[string]interface{} 13 | } 14 | 15 | // NewSession create a new session 16 | func NewSession(conn *Conn) *Session { 17 | id, _ := uuid.NewV4() 18 | session := &Session{ 19 | sID: id.String(), 20 | uID: "", 21 | conn: conn, 22 | settings: make(map[string]interface{}), 23 | } 24 | 25 | return session 26 | } 27 | 28 | // GetSessionID get session ID 29 | func (s *Session) GetSessionID() string { 30 | return s.sID 31 | } 32 | 33 | // BindUserID bind a user ID to session 34 | func (s *Session) BindUserID(uid string) { 35 | s.uID = uid 36 | } 37 | 38 | // GetUserID get user ID 39 | func (s *Session) GetUserID() string { 40 | return s.uID 41 | } 42 | 43 | // GetConn get zero.Conn pointer 44 | func (s *Session) GetConn() *Conn { 45 | return s.conn 46 | } 47 | 48 | // SetConn set a zero.Conn to session 49 | func (s *Session) SetConn(conn *Conn) { 50 | s.conn = conn 51 | } 52 | 53 | // GetSetting get setting 54 | func (s *Session) GetSetting(key string) interface{} { 55 | 56 | if v, ok := s.settings[key]; ok { 57 | return v 58 | } 59 | 60 | return nil 61 | } 62 | 63 | // SetSetting set setting 64 | func (s *Session) SetSetting(key string, value interface{}) { 65 | s.settings[key] = value 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/README.md: -------------------------------------------------------------------------------- 1 | # zero 2 | A Lightweight Socket Service with heartbeat, Can be easily used in TCP server development. 3 | 4 | [![Build Status](https://api.travis-ci.org/9b9387/zero.svg?branch=master)](https://travis-ci.org/9b9387/zero) 5 | [![Go Report Card](https://goreportcard.com/badge/github.com/9b9387/zero)](https://goreportcard.com/report/github.com/9b9387/zero) 6 | [![GoDoc](https://godoc.org/github.com/9b9387/zero?status.png)](https://godoc.org/github.com/9b9387/zero) 7 | 8 | Wiki Page [https://github.com/9b9387/zero/wiki](https://github.com/9b9387/zero/wiki) 9 | 10 | ## Requirements 11 | 12 | Go version: 1.9.x or later 13 | 14 | ## Usage 15 | 16 | ``` 17 | go get -u github.com/9b9387/zero 18 | ``` 19 | 20 | ```go 21 | import "github.com/9b9387/zero" 22 | 23 | func main() { 24 | host := "127.0.0.1:18787" 25 | 26 | ss, err := zero.NewSocketService(host) 27 | if err != nil { 28 | return 29 | } 30 | 31 | // set Heartbeat 32 | ss.SetHeartBeat(5*time.Second, 30*time.Second) 33 | 34 | // net event 35 | ss.RegMessageHandler(HandleMessage) 36 | ss.RegConnectHandler(HandleConnect) 37 | ss.RegDisconnectHandler(HandleDisconnect) 38 | 39 | ss.Serv() 40 | } 41 | 42 | 43 | ``` 44 | Example Code: [https://github.com/9b9387/zero/blob/master/service_test.go](https://github.com/9b9387/zero/blob/master/service_test.go) 45 | 46 | ## Demo 47 | Unity Client Repository [https://github.com/9b9387/zero_unity_demo](https://github.com/9b9387/zero_unity_demo) 48 | -------------------------------------------------------------------------------- /game/clubUser.go: -------------------------------------------------------------------------------- 1 | package game 2 | 3 | import ( 4 | "github.com/golang/glog" 5 | "sync" 6 | "zero" 7 | ) 8 | 9 | // map[clubId][uid]*clubPlayer 10 | type clubPlayers map[uint]map[uint]*clubPlayer 11 | 12 | var lock sync.Mutex 13 | var ClubPlayers clubPlayers 14 | 15 | type clubPlayer struct { 16 | Session *zero.Session 17 | } 18 | 19 | func init() { 20 | ClubPlayers = make(map[uint]map[uint]*clubPlayer) 21 | } 22 | 23 | // 对指定clubId的用户做指定的操作,用于通知同一个俱乐部中的在线用户 24 | func (me clubPlayers)Do(clubId uint,callback func(s *zero.Session)){ 25 | lock.Lock() 26 | defer lock.Unlock() 27 | for k,v:=range me{ 28 | if k!=clubId{ 29 | continue 30 | } 31 | for _,v1:=range v{ 32 | callback(v1.Session) 33 | } 34 | break 35 | } 36 | } 37 | 38 | func (me clubPlayers) Add(clubId, uid uint, session *zero.Session) { 39 | lock.Lock() 40 | defer lock.Unlock() 41 | 42 | glog.V(3).Infoln(uid, "进入", clubId, "茶楼") 43 | 44 | _, ok := me[clubId] 45 | if !ok { 46 | me[clubId] = make(map[uint]*clubPlayer) 47 | } 48 | if _, ok := me[clubId][uid]; ok { 49 | me[clubId][uid].Session = session 50 | return 51 | } 52 | me[clubId][uid] = &clubPlayer{ 53 | Session: session, 54 | } 55 | } 56 | 57 | func (me clubPlayers) Del(uid uint) { 58 | lock.Lock() 59 | defer lock.Unlock() 60 | for k, v := range ClubPlayers { 61 | for k1, _ := range v { 62 | if k1 == uid { 63 | delete(ClubPlayers[k], k1) 64 | glog.V(3).Infoln(uid, "离开", k, "茶楼") 65 | break 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_int64.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type int64Any struct { 8 | baseAny 9 | val int64 10 | } 11 | 12 | func (any *int64Any) LastError() error { 13 | return nil 14 | } 15 | 16 | func (any *int64Any) ValueType() ValueType { 17 | return NumberValue 18 | } 19 | 20 | func (any *int64Any) MustBeValid() Any { 21 | return any 22 | } 23 | 24 | func (any *int64Any) ToBool() bool { 25 | return any.val != 0 26 | } 27 | 28 | func (any *int64Any) ToInt() int { 29 | return int(any.val) 30 | } 31 | 32 | func (any *int64Any) ToInt32() int32 { 33 | return int32(any.val) 34 | } 35 | 36 | func (any *int64Any) ToInt64() int64 { 37 | return any.val 38 | } 39 | 40 | func (any *int64Any) ToUint() uint { 41 | return uint(any.val) 42 | } 43 | 44 | func (any *int64Any) ToUint32() uint32 { 45 | return uint32(any.val) 46 | } 47 | 48 | func (any *int64Any) ToUint64() uint64 { 49 | return uint64(any.val) 50 | } 51 | 52 | func (any *int64Any) ToFloat32() float32 { 53 | return float32(any.val) 54 | } 55 | 56 | func (any *int64Any) ToFloat64() float64 { 57 | return float64(any.val) 58 | } 59 | 60 | func (any *int64Any) ToString() string { 61 | return strconv.FormatInt(any.val, 10) 62 | } 63 | 64 | func (any *int64Any) WriteTo(stream *Stream) { 65 | stream.WriteInt64(any.val) 66 | } 67 | 68 | func (any *int64Any) Parse() *Iterator { 69 | return nil 70 | } 71 | 72 | func (any *int64Any) GetInterface() interface{} { 73 | return any.val 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_int32.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type int32Any struct { 8 | baseAny 9 | val int32 10 | } 11 | 12 | func (any *int32Any) LastError() error { 13 | return nil 14 | } 15 | 16 | func (any *int32Any) ValueType() ValueType { 17 | return NumberValue 18 | } 19 | 20 | func (any *int32Any) MustBeValid() Any { 21 | return any 22 | } 23 | 24 | func (any *int32Any) ToBool() bool { 25 | return any.val != 0 26 | } 27 | 28 | func (any *int32Any) ToInt() int { 29 | return int(any.val) 30 | } 31 | 32 | func (any *int32Any) ToInt32() int32 { 33 | return any.val 34 | } 35 | 36 | func (any *int32Any) ToInt64() int64 { 37 | return int64(any.val) 38 | } 39 | 40 | func (any *int32Any) ToUint() uint { 41 | return uint(any.val) 42 | } 43 | 44 | func (any *int32Any) ToUint32() uint32 { 45 | return uint32(any.val) 46 | } 47 | 48 | func (any *int32Any) ToUint64() uint64 { 49 | return uint64(any.val) 50 | } 51 | 52 | func (any *int32Any) ToFloat32() float32 { 53 | return float32(any.val) 54 | } 55 | 56 | func (any *int32Any) ToFloat64() float64 { 57 | return float64(any.val) 58 | } 59 | 60 | func (any *int32Any) ToString() string { 61 | return strconv.FormatInt(int64(any.val), 10) 62 | } 63 | 64 | func (any *int32Any) WriteTo(stream *Stream) { 65 | stream.WriteInt32(any.val) 66 | } 67 | 68 | func (any *int32Any) Parse() *Iterator { 69 | return nil 70 | } 71 | 72 | func (any *int32Any) GetInterface() interface{} { 73 | return any.val 74 | } 75 | -------------------------------------------------------------------------------- /dao/room.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "errors" 5 | "github.com/golang/glog" 6 | "qipai/model" 7 | ) 8 | 9 | var Room roomDao 10 | 11 | type roomDao struct { 12 | } 13 | 14 | func (roomDao) Get(roomId uint) (room model.Room, err error) { 15 | if ret := Db().First(&room, roomId); ret.Error != nil || ret.RecordNotFound() { 16 | err = errors.New("该房间不存在") 17 | return 18 | } 19 | return 20 | } 21 | 22 | func (roomDao) IsRoomPlayer(rid, uid uint) bool { 23 | var n int 24 | Db().Model(&model.Player{}).Where(&model.Player{Uid: uid, RoomId: rid}).Count(&n) 25 | return n > 0 26 | } 27 | 28 | // 房间中所有坐下的玩家 29 | func (roomDao) PlayersSitDown(roomId uint) (players []model.Player) { 30 | Db().Where(&model.Player{RoomId: roomId}).Where("desk_id>0").Find(&players) 31 | return 32 | } 33 | func (roomDao) Exists(roomId uint) bool { 34 | var n int 35 | Db().Model(&model.Room{}).Where("id=?", roomId).Count(&n) 36 | return n > 0 37 | } 38 | 39 | // 删除房间信息 40 | func (roomDao) Delete(roomId uint) (err error) { 41 | res := Db().Where("id=?", roomId).Delete(&model.Room{}) 42 | if res.Error != nil { 43 | glog.Errorln(res.Error) 44 | err = errors.New("解散房间出错") 45 | return 46 | } 47 | return 48 | } 49 | 50 | func (roomDao) MyRooms(uid uint) (rooms []model.Room) { 51 | // select r.* from rooms r join players p on p.room_id=r.id where p.uid=100000; 52 | Db().Raw("select r.* from rooms r join players p on p.room_id=r.id where r.`deleted_at` IS NULL and r.club_id=0 and p.uid=?", uid).Scan(&rooms) 53 | return 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_uint64.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type uint64Any struct { 8 | baseAny 9 | val uint64 10 | } 11 | 12 | func (any *uint64Any) LastError() error { 13 | return nil 14 | } 15 | 16 | func (any *uint64Any) ValueType() ValueType { 17 | return NumberValue 18 | } 19 | 20 | func (any *uint64Any) MustBeValid() Any { 21 | return any 22 | } 23 | 24 | func (any *uint64Any) ToBool() bool { 25 | return any.val != 0 26 | } 27 | 28 | func (any *uint64Any) ToInt() int { 29 | return int(any.val) 30 | } 31 | 32 | func (any *uint64Any) ToInt32() int32 { 33 | return int32(any.val) 34 | } 35 | 36 | func (any *uint64Any) ToInt64() int64 { 37 | return int64(any.val) 38 | } 39 | 40 | func (any *uint64Any) ToUint() uint { 41 | return uint(any.val) 42 | } 43 | 44 | func (any *uint64Any) ToUint32() uint32 { 45 | return uint32(any.val) 46 | } 47 | 48 | func (any *uint64Any) ToUint64() uint64 { 49 | return any.val 50 | } 51 | 52 | func (any *uint64Any) ToFloat32() float32 { 53 | return float32(any.val) 54 | } 55 | 56 | func (any *uint64Any) ToFloat64() float64 { 57 | return float64(any.val) 58 | } 59 | 60 | func (any *uint64Any) ToString() string { 61 | return strconv.FormatUint(any.val, 10) 62 | } 63 | 64 | func (any *uint64Any) WriteTo(stream *Stream) { 65 | stream.WriteUint64(any.val) 66 | } 67 | 68 | func (any *uint64Any) Parse() *Iterator { 69 | return nil 70 | } 71 | 72 | func (any *uint64Any) GetInterface() interface{} { 73 | return any.val 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/iter_array.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | // ReadArray read array element, tells if the array has more element to read. 4 | func (iter *Iterator) ReadArray() (ret bool) { 5 | c := iter.nextToken() 6 | switch c { 7 | case 'n': 8 | iter.skipThreeBytes('u', 'l', 'l') 9 | return false // null 10 | case '[': 11 | c = iter.nextToken() 12 | if c != ']' { 13 | iter.unreadByte() 14 | return true 15 | } 16 | return false 17 | case ']': 18 | return false 19 | case ',': 20 | return true 21 | default: 22 | iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c})) 23 | return 24 | } 25 | } 26 | 27 | // ReadArrayCB read array with callback 28 | func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) { 29 | c := iter.nextToken() 30 | if c == '[' { 31 | c = iter.nextToken() 32 | if c != ']' { 33 | iter.unreadByte() 34 | if !callback(iter) { 35 | return false 36 | } 37 | c = iter.nextToken() 38 | for c == ',' { 39 | if !callback(iter) { 40 | return false 41 | } 42 | c = iter.nextToken() 43 | } 44 | if c != ']' { 45 | iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c})) 46 | return false 47 | } 48 | return true 49 | } 50 | return true 51 | } 52 | if c == 'n' { 53 | iter.skipThreeBytes('u', 'l', 'l') 54 | return true // null 55 | } 56 | iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c})) 57 | return false 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/noxue/zero/message.go: -------------------------------------------------------------------------------- 1 | package zero 2 | 3 | import ( 4 | "bytes" 5 | "encoding/binary" 6 | "fmt" 7 | "hash/adler32" 8 | ) 9 | 10 | // Message struct 11 | type Message struct { 12 | msgSize int32 13 | msgID int32 14 | data []byte 15 | checksum uint32 16 | } 17 | 18 | // NewMessage create a new message 19 | func NewMessage(msgID int32, data []byte) *Message { 20 | msg := &Message{ 21 | msgSize: int32(len(data)) + 4 + 4, 22 | msgID: msgID, 23 | data: data, 24 | } 25 | 26 | msg.checksum = msg.calcChecksum() 27 | return msg 28 | } 29 | 30 | // GetData get message data 31 | func (msg *Message) GetData() []byte { 32 | return msg.data 33 | } 34 | 35 | // GetID get message ID 36 | func (msg *Message) GetID() int32 { 37 | return msg.msgID 38 | } 39 | 40 | // Verify verify checksum 41 | func (msg *Message) Verify() bool { 42 | return msg.checksum == msg.calcChecksum() 43 | } 44 | 45 | func (msg *Message) calcChecksum() uint32 { 46 | if msg == nil { 47 | return 0 48 | } 49 | 50 | data := new(bytes.Buffer) 51 | 52 | err := binary.Write(data, binary.LittleEndian, msg.msgID) 53 | if err != nil { 54 | return 0 55 | } 56 | err = binary.Write(data, binary.LittleEndian, msg.data) 57 | if err != nil { 58 | return 0 59 | } 60 | 61 | checksum := adler32.Checksum(data.Bytes()) 62 | return checksum 63 | } 64 | 65 | func (msg *Message) String() string { 66 | return fmt.Sprintf("Size=%d ID=%d DataLen=%d Checksum=%d", msg.msgSize, msg.GetID(), len(msg.GetData()), msg.checksum) 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_uint32.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type uint32Any struct { 8 | baseAny 9 | val uint32 10 | } 11 | 12 | func (any *uint32Any) LastError() error { 13 | return nil 14 | } 15 | 16 | func (any *uint32Any) ValueType() ValueType { 17 | return NumberValue 18 | } 19 | 20 | func (any *uint32Any) MustBeValid() Any { 21 | return any 22 | } 23 | 24 | func (any *uint32Any) ToBool() bool { 25 | return any.val != 0 26 | } 27 | 28 | func (any *uint32Any) ToInt() int { 29 | return int(any.val) 30 | } 31 | 32 | func (any *uint32Any) ToInt32() int32 { 33 | return int32(any.val) 34 | } 35 | 36 | func (any *uint32Any) ToInt64() int64 { 37 | return int64(any.val) 38 | } 39 | 40 | func (any *uint32Any) ToUint() uint { 41 | return uint(any.val) 42 | } 43 | 44 | func (any *uint32Any) ToUint32() uint32 { 45 | return any.val 46 | } 47 | 48 | func (any *uint32Any) ToUint64() uint64 { 49 | return uint64(any.val) 50 | } 51 | 52 | func (any *uint32Any) ToFloat32() float32 { 53 | return float32(any.val) 54 | } 55 | 56 | func (any *uint32Any) ToFloat64() float64 { 57 | return float64(any.val) 58 | } 59 | 60 | func (any *uint32Any) ToString() string { 61 | return strconv.FormatInt(int64(any.val), 10) 62 | } 63 | 64 | func (any *uint32Any) WriteTo(stream *Stream) { 65 | stream.WriteUint32(any.val) 66 | } 67 | 68 | func (any *uint32Any) Parse() *Iterator { 69 | return nil 70 | } 71 | 72 | func (any *uint32Any) GetInterface() interface{} { 73 | return any.val 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/form.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | const defaultMemory = 32 * 1024 * 1024 10 | 11 | type formBinding struct{} 12 | type formPostBinding struct{} 13 | type formMultipartBinding struct{} 14 | 15 | func (formBinding) Name() string { 16 | return "form" 17 | } 18 | 19 | func (formBinding) Bind(req *http.Request, obj interface{}) error { 20 | if err := req.ParseForm(); err != nil { 21 | return err 22 | } 23 | req.ParseMultipartForm(defaultMemory) 24 | if err := mapForm(obj, req.Form); err != nil { 25 | return err 26 | } 27 | return validate(obj) 28 | } 29 | 30 | func (formPostBinding) Name() string { 31 | return "form-urlencoded" 32 | } 33 | 34 | func (formPostBinding) Bind(req *http.Request, obj interface{}) error { 35 | if err := req.ParseForm(); err != nil { 36 | return err 37 | } 38 | if err := mapForm(obj, req.PostForm); err != nil { 39 | return err 40 | } 41 | return validate(obj) 42 | } 43 | 44 | func (formMultipartBinding) Name() string { 45 | return "multipart/form-data" 46 | } 47 | 48 | func (formMultipartBinding) Bind(req *http.Request, obj interface{}) error { 49 | if err := req.ParseMultipartForm(defaultMemory); err != nil { 50 | return err 51 | } 52 | if err := mapForm(obj, req.MultipartForm.Value); err != nil { 53 | return err 54 | } 55 | return validate(obj) 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/safe_field.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | type safeField struct { 9 | reflect.StructField 10 | } 11 | 12 | func (field *safeField) Offset() uintptr { 13 | return field.StructField.Offset 14 | } 15 | 16 | func (field *safeField) Name() string { 17 | return field.StructField.Name 18 | } 19 | 20 | func (field *safeField) PkgPath() string { 21 | return field.StructField.PkgPath 22 | } 23 | 24 | func (field *safeField) Type() Type { 25 | panic("not implemented") 26 | } 27 | 28 | func (field *safeField) Tag() reflect.StructTag { 29 | return field.StructField.Tag 30 | } 31 | 32 | func (field *safeField) Index() []int { 33 | return field.StructField.Index 34 | } 35 | 36 | func (field *safeField) Anonymous() bool { 37 | return field.StructField.Anonymous 38 | } 39 | 40 | func (field *safeField) Set(obj interface{}, value interface{}) { 41 | val := reflect.ValueOf(obj).Elem() 42 | val.FieldByIndex(field.Index()).Set(reflect.ValueOf(value).Elem()) 43 | } 44 | 45 | func (field *safeField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) { 46 | panic("unsafe operation is not supported") 47 | } 48 | 49 | func (field *safeField) Get(obj interface{}) interface{} { 50 | val := reflect.ValueOf(obj).Elem().FieldByIndex(field.Index()) 51 | ptr := reflect.New(val.Type()) 52 | ptr.Elem().Set(val) 53 | return ptr.Interface() 54 | } 55 | 56 | func (field *safeField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer { 57 | panic("does not support unsafe operation") 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/golang/glog/README: -------------------------------------------------------------------------------- 1 | glog 2 | ==== 3 | 4 | Leveled execution logs for Go. 5 | 6 | This is an efficient pure Go implementation of leveled logs in the 7 | manner of the open source C++ package 8 | https://github.com/google/glog 9 | 10 | By binding methods to booleans it is possible to use the log package 11 | without paying the expense of evaluating the arguments to the log. 12 | Through the -vmodule flag, the package also provides fine-grained 13 | control over logging at the file level. 14 | 15 | The comment from glog.go introduces the ideas: 16 | 17 | Package glog implements logging analogous to the Google-internal 18 | C++ INFO/ERROR/V setup. It provides functions Info, Warning, 19 | Error, Fatal, plus formatting variants such as Infof. It 20 | also provides V-style logging controlled by the -v and 21 | -vmodule=file=2 flags. 22 | 23 | Basic examples: 24 | 25 | glog.Info("Prepare to repel boarders") 26 | 27 | glog.Fatalf("Initialization failed: %s", err) 28 | 29 | See the documentation for the V function for an explanation 30 | of these examples: 31 | 32 | if glog.V(2) { 33 | glog.Info("Starting transaction...") 34 | } 35 | 36 | glog.V(2).Infoln("Processed", nItems, "elements") 37 | 38 | 39 | The repository contains an open source version of the log package 40 | used inside Google. The master copy of the source lives inside 41 | Google, not here. The code in this repo is for export only and is not itself 42 | under development. Feature requests will be ignored. 43 | 44 | Send bug reports to golang-nuts@googlegroups.com. 45 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/utils_go18.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build go1.8 10 | 11 | package mysql 12 | 13 | import ( 14 | "crypto/tls" 15 | "database/sql" 16 | "database/sql/driver" 17 | "errors" 18 | "fmt" 19 | ) 20 | 21 | func cloneTLSConfig(c *tls.Config) *tls.Config { 22 | return c.Clone() 23 | } 24 | 25 | func namedValueToValue(named []driver.NamedValue) ([]driver.Value, error) { 26 | dargs := make([]driver.Value, len(named)) 27 | for n, param := range named { 28 | if len(param.Name) > 0 { 29 | // TODO: support the use of Named Parameters #561 30 | return nil, errors.New("mysql: driver does not support the use of Named Parameters") 31 | } 32 | dargs[n] = param.Value 33 | } 34 | return dargs, nil 35 | } 36 | 37 | func mapIsolationLevel(level driver.IsolationLevel) (string, error) { 38 | switch sql.IsolationLevel(level) { 39 | case sql.LevelRepeatableRead: 40 | return "REPEATABLE READ", nil 41 | case sql.LevelReadCommitted: 42 | return "READ COMMITTED", nil 43 | case sql.LevelReadUncommitted: 44 | return "READ UNCOMMITTED", nil 45 | case sql.LevelSerializable: 46 | return "SERIALIZABLE", nil 47 | default: 48 | return "", fmt.Errorf("mysql: unsupported isolation level: %v", level) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/default_validator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "reflect" 9 | "sync" 10 | 11 | "gopkg.in/go-playground/validator.v8" 12 | ) 13 | 14 | type defaultValidator struct { 15 | once sync.Once 16 | validate *validator.Validate 17 | } 18 | 19 | var _ StructValidator = &defaultValidator{} 20 | 21 | // ValidateStruct receives any kind of type, but only performed struct or pointer to struct type. 22 | func (v *defaultValidator) ValidateStruct(obj interface{}) error { 23 | value := reflect.ValueOf(obj) 24 | valueType := value.Kind() 25 | if valueType == reflect.Ptr { 26 | valueType = value.Elem().Kind() 27 | } 28 | if valueType == reflect.Struct { 29 | v.lazyinit() 30 | if err := v.validate.Struct(obj); err != nil { 31 | return err 32 | } 33 | } 34 | return nil 35 | } 36 | 37 | // Engine returns the underlying validator engine which powers the default 38 | // Validator instance. This is useful if you want to register custom validations 39 | // or struct level validations. See validator GoDoc for more info - 40 | // https://godoc.org/gopkg.in/go-playground/validator.v8 41 | func (v *defaultValidator) Engine() interface{} { 42 | v.lazyinit() 43 | return v.validate 44 | } 45 | 46 | func (v *defaultValidator) lazyinit() { 47 | v.once.Do(func() { 48 | config := &validator.Config{TagName: "binding"} 49 | v.validate = validator.New(config) 50 | }) 51 | } 52 | -------------------------------------------------------------------------------- /enum/enum.go: -------------------------------------------------------------------------------- 1 | package enum 2 | 3 | type UserType int 4 | 5 | const ( 6 | MobilePass UserType = 1 // 手机 密码登录 7 | MobileCode UserType = 2 // 手机 验证码登录 8 | WeChat UserType = 3 // 微信登录 9 | ) 10 | 11 | // 王癞类型 12 | type KingType int 13 | 14 | const ( 15 | KingNone KingType = 0 // 无王癞 16 | KingLast KingType = 1 // 经典王癞(王牌只会出现在最后一张) 17 | KingAll KingType = 2 // 疯狂王癞(王牌会出现在任何一张) 18 | ) 19 | 20 | // 游戏开始方式 21 | type StartType int 22 | 23 | const ( 24 | StartBoss StartType = 0 // 房主开始 25 | StartFirst StartType = 1 // 首位开始 26 | ) 27 | 28 | // 付款方式 29 | type PayType int 30 | 31 | const ( 32 | PayBoss PayType = 0 33 | PayAA PayType = 1 34 | ) 35 | 36 | // 用户游戏状态 37 | type GameStatus int 38 | 39 | const ( 40 | GameReady GameStatus = 0 41 | GamePlaying GameStatus = 1 42 | GameOver GameStatus = 2 43 | ) 44 | 45 | // 俱乐部用户类型 46 | type ClubUserType int 47 | 48 | const ( 49 | ClubUserWait ClubUserType = 0 // 等待加入 50 | ClubUserVip ClubUserType = 1 // 正式用户 51 | ClubUserDisable ClubUserType = 2 // 冻结的用户 52 | ) 53 | 54 | // 翻倍规则 55 | type TimesType int 56 | 57 | const ( 58 | TimesType1 TimesType = 0 // 牛一~牛牛 分别对应 1~10倍 59 | TimesType2 TimesType = 1 // 牛牛x5 牛九x4 牛八x3 牛七x2 60 | TimesType3 TimesType = 2 // 牛牛x3 牛九x2 牛八x2 牛七x2 61 | TimesType4 TimesType = 3 // 牛牛x3 牛九x2牛八x2 牛七x1 62 | TimesType5 TimesType = 4 // 牛牛x4 牛九x3 牛八x2 牛七x2 63 | ) 64 | 65 | // 底分类型 66 | type ScoreType int 67 | 68 | const ( 69 | ScoreType1 ScoreType = 0 70 | ScoreType2 ScoreType = 1 71 | ScoreType3 ScoreType = 2 72 | ScoreType4 ScoreType = 3 73 | ScoreType5 ScoreType = 4 74 | ScoreType6 ScoreType = 5 75 | ) 76 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute 2 | # (and typically have contributed) code to the Snappy-Go repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # http://code.google.com/legal/individual-cla-v1.0.html 15 | # http://code.google.com/legal/corporate-cla-v1.0.html 16 | # 17 | # The agreement for individuals can be filled out on the web. 18 | # 19 | # When adding J Random Contributor's name to this file, 20 | # either J's name or J's organization's name should be 21 | # added to the AUTHORS file, depending on whether the 22 | # individual or corporate CLA was used. 23 | 24 | # Names should be added to this file like so: 25 | # Name 26 | 27 | # Please keep the list sorted. 28 | 29 | Damian Gryski 30 | Jan Mercl <0xjnml@gmail.com> 31 | Kai Backman 32 | Marc-Antoine Ruel 33 | Nigel Tao 34 | Rob Pike 35 | Rodolfo Carvalho 36 | Russ Cox 37 | Sebastien Binet 38 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/unsafe_eface.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | type eface struct { 9 | rtype unsafe.Pointer 10 | data unsafe.Pointer 11 | } 12 | 13 | func unpackEFace(obj interface{}) *eface { 14 | return (*eface)(unsafe.Pointer(&obj)) 15 | } 16 | 17 | func packEFace(rtype unsafe.Pointer, data unsafe.Pointer) interface{} { 18 | var i interface{} 19 | e := (*eface)(unsafe.Pointer(&i)) 20 | e.rtype = rtype 21 | e.data = data 22 | return i 23 | } 24 | 25 | type UnsafeEFaceType struct { 26 | unsafeType 27 | } 28 | 29 | func newUnsafeEFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeEFaceType { 30 | return &UnsafeEFaceType{ 31 | unsafeType: *newUnsafeType(cfg, type1), 32 | } 33 | } 34 | 35 | func (type2 *UnsafeEFaceType) IsNil(obj interface{}) bool { 36 | if obj == nil { 37 | return true 38 | } 39 | objEFace := unpackEFace(obj) 40 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype) 41 | return type2.UnsafeIsNil(objEFace.data) 42 | } 43 | 44 | func (type2 *UnsafeEFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool { 45 | if ptr == nil { 46 | return true 47 | } 48 | return unpackEFace(*(*interface{})(ptr)).data == nil 49 | } 50 | 51 | func (type2 *UnsafeEFaceType) Indirect(obj interface{}) interface{} { 52 | objEFace := unpackEFace(obj) 53 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype) 54 | return type2.UnsafeIndirect(objEFace.data) 55 | } 56 | 57 | func (type2 *UnsafeEFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} { 58 | return *(*interface{})(ptr) 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/unsafe_iface.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | type iface struct { 9 | itab *itab 10 | data unsafe.Pointer 11 | } 12 | 13 | type itab struct { 14 | ignore unsafe.Pointer 15 | rtype unsafe.Pointer 16 | } 17 | 18 | func IFaceToEFace(ptr unsafe.Pointer) interface{} { 19 | iface := (*iface)(ptr) 20 | if iface.itab == nil { 21 | return nil 22 | } 23 | return packEFace(iface.itab.rtype, iface.data) 24 | } 25 | 26 | type UnsafeIFaceType struct { 27 | unsafeType 28 | } 29 | 30 | func newUnsafeIFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeIFaceType { 31 | return &UnsafeIFaceType{ 32 | unsafeType: *newUnsafeType(cfg, type1), 33 | } 34 | } 35 | 36 | func (type2 *UnsafeIFaceType) Indirect(obj interface{}) interface{} { 37 | objEFace := unpackEFace(obj) 38 | assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype) 39 | return type2.UnsafeIndirect(objEFace.data) 40 | } 41 | 42 | func (type2 *UnsafeIFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} { 43 | return IFaceToEFace(ptr) 44 | } 45 | 46 | func (type2 *UnsafeIFaceType) IsNil(obj interface{}) bool { 47 | if obj == nil { 48 | return true 49 | } 50 | objEFace := unpackEFace(obj) 51 | assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype) 52 | return type2.UnsafeIsNil(objEFace.data) 53 | } 54 | 55 | func (type2 *UnsafeIFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool { 56 | if ptr == nil { 57 | return true 58 | } 59 | iface := (*iface)(ptr) 60 | if iface.itab == nil { 61 | return true 62 | } 63 | return false 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage.go: -------------------------------------------------------------------------------- 1 | package leveldb 2 | 3 | import ( 4 | "github.com/syndtr/goleveldb/leveldb/storage" 5 | "sync/atomic" 6 | ) 7 | 8 | type iStorage struct { 9 | storage.Storage 10 | read uint64 11 | write uint64 12 | } 13 | 14 | func (c *iStorage) Open(fd storage.FileDesc) (storage.Reader, error) { 15 | r, err := c.Storage.Open(fd) 16 | return &iStorageReader{r, c}, err 17 | } 18 | 19 | func (c *iStorage) Create(fd storage.FileDesc) (storage.Writer, error) { 20 | w, err := c.Storage.Create(fd) 21 | return &iStorageWriter{w, c}, err 22 | } 23 | 24 | func (c *iStorage) reads() uint64 { 25 | return atomic.LoadUint64(&c.read) 26 | } 27 | 28 | func (c *iStorage) writes() uint64 { 29 | return atomic.LoadUint64(&c.write) 30 | } 31 | 32 | // newIStorage returns the given storage wrapped by iStorage. 33 | func newIStorage(s storage.Storage) *iStorage { 34 | return &iStorage{s, 0, 0} 35 | } 36 | 37 | type iStorageReader struct { 38 | storage.Reader 39 | c *iStorage 40 | } 41 | 42 | func (r *iStorageReader) Read(p []byte) (n int, err error) { 43 | n, err = r.Reader.Read(p) 44 | atomic.AddUint64(&r.c.read, uint64(n)) 45 | return n, err 46 | } 47 | 48 | func (r *iStorageReader) ReadAt(p []byte, off int64) (n int, err error) { 49 | n, err = r.Reader.ReadAt(p, off) 50 | atomic.AddUint64(&r.c.read, uint64(n)) 51 | return n, err 52 | } 53 | 54 | type iStorageWriter struct { 55 | storage.Writer 56 | c *iStorage 57 | } 58 | 59 | func (w *iStorageWriter) Write(p []byte) (n int, err error) { 60 | n, err = w.Writer.Write(p) 61 | atomic.AddUint64(&w.c.write, uint64(n)) 62 | return n, err 63 | } 64 | -------------------------------------------------------------------------------- /dao/club.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "errors" 5 | "github.com/golang/glog" 6 | "qipai/model" 7 | ) 8 | 9 | var Club clubDao 10 | 11 | type clubDao struct { 12 | } 13 | 14 | func (clubDao) Get(clubId uint) (club model.Club, err error) { 15 | ret := Db().First(&club, clubId) 16 | if ret.RecordNotFound() { 17 | err = errors.New("该茶楼不存在") 18 | return 19 | } 20 | return 21 | } 22 | 23 | func (clubDao) GetClubUsers(clubId uint)(users []model.ClubUser, err error){ 24 | ret:=Db().Where(&model.ClubUser{ClubId:clubId}).Find(&users) 25 | if ret!=nil { 26 | glog.Errorln(ret.Error) 27 | } 28 | return 29 | } 30 | 31 | func (clubDao) Del(clubId uint) (err error) { 32 | ret := Db().Delete(&model.Club{}, clubId) 33 | if ret.RowsAffected == 0 { 34 | err = errors.New("删除茶楼失败") 35 | return 36 | } 37 | return 38 | } 39 | 40 | // 根据clubId删除茶楼用户 41 | func (clubDao) DelClubUserByClubId(clubId uint) (err error) { 42 | ret := Db().Unscoped().Where("club_id=?", clubId).Delete(&model.ClubUser{}) 43 | if ret.RowsAffected == 0 { 44 | err = errors.New("删除茶楼用户失败") 45 | return 46 | } 47 | return 48 | } 49 | 50 | // 删除俱乐部玩家 51 | func (clubDao)DelClubUser(clubId, uid uint)(err error) { 52 | ret := Db().Unscoped().Where("club_id=? and uid=?", clubId, uid).Delete(&model.ClubUser{}) 53 | if ret.RowsAffected == 0 { 54 | err = errors.New("删除茶楼用户失败") 55 | return 56 | } 57 | return 58 | } 59 | 60 | func (clubDao) GetUser(clubId, uid uint)(user model.ClubUser, err error){ 61 | ret:=Db().Where(&model.ClubUser{ClubId:clubId,Uid:uid}).First(&user) 62 | if ret.RecordNotFound(){ 63 | err = errors.New("您不是该茶楼的用户!") 64 | } 65 | return 66 | } -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/any_float.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type floatAny struct { 8 | baseAny 9 | val float64 10 | } 11 | 12 | func (any *floatAny) Parse() *Iterator { 13 | return nil 14 | } 15 | 16 | func (any *floatAny) ValueType() ValueType { 17 | return NumberValue 18 | } 19 | 20 | func (any *floatAny) MustBeValid() Any { 21 | return any 22 | } 23 | 24 | func (any *floatAny) LastError() error { 25 | return nil 26 | } 27 | 28 | func (any *floatAny) ToBool() bool { 29 | return any.ToFloat64() != 0 30 | } 31 | 32 | func (any *floatAny) ToInt() int { 33 | return int(any.val) 34 | } 35 | 36 | func (any *floatAny) ToInt32() int32 { 37 | return int32(any.val) 38 | } 39 | 40 | func (any *floatAny) ToInt64() int64 { 41 | return int64(any.val) 42 | } 43 | 44 | func (any *floatAny) ToUint() uint { 45 | if any.val > 0 { 46 | return uint(any.val) 47 | } 48 | return 0 49 | } 50 | 51 | func (any *floatAny) ToUint32() uint32 { 52 | if any.val > 0 { 53 | return uint32(any.val) 54 | } 55 | return 0 56 | } 57 | 58 | func (any *floatAny) ToUint64() uint64 { 59 | if any.val > 0 { 60 | return uint64(any.val) 61 | } 62 | return 0 63 | } 64 | 65 | func (any *floatAny) ToFloat32() float32 { 66 | return float32(any.val) 67 | } 68 | 69 | func (any *floatAny) ToFloat64() float64 { 70 | return any.val 71 | } 72 | 73 | func (any *floatAny) ToString() string { 74 | return strconv.FormatFloat(any.val, 'E', -1, 64) 75 | } 76 | 77 | func (any *floatAny) WriteTo(stream *Stream) { 78 | stream.WriteFloat64(any.val) 79 | } 80 | 81 | func (any *floatAny) GetInterface() interface{} { 82 | return any.val 83 | } 84 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/internal/commandinfo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Gary Burd 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package internal // import "github.com/garyburd/redigo/internal" 16 | 17 | import ( 18 | "strings" 19 | ) 20 | 21 | const ( 22 | WatchState = 1 << iota 23 | MultiState 24 | SubscribeState 25 | MonitorState 26 | ) 27 | 28 | type CommandInfo struct { 29 | Set, Clear int 30 | } 31 | 32 | var commandInfos = map[string]CommandInfo{ 33 | "WATCH": {Set: WatchState}, 34 | "UNWATCH": {Clear: WatchState}, 35 | "MULTI": {Set: MultiState}, 36 | "EXEC": {Clear: WatchState | MultiState}, 37 | "DISCARD": {Clear: WatchState | MultiState}, 38 | "PSUBSCRIBE": {Set: SubscribeState}, 39 | "SUBSCRIBE": {Set: SubscribeState}, 40 | "MONITOR": {Set: MonitorState}, 41 | } 42 | 43 | func init() { 44 | for n, ci := range commandInfos { 45 | commandInfos[strings.ToLower(n)] = ci 46 | } 47 | } 48 | 49 | func LookupCommandInfo(commandName string) CommandInfo { 50 | if ci, ok := commandInfos[commandName]; ok { 51 | return ci 52 | } 53 | return commandInfos[strings.ToUpper(commandName)] 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/utils_go17.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build go1.7 10 | // +build !go1.8 11 | 12 | package mysql 13 | 14 | import "crypto/tls" 15 | 16 | func cloneTLSConfig(c *tls.Config) *tls.Config { 17 | return &tls.Config{ 18 | Rand: c.Rand, 19 | Time: c.Time, 20 | Certificates: c.Certificates, 21 | NameToCertificate: c.NameToCertificate, 22 | GetCertificate: c.GetCertificate, 23 | RootCAs: c.RootCAs, 24 | NextProtos: c.NextProtos, 25 | ServerName: c.ServerName, 26 | ClientAuth: c.ClientAuth, 27 | ClientCAs: c.ClientCAs, 28 | InsecureSkipVerify: c.InsecureSkipVerify, 29 | CipherSuites: c.CipherSuites, 30 | PreferServerCipherSuites: c.PreferServerCipherSuites, 31 | SessionTicketsDisabled: c.SessionTicketsDisabled, 32 | SessionTicketKey: c.SessionTicketKey, 33 | ClientSessionCache: c.ClientSessionCache, 34 | MinVersion: c.MinVersion, 35 | MaxVersion: c.MaxVersion, 36 | CurvePreferences: c.CurvePreferences, 37 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 38 | Renegotiation: c.Renegotiation, 39 | } 40 | } 41 | --------------------------------------------------------------------------------