├── .idea
├── .gitignore
├── misc.xml
├── modules.xml
├── ngrinder-sampling.iml
└── vcs.xml
├── README.md
├── conf
└── app.conf
├── controllers
├── baseRest.go
├── default.go
├── dingtalkOauthRest.go
├── homeRest.go
├── samplingRest.go
├── scenesRest.go
├── scriptRest.go
└── userRest.go
├── doc
└── images
│ ├── mgrinder_report_detail.png
│ ├── ngrinder_agent_download.png
│ ├── ngrinder_announcement.png
│ ├── ngrinder_data_file.png
│ ├── ngrinder_login.png
│ ├── ngrinder_monitor.png
│ ├── ngrinder_report_list.png
│ ├── ngrinder_sampling.png
│ ├── ngrinder_sampling_detail.png
│ ├── ngrinder_sampling_list.png
│ ├── ngrinder_scenes_create.png
│ ├── ngrinder_scenes_list.png
│ ├── ngrinder_struct.png
│ ├── ngrinder_test_advanced.png
│ ├── ngrinder_test_config.png
│ ├── ngrinder_test_rst.png
│ └── ngrinder_test_schedule.png
├── lastupdate.tmp
├── main.go
├── models
├── init.go
├── requestPms.go
├── sampReqBean.go
├── sampResult.go
├── sencesRequestBean.go
├── testPms.go
└── valid_test.go
├── pack.bat
├── routers
├── commentsRouter_.go
└── router.go
├── static
├── css
│ ├── layuimini.css
│ └── public.css
├── img
│ ├── bg.jpg
│ ├── favicon.ico
│ └── logo.png
├── js
│ ├── reload.min.js
│ └── scenes_reload_data.js
└── lib
│ ├── apiTemplate
│ └── apiTemplate.js
│ ├── font-awesome
│ ├── HELP-US-OUT.txt
│ ├── css
│ │ ├── font-awesome.css
│ │ └── font-awesome.min.css
│ ├── fonts
│ │ ├── FontAwesome.otf
│ │ ├── fontawesome-webfont.eot
│ │ ├── fontawesome-webfont.svg
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ └── fontawesome-webfont.woff2
│ ├── less
│ │ ├── animated.less
│ │ ├── bordered-pulled.less
│ │ ├── core.less
│ │ ├── fixed-width.less
│ │ ├── font-awesome.less
│ │ ├── icons.less
│ │ ├── larger.less
│ │ ├── list.less
│ │ ├── mixins.less
│ │ ├── path.less
│ │ ├── rotated-flipped.less
│ │ ├── screen-reader.less
│ │ ├── stacked.less
│ │ └── variables.less
│ └── scss
│ │ ├── _animated.scss
│ │ ├── _bordered-pulled.scss
│ │ ├── _core.scss
│ │ ├── _fixed-width.scss
│ │ ├── _icons.scss
│ │ ├── _larger.scss
│ │ ├── _list.scss
│ │ ├── _mixins.scss
│ │ ├── _path.scss
│ │ ├── _rotated-flipped.scss
│ │ ├── _screen-reader.scss
│ │ ├── _stacked.scss
│ │ ├── _variables.scss
│ │ └── font-awesome.scss
│ ├── lay-config.js
│ ├── layui
│ ├── css
│ │ ├── layui.css
│ │ ├── layui.mobile.css
│ │ └── modules
│ │ │ ├── code.css
│ │ │ ├── laydate
│ │ │ └── default
│ │ │ │ └── laydate.css
│ │ │ └── layer
│ │ │ └── default
│ │ │ ├── icon-ext.png
│ │ │ ├── icon.png
│ │ │ ├── layer.css
│ │ │ ├── loading-0.gif
│ │ │ ├── loading-1.gif
│ │ │ └── loading-2.gif
│ ├── font
│ │ ├── iconfont.eot
│ │ ├── iconfont.svg
│ │ ├── iconfont.ttf
│ │ ├── iconfont.woff
│ │ └── iconfont.woff2
│ ├── images
│ │ └── face
│ │ │ ├── 0.gif
│ │ │ ├── 1.gif
│ │ │ ├── 10.gif
│ │ │ ├── 11.gif
│ │ │ ├── 12.gif
│ │ │ ├── 13.gif
│ │ │ ├── 14.gif
│ │ │ ├── 15.gif
│ │ │ ├── 16.gif
│ │ │ ├── 17.gif
│ │ │ ├── 18.gif
│ │ │ ├── 19.gif
│ │ │ ├── 2.gif
│ │ │ ├── 20.gif
│ │ │ ├── 21.gif
│ │ │ ├── 22.gif
│ │ │ ├── 23.gif
│ │ │ ├── 24.gif
│ │ │ ├── 25.gif
│ │ │ ├── 26.gif
│ │ │ ├── 27.gif
│ │ │ ├── 28.gif
│ │ │ ├── 29.gif
│ │ │ ├── 3.gif
│ │ │ ├── 30.gif
│ │ │ ├── 31.gif
│ │ │ ├── 32.gif
│ │ │ ├── 33.gif
│ │ │ ├── 34.gif
│ │ │ ├── 35.gif
│ │ │ ├── 36.gif
│ │ │ ├── 37.gif
│ │ │ ├── 38.gif
│ │ │ ├── 39.gif
│ │ │ ├── 4.gif
│ │ │ ├── 40.gif
│ │ │ ├── 41.gif
│ │ │ ├── 42.gif
│ │ │ ├── 43.gif
│ │ │ ├── 44.gif
│ │ │ ├── 45.gif
│ │ │ ├── 46.gif
│ │ │ ├── 47.gif
│ │ │ ├── 48.gif
│ │ │ ├── 49.gif
│ │ │ ├── 5.gif
│ │ │ ├── 50.gif
│ │ │ ├── 51.gif
│ │ │ ├── 52.gif
│ │ │ ├── 53.gif
│ │ │ ├── 54.gif
│ │ │ ├── 55.gif
│ │ │ ├── 56.gif
│ │ │ ├── 57.gif
│ │ │ ├── 58.gif
│ │ │ ├── 59.gif
│ │ │ ├── 6.gif
│ │ │ ├── 60.gif
│ │ │ ├── 61.gif
│ │ │ ├── 62.gif
│ │ │ ├── 63.gif
│ │ │ ├── 64.gif
│ │ │ ├── 65.gif
│ │ │ ├── 66.gif
│ │ │ ├── 67.gif
│ │ │ ├── 68.gif
│ │ │ ├── 69.gif
│ │ │ ├── 7.gif
│ │ │ ├── 70.gif
│ │ │ ├── 71.gif
│ │ │ ├── 8.gif
│ │ │ └── 9.gif
│ ├── lay
│ │ └── modules
│ │ │ ├── carousel.js
│ │ │ ├── code.js
│ │ │ ├── colorpicker.js
│ │ │ ├── element.js
│ │ │ ├── flow.js
│ │ │ ├── form.js
│ │ │ ├── jquery.js
│ │ │ ├── laydate.js
│ │ │ ├── layedit.js
│ │ │ ├── layer.js
│ │ │ ├── laypage.js
│ │ │ ├── laytpl.js
│ │ │ ├── mobile.js
│ │ │ ├── rate.js
│ │ │ ├── slider.js
│ │ │ ├── table.js
│ │ │ ├── transfer.js
│ │ │ ├── tree.js
│ │ │ ├── upload.js
│ │ │ └── util.js
│ ├── layui.all.js
│ └── layui.js
│ ├── layuimini
│ └── layuimini.js
│ └── tableSelect
│ └── tableSelect.js
├── tests
└── default_test.go
├── utils
├── dingTalkOauthUtil.go
├── jsonUtil.go
└── paginator.go
├── vendor
├── github.com
│ ├── astaxie
│ │ └── beego
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── admin.go
│ │ │ ├── adminui.go
│ │ │ ├── app.go
│ │ │ ├── beego.go
│ │ │ ├── cache
│ │ │ ├── README.md
│ │ │ ├── cache.go
│ │ │ ├── conv.go
│ │ │ ├── file.go
│ │ │ └── memory.go
│ │ │ ├── config.go
│ │ │ ├── config
│ │ │ ├── config.go
│ │ │ ├── fake.go
│ │ │ ├── ini.go
│ │ │ └── json.go
│ │ │ ├── context
│ │ │ ├── acceptencoder.go
│ │ │ ├── context.go
│ │ │ ├── input.go
│ │ │ ├── output.go
│ │ │ ├── param
│ │ │ │ ├── conv.go
│ │ │ │ ├── methodparams.go
│ │ │ │ ├── options.go
│ │ │ │ └── parsers.go
│ │ │ ├── renderer.go
│ │ │ └── response.go
│ │ │ ├── controller.go
│ │ │ ├── doc.go
│ │ │ ├── error.go
│ │ │ ├── filter.go
│ │ │ ├── flash.go
│ │ │ ├── fs.go
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── grace
│ │ │ ├── grace.go
│ │ │ └── server.go
│ │ │ ├── hooks.go
│ │ │ ├── log.go
│ │ │ ├── logs
│ │ │ ├── README.md
│ │ │ ├── accesslog.go
│ │ │ ├── conn.go
│ │ │ ├── console.go
│ │ │ ├── file.go
│ │ │ ├── jianliao.go
│ │ │ ├── log.go
│ │ │ ├── logger.go
│ │ │ ├── multifile.go
│ │ │ ├── slack.go
│ │ │ └── smtp.go
│ │ │ ├── mime.go
│ │ │ ├── namespace.go
│ │ │ ├── orm
│ │ │ ├── README.md
│ │ │ ├── cmd.go
│ │ │ ├── cmd_utils.go
│ │ │ ├── db.go
│ │ │ ├── db_alias.go
│ │ │ ├── db_mysql.go
│ │ │ ├── db_oracle.go
│ │ │ ├── db_postgres.go
│ │ │ ├── db_sqlite.go
│ │ │ ├── db_tables.go
│ │ │ ├── db_tidb.go
│ │ │ ├── db_utils.go
│ │ │ ├── models.go
│ │ │ ├── models_boot.go
│ │ │ ├── models_fields.go
│ │ │ ├── models_info_f.go
│ │ │ ├── models_info_m.go
│ │ │ ├── models_utils.go
│ │ │ ├── orm.go
│ │ │ ├── orm_conds.go
│ │ │ ├── orm_log.go
│ │ │ ├── orm_object.go
│ │ │ ├── orm_querym2m.go
│ │ │ ├── orm_queryset.go
│ │ │ ├── orm_raw.go
│ │ │ ├── qb.go
│ │ │ ├── qb_mysql.go
│ │ │ ├── qb_tidb.go
│ │ │ ├── types.go
│ │ │ └── utils.go
│ │ │ ├── parser.go
│ │ │ ├── policy.go
│ │ │ ├── router.go
│ │ │ ├── session
│ │ │ ├── README.md
│ │ │ ├── sess_cookie.go
│ │ │ ├── sess_file.go
│ │ │ ├── sess_mem.go
│ │ │ ├── sess_utils.go
│ │ │ └── session.go
│ │ │ ├── staticfile.go
│ │ │ ├── template.go
│ │ │ ├── templatefunc.go
│ │ │ ├── toolbox
│ │ │ ├── healthcheck.go
│ │ │ ├── profile.go
│ │ │ ├── statistics.go
│ │ │ └── task.go
│ │ │ ├── tree.go
│ │ │ ├── utils
│ │ │ ├── caller.go
│ │ │ ├── debug.go
│ │ │ ├── file.go
│ │ │ ├── mail.go
│ │ │ ├── rand.go
│ │ │ ├── safemap.go
│ │ │ ├── slice.go
│ │ │ └── utils.go
│ │ │ └── validation
│ │ │ ├── README.md
│ │ │ ├── util.go
│ │ │ ├── validation.go
│ │ │ └── validators.go
│ ├── fatih
│ │ └── structs
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── field.go
│ │ │ ├── structs.go
│ │ │ └── tags.go
│ ├── gf-third
│ │ └── mysql
│ │ │ ├── AUTHORS
│ │ │ ├── CHANGELOG.md
│ │ │ ├── CONTRIBUTING.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── appengine.go
│ │ │ ├── auth.go
│ │ │ ├── buffer.go
│ │ │ ├── collations.go
│ │ │ ├── conncheck.go
│ │ │ ├── conncheck_dummy.go
│ │ │ ├── connection.go
│ │ │ ├── connector.go
│ │ │ ├── const.go
│ │ │ ├── driver.go
│ │ │ ├── driver_go110.go
│ │ │ ├── dsn.go
│ │ │ ├── errors.go
│ │ │ ├── fields.go
│ │ │ ├── infile.go
│ │ │ ├── packets.go
│ │ │ ├── result.go
│ │ │ ├── rows.go
│ │ │ ├── statement.go
│ │ │ ├── transaction.go
│ │ │ └── utils.go
│ ├── go-sql-driver
│ │ └── mysql
│ │ │ ├── AUTHORS
│ │ │ ├── CHANGELOG.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── auth.go
│ │ │ ├── buffer.go
│ │ │ ├── collations.go
│ │ │ ├── conncheck.go
│ │ │ ├── conncheck_dummy.go
│ │ │ ├── connection.go
│ │ │ ├── connector.go
│ │ │ ├── const.go
│ │ │ ├── driver.go
│ │ │ ├── driver_go110.go
│ │ │ ├── dsn.go
│ │ │ ├── errors.go
│ │ │ ├── fields.go
│ │ │ ├── go.mod
│ │ │ ├── infile.go
│ │ │ ├── nulltime.go
│ │ │ ├── nulltime_go113.go
│ │ │ ├── nulltime_legacy.go
│ │ │ ├── packets.go
│ │ │ ├── result.go
│ │ │ ├── rows.go
│ │ │ ├── statement.go
│ │ │ ├── transaction.go
│ │ │ └── utils.go
│ ├── gogf
│ │ └── gf
│ │ │ ├── DONATOR.MD
│ │ │ ├── LICENSE
│ │ │ ├── README.MD
│ │ │ ├── README_ZH.MD
│ │ │ ├── RELEASE.1.MD
│ │ │ ├── RELEASE.2.MD
│ │ │ ├── TODO.MD
│ │ │ ├── container
│ │ │ ├── garray
│ │ │ │ ├── garray.go
│ │ │ │ ├── garray_func.go
│ │ │ │ ├── garray_normal_any.go
│ │ │ │ ├── garray_normal_int.go
│ │ │ │ ├── garray_normal_str.go
│ │ │ │ ├── garray_sorted_any.go
│ │ │ │ ├── garray_sorted_int.go
│ │ │ │ └── garray_sorted_str.go
│ │ │ ├── glist
│ │ │ │ └── glist.go
│ │ │ ├── gmap
│ │ │ │ ├── gmap.go
│ │ │ │ ├── gmap_hash_any_any_map.go
│ │ │ │ ├── gmap_hash_int_any_map.go
│ │ │ │ ├── gmap_hash_int_int_map.go
│ │ │ │ ├── gmap_hash_int_str_map.go
│ │ │ │ ├── gmap_hash_str_any_map.go
│ │ │ │ ├── gmap_hash_str_int_map.go
│ │ │ │ ├── gmap_hash_str_str_map.go
│ │ │ │ ├── gmap_list_map.go
│ │ │ │ └── gmap_tree_map.go
│ │ │ ├── gpool
│ │ │ │ └── gpool.go
│ │ │ ├── gring
│ │ │ │ └── gring.go
│ │ │ ├── gset
│ │ │ │ ├── gset_any_set.go
│ │ │ │ ├── gset_int_set.go
│ │ │ │ └── gset_str_set.go
│ │ │ ├── gtree
│ │ │ │ ├── gtree.go
│ │ │ │ ├── gtree_avltree.go
│ │ │ │ ├── gtree_btree.go
│ │ │ │ └── gtree_redblacktree.go
│ │ │ ├── gtype
│ │ │ │ ├── bool.go
│ │ │ │ ├── byte.go
│ │ │ │ ├── bytes.go
│ │ │ │ ├── float32.go
│ │ │ │ ├── float64.go
│ │ │ │ ├── gtype.go
│ │ │ │ ├── int.go
│ │ │ │ ├── int32.go
│ │ │ │ ├── int64.go
│ │ │ │ ├── interface.go
│ │ │ │ ├── string.go
│ │ │ │ ├── uint.go
│ │ │ │ ├── uint32.go
│ │ │ │ └── uint64.go
│ │ │ └── gvar
│ │ │ │ └── gvar.go
│ │ │ ├── database
│ │ │ ├── gdb
│ │ │ │ ├── gdb.go
│ │ │ │ ├── gdb_base.go
│ │ │ │ ├── gdb_batch_result.go
│ │ │ │ ├── gdb_config.go
│ │ │ │ ├── gdb_func.go
│ │ │ │ ├── gdb_model.go
│ │ │ │ ├── gdb_mssql.go
│ │ │ │ ├── gdb_mysql.go
│ │ │ │ ├── gdb_oracle.go
│ │ │ │ ├── gdb_pgsql.go
│ │ │ │ ├── gdb_sqlite.go
│ │ │ │ ├── gdb_structure.go
│ │ │ │ ├── gdb_transaction.go
│ │ │ │ ├── gdb_type_record.go
│ │ │ │ ├── gdb_type_record_deprecated.go
│ │ │ │ ├── gdb_type_result.go
│ │ │ │ └── gdb_type_result_deprecated.go
│ │ │ └── gredis
│ │ │ │ ├── gredis.go
│ │ │ │ ├── gredis_config.go
│ │ │ │ ├── gredis_conn.go
│ │ │ │ └── gredis_instance.go
│ │ │ ├── debug
│ │ │ └── gdebug
│ │ │ │ └── gdebug.go
│ │ │ ├── encoding
│ │ │ ├── gbase64
│ │ │ │ └── gbase64.go
│ │ │ ├── gbinary
│ │ │ │ ├── gbinary.go
│ │ │ │ ├── gbinary_be.go
│ │ │ │ ├── gbinary_bits.go
│ │ │ │ ├── gbinary_func.go
│ │ │ │ └── gbinary_le.go
│ │ │ ├── gcompress
│ │ │ │ ├── gcompress.go
│ │ │ │ └── gcompress_file.go
│ │ │ ├── ghash
│ │ │ │ └── ghash.go
│ │ │ ├── ghtml
│ │ │ │ └── ghtml.go
│ │ │ ├── gjson
│ │ │ │ ├── gjson.go
│ │ │ │ ├── gjson_api.go
│ │ │ │ ├── gjson_api_config.go
│ │ │ │ ├── gjson_api_encoding.go
│ │ │ │ └── gjson_api_new_load.go
│ │ │ ├── gparser
│ │ │ │ ├── gparser.go
│ │ │ │ ├── gparser_api_encoding.go
│ │ │ │ └── gparser_api_new_load.go
│ │ │ └── gurl
│ │ │ │ └── url.go
│ │ │ ├── errors
│ │ │ └── gerror
│ │ │ │ ├── gerror.go
│ │ │ │ ├── gerror_error.go
│ │ │ │ └── gerror_stack.go
│ │ │ ├── frame
│ │ │ ├── g
│ │ │ │ ├── g.go
│ │ │ │ ├── g_func.go
│ │ │ │ ├── g_logger.go
│ │ │ │ ├── g_object.go
│ │ │ │ └── g_setting.go
│ │ │ └── gins
│ │ │ │ └── gins.go
│ │ │ ├── go.mod
│ │ │ ├── i18n
│ │ │ └── gi18n
│ │ │ │ ├── gi18n.go
│ │ │ │ ├── gi18n_instance.go
│ │ │ │ └── gi18n_manager.go
│ │ │ ├── internal
│ │ │ ├── cmdenv
│ │ │ │ └── cmdenv.go
│ │ │ ├── empty
│ │ │ │ └── empty.go
│ │ │ ├── intlog
│ │ │ │ └── intlog.go
│ │ │ ├── structs
│ │ │ │ ├── structs.go
│ │ │ │ ├── structs_map.go
│ │ │ │ └── structs_tag.go
│ │ │ ├── utilbytes
│ │ │ │ └── utilbytes.go
│ │ │ └── utilstr
│ │ │ │ └── utilstr.go
│ │ │ ├── net
│ │ │ ├── ghttp
│ │ │ │ ├── ghttp.go
│ │ │ │ ├── ghttp_client_api.go
│ │ │ │ ├── ghttp_client_bytes.go
│ │ │ │ ├── ghttp_client_config.go
│ │ │ │ ├── ghttp_client_content.go
│ │ │ │ ├── ghttp_client_request.go
│ │ │ │ ├── ghttp_client_response.go
│ │ │ │ ├── ghttp_controller.go
│ │ │ │ ├── ghttp_func.go
│ │ │ │ ├── ghttp_request.go
│ │ │ │ ├── ghttp_request_auth.go
│ │ │ │ ├── ghttp_request_hook.go
│ │ │ │ ├── ghttp_request_method_delete.go
│ │ │ │ ├── ghttp_request_method_post.go
│ │ │ │ ├── ghttp_request_method_put.go
│ │ │ │ ├── ghttp_request_method_query.go
│ │ │ │ ├── ghttp_request_middleware.go
│ │ │ │ ├── ghttp_request_params.go
│ │ │ │ ├── ghttp_request_request.go
│ │ │ │ ├── ghttp_request_router.go
│ │ │ │ ├── ghttp_request_view.go
│ │ │ │ ├── ghttp_response.go
│ │ │ │ ├── ghttp_response_cors.go
│ │ │ │ ├── ghttp_response_view.go
│ │ │ │ ├── ghttp_response_writer.go
│ │ │ │ ├── ghttp_server.go
│ │ │ │ ├── ghttp_server_admin.go
│ │ │ │ ├── ghttp_server_admin_process.go
│ │ │ │ ├── ghttp_server_admin_unix.go
│ │ │ │ ├── ghttp_server_admin_windows.go
│ │ │ │ ├── ghttp_server_config.go
│ │ │ │ ├── ghttp_server_config_cookie.go
│ │ │ │ ├── ghttp_server_config_logging.go
│ │ │ │ ├── ghttp_server_config_mess.go
│ │ │ │ ├── ghttp_server_config_route.go
│ │ │ │ ├── ghttp_server_config_session.go
│ │ │ │ ├── ghttp_server_config_static.go
│ │ │ │ ├── ghttp_server_cookie.go
│ │ │ │ ├── ghttp_server_domain.go
│ │ │ │ ├── ghttp_server_error_logger.go
│ │ │ │ ├── ghttp_server_graceful.go
│ │ │ │ ├── ghttp_server_handler.go
│ │ │ │ ├── ghttp_server_log.go
│ │ │ │ ├── ghttp_server_pprof.go
│ │ │ │ ├── ghttp_server_router.go
│ │ │ │ ├── ghttp_server_router_group.go
│ │ │ │ ├── ghttp_server_router_hook.go
│ │ │ │ ├── ghttp_server_router_middleware.go
│ │ │ │ ├── ghttp_server_router_serve.go
│ │ │ │ ├── ghttp_server_service_controller.go
│ │ │ │ ├── ghttp_server_service_handler.go
│ │ │ │ ├── ghttp_server_service_object.go
│ │ │ │ ├── ghttp_server_session.go
│ │ │ │ ├── ghttp_server_status.go
│ │ │ │ └── ghttp_server_websocket.go
│ │ │ ├── gtcp
│ │ │ │ ├── gtcp.go
│ │ │ │ ├── gtcp_conn.go
│ │ │ │ ├── gtcp_conn_pkg.go
│ │ │ │ ├── gtcp_func.go
│ │ │ │ ├── gtcp_func_pkg.go
│ │ │ │ ├── gtcp_pool.go
│ │ │ │ ├── gtcp_pool_pkg.go
│ │ │ │ └── gtcp_server.go
│ │ │ └── gudp
│ │ │ │ ├── gudp.go
│ │ │ │ ├── gudp_conn.go
│ │ │ │ ├── gudp_func.go
│ │ │ │ └── gudp_server.go
│ │ │ ├── os
│ │ │ ├── gcache
│ │ │ │ ├── gcache.go
│ │ │ │ ├── gcache_cache.go
│ │ │ │ ├── gcache_mem_cache.go
│ │ │ │ ├── gcache_mem_cache_item.go
│ │ │ │ └── gcache_mem_cache_lru.go
│ │ │ ├── gcfg
│ │ │ │ ├── gcfg.go
│ │ │ │ ├── gcfg_api.go
│ │ │ │ ├── gcfg_config.go
│ │ │ │ ├── gcfg_error.go
│ │ │ │ └── gcfg_instance.go
│ │ │ ├── genv
│ │ │ │ └── genv.go
│ │ │ ├── gfcache
│ │ │ │ └── gfcache.go
│ │ │ ├── gfile
│ │ │ │ ├── gfile.go
│ │ │ │ ├── gfile_contents.go
│ │ │ │ ├── gfile_replace.go
│ │ │ │ ├── gfile_scan.go
│ │ │ │ ├── gfile_search.go
│ │ │ │ ├── gfile_size.go
│ │ │ │ ├── gfile_sort.go
│ │ │ │ ├── gfile_source.go
│ │ │ │ └── gfile_time.go
│ │ │ ├── gfsnotify
│ │ │ │ ├── gfsnotify.go
│ │ │ │ ├── gfsnotify_event.go
│ │ │ │ ├── gfsnotify_filefunc.go
│ │ │ │ ├── gfsnotify_watcher.go
│ │ │ │ └── gfsnotify_watcher_loop.go
│ │ │ ├── glog
│ │ │ │ ├── glog.go
│ │ │ │ ├── glog_api.go
│ │ │ │ ├── glog_chaining.go
│ │ │ │ ├── glog_config.go
│ │ │ │ ├── glog_instance.go
│ │ │ │ ├── glog_logger.go
│ │ │ │ ├── glog_logger_api.go
│ │ │ │ ├── glog_logger_chaining.go
│ │ │ │ ├── glog_logger_config.go
│ │ │ │ └── glog_logger_writer.go
│ │ │ ├── gmlock
│ │ │ │ ├── gmlock.go
│ │ │ │ └── gmlock_locker.go
│ │ │ ├── gproc
│ │ │ │ ├── gproc.go
│ │ │ │ ├── gproc_comm.go
│ │ │ │ ├── gproc_comm_receive.go
│ │ │ │ ├── gproc_comm_send.go
│ │ │ │ ├── gproc_manager.go
│ │ │ │ └── gproc_proccess.go
│ │ │ ├── gres
│ │ │ │ ├── gres.go
│ │ │ │ ├── gres_file.go
│ │ │ │ ├── gres_func.go
│ │ │ │ ├── gres_http_file.go
│ │ │ │ ├── gres_instance.go
│ │ │ │ └── gres_resource.go
│ │ │ ├── gsession
│ │ │ │ ├── gsession.go
│ │ │ │ ├── gsession_manager.go
│ │ │ │ ├── gsession_session.go
│ │ │ │ ├── gsession_storage.go
│ │ │ │ ├── gsession_storage_file.go
│ │ │ │ ├── gsession_storage_memory.go
│ │ │ │ ├── gsession_storage_redis.go
│ │ │ │ └── gsession_storage_redis_hashtable.go
│ │ │ ├── gspath
│ │ │ │ ├── gspath.go
│ │ │ │ └── gspath_cache.go
│ │ │ ├── gtime
│ │ │ │ ├── gtime.go
│ │ │ │ ├── gtime_format.go
│ │ │ │ └── gtime_time.go
│ │ │ ├── gtimer
│ │ │ │ ├── gtimer.go
│ │ │ │ ├── gtimer_entry.go
│ │ │ │ ├── gtimer_loop.go
│ │ │ │ └── gtimer_timer.go
│ │ │ └── gview
│ │ │ │ ├── gview.go
│ │ │ │ ├── gview_buildin.go
│ │ │ │ ├── gview_config.go
│ │ │ │ ├── gview_doparse.go
│ │ │ │ ├── gview_error.go
│ │ │ │ ├── gview_i18n.go
│ │ │ │ └── gview_instance.go
│ │ │ ├── text
│ │ │ ├── gregex
│ │ │ │ ├── gregex.go
│ │ │ │ └── gregex_cache.go
│ │ │ └── gstr
│ │ │ │ ├── gstr.go
│ │ │ │ ├── gstr_case.go
│ │ │ │ ├── gstr_domain.go
│ │ │ │ ├── gstr_levenshtein.go
│ │ │ │ ├── gstr_parse.go
│ │ │ │ ├── gstr_pos.go
│ │ │ │ ├── gstr_similartext.go
│ │ │ │ ├── gstr_soundex.go
│ │ │ │ └── gstr_trim.go
│ │ │ ├── util
│ │ │ ├── gconv
│ │ │ │ ├── gconv.go
│ │ │ │ ├── gconv_map.go
│ │ │ │ ├── gconv_slice.go
│ │ │ │ ├── gconv_struct.go
│ │ │ │ ├── gconv_time.go
│ │ │ │ └── gconv_unsafe.go
│ │ │ ├── gmode
│ │ │ │ └── gmode.go
│ │ │ ├── grand
│ │ │ │ ├── grand.go
│ │ │ │ └── grand_intn.go
│ │ │ └── gutil
│ │ │ │ ├── gutil.go
│ │ │ │ ├── gutil_comparator.go
│ │ │ │ └── gutil_map.go
│ │ │ └── version.go
│ ├── gomodule
│ │ └── redigo
│ │ │ ├── LICENSE
│ │ │ └── redis
│ │ │ ├── commandinfo.go
│ │ │ ├── conn.go
│ │ │ ├── doc.go
│ │ │ ├── go17.go
│ │ │ ├── go18.go
│ │ │ ├── log.go
│ │ │ ├── pool.go
│ │ │ ├── pubsub.go
│ │ │ ├── redis.go
│ │ │ ├── reply.go
│ │ │ ├── scan.go
│ │ │ └── script.go
│ ├── gorilla
│ │ └── websocket
│ │ │ ├── AUTHORS
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── client.go
│ │ │ ├── client_clone.go
│ │ │ ├── client_clone_legacy.go
│ │ │ ├── compression.go
│ │ │ ├── conn.go
│ │ │ ├── conn_write.go
│ │ │ ├── conn_write_legacy.go
│ │ │ ├── doc.go
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── join.go
│ │ │ ├── json.go
│ │ │ ├── mask.go
│ │ │ ├── mask_safe.go
│ │ │ ├── prepared.go
│ │ │ ├── proxy.go
│ │ │ ├── server.go
│ │ │ ├── trace.go
│ │ │ ├── trace_17.go
│ │ │ ├── util.go
│ │ │ └── x_net_proxy.go
│ ├── json-iterator
│ │ └── go
│ │ │ ├── Gopkg.lock
│ │ │ ├── Gopkg.toml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── adapter.go
│ │ │ ├── any.go
│ │ │ ├── any_array.go
│ │ │ ├── any_bool.go
│ │ │ ├── any_float.go
│ │ │ ├── any_int32.go
│ │ │ ├── any_int64.go
│ │ │ ├── any_invalid.go
│ │ │ ├── any_nil.go
│ │ │ ├── any_number.go
│ │ │ ├── any_object.go
│ │ │ ├── any_str.go
│ │ │ ├── any_uint32.go
│ │ │ ├── any_uint64.go
│ │ │ ├── build.sh
│ │ │ ├── config.go
│ │ │ ├── fuzzy_mode_convert_table.md
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── iter.go
│ │ │ ├── iter_array.go
│ │ │ ├── iter_float.go
│ │ │ ├── iter_int.go
│ │ │ ├── iter_object.go
│ │ │ ├── iter_skip.go
│ │ │ ├── iter_skip_sloppy.go
│ │ │ ├── iter_skip_strict.go
│ │ │ ├── iter_str.go
│ │ │ ├── jsoniter.go
│ │ │ ├── pool.go
│ │ │ ├── reflect.go
│ │ │ ├── reflect_array.go
│ │ │ ├── reflect_dynamic.go
│ │ │ ├── reflect_extension.go
│ │ │ ├── reflect_json_number.go
│ │ │ ├── reflect_json_raw_message.go
│ │ │ ├── reflect_map.go
│ │ │ ├── reflect_marshaler.go
│ │ │ ├── reflect_native.go
│ │ │ ├── reflect_optional.go
│ │ │ ├── reflect_slice.go
│ │ │ ├── reflect_struct_decoder.go
│ │ │ ├── reflect_struct_encoder.go
│ │ │ ├── stream.go
│ │ │ ├── stream_float.go
│ │ │ ├── stream_int.go
│ │ │ ├── stream_str.go
│ │ │ └── test.sh
│ ├── modern-go
│ │ ├── concurrent
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── executor.go
│ │ │ ├── go_above_19.go
│ │ │ ├── go_below_19.go
│ │ │ ├── log.go
│ │ │ ├── test.sh
│ │ │ └── unbounded_executor.go
│ │ └── reflect2
│ │ │ ├── Gopkg.lock
│ │ │ ├── Gopkg.toml
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── go_above_17.go
│ │ │ ├── go_above_19.go
│ │ │ ├── go_below_17.go
│ │ │ ├── go_below_19.go
│ │ │ ├── reflect2.go
│ │ │ ├── reflect2_amd64.s
│ │ │ ├── reflect2_kind.go
│ │ │ ├── relfect2_386.s
│ │ │ ├── relfect2_amd64p32.s
│ │ │ ├── relfect2_arm.s
│ │ │ ├── relfect2_arm64.s
│ │ │ ├── relfect2_mips64x.s
│ │ │ ├── relfect2_mipsx.s
│ │ │ ├── relfect2_ppc64x.s
│ │ │ ├── relfect2_s390x.s
│ │ │ ├── safe_field.go
│ │ │ ├── safe_map.go
│ │ │ ├── safe_slice.go
│ │ │ ├── safe_struct.go
│ │ │ ├── safe_type.go
│ │ │ ├── test.sh
│ │ │ ├── type_map.go
│ │ │ ├── unsafe_array.go
│ │ │ ├── unsafe_eface.go
│ │ │ ├── unsafe_field.go
│ │ │ ├── unsafe_iface.go
│ │ │ ├── unsafe_link.go
│ │ │ ├── unsafe_map.go
│ │ │ ├── unsafe_ptr.go
│ │ │ ├── unsafe_slice.go
│ │ │ ├── unsafe_struct.go
│ │ │ └── unsafe_type.go
│ ├── olekukonko
│ │ └── tablewriter
│ │ │ ├── LICENSE.md
│ │ │ ├── README.md
│ │ │ ├── csv.go
│ │ │ ├── go.mod
│ │ │ ├── go.sum
│ │ │ ├── table.go
│ │ │ ├── table_with_color.go
│ │ │ ├── util.go
│ │ │ └── wrap.go
│ └── shiena
│ │ └── ansicolor
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── ansicolor.go
│ │ ├── ansicolor_ansi.go
│ │ └── ansicolor_windows.go
├── golang.org
│ └── x
│ │ └── crypto
│ │ ├── LICENSE
│ │ ├── PATENTS
│ │ └── acme
│ │ ├── acme.go
│ │ ├── autocert
│ │ ├── autocert.go
│ │ ├── cache.go
│ │ ├── listener.go
│ │ └── renewal.go
│ │ ├── http.go
│ │ ├── jws.go
│ │ └── types.go
├── gopkg.in
│ └── yaml.v2
│ │ ├── LICENSE
│ │ ├── LICENSE.libyaml
│ │ ├── NOTICE
│ │ ├── README.md
│ │ ├── apic.go
│ │ ├── decode.go
│ │ ├── emitterc.go
│ │ ├── encode.go
│ │ ├── go.mod
│ │ ├── parserc.go
│ │ ├── readerc.go
│ │ ├── resolve.go
│ │ ├── scannerc.go
│ │ ├── sorter.go
│ │ ├── writerc.go
│ │ ├── yaml.go
│ │ ├── yamlh.go
│ │ └── yamlprivateh.go
└── vendor.json
└── views
├── 404.html
├── index.html
├── login.html
├── preview.html
├── report_list.html
├── sampling_log.html
├── scenes_create.html
└── scenes_list.html
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /workspace.xml
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/ngrinder-sampling.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/conf/app.conf:
--------------------------------------------------------------------------------
1 | appname = ngrinder_sampling
2 | httpport = 8090
3 | runmode = dev
4 | copyrequestbody = true
5 | sessionon = true
6 |
7 | # 数据库配置
8 | db.host = 127.0.0.1
9 | db.port = 3306
10 | db.user = root
11 | db.password = 123456
12 | db.name = ngrinder
13 | db.timezone = Asia/Shanghai
14 |
15 | #ngrinder 服务配置
16 | ngrinder.serverurl = http://127.0.0.1:8080
17 | ngrinder.api.create = /feature/createTest
18 | ngrinder.api.delete = /feature/deleteScript
19 | ngrinder.api.login = /feature/user/login
20 | ngrinder.api.perflist = /feature/user/perfList
21 | ngrinder.api.perfDelete = /feature/user/perfDelete
22 | ngrinder.api.agentList = /feature/user/agentList
23 | ngrinder.api.agentConfig = /feature/user/agentConfig
24 | ngrinder.api.announcement = /feature/user/announcement
25 | ngrinder.api.uploadData = /feature/uploadData
26 | ngrinder.api.validScript = /feature/validScript
27 | ngrinder.api.getUserByUserId = /feature/user/getUserByUserId
28 | ngrinder.api.dingTalkSave = /feature/user/dingTalkSave
29 | #dingtalk
30 | dingtalk.appid = dingoabmkhogfi9ort7mxe
31 | dingtalk.appsecret = 2u1dZn_O2YGukMOf9kg626bxxVpygJsl86DpHaa7pBUJWtuRdCQ0tkXwmKYVf_n3
--------------------------------------------------------------------------------
/controllers/baseRest.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import (
4 | "encoding/json"
5 | "github.com/astaxie/beego"
6 | "ngrinder-sampling/utils"
7 | )
8 |
9 | const (
10 | SESSION_USER_ID = "user_login_id"
11 | SESSION_USER_NICK = "user_login_nick"
12 | PAGESIZE = 10
13 | )
14 |
15 | type BaseController struct {
16 | beego.Controller
17 | userId string
18 | result *NsResponseBean
19 | }
20 |
21 | func (b *BaseController) Prepare() {
22 | b.result = new(NsResponseBean)
23 | controller, action := b.GetControllerAndAction()
24 |
25 | if (controller != "UserController" || action != "Login") && action != "Gather" && controller != "DingTalkOauthRest" {
26 | //校验是否登录
27 | userId := b.GetSession(SESSION_USER_ID)
28 | if userId != nil {
29 | b.userId = userId.(string)
30 | } else {
31 | b.Redirect("/", 302)
32 | }
33 | }
34 | }
35 |
36 | //handle the result
37 | func (b *BaseController) responseAjax() {
38 | b.Data["json"] = b.result
39 | b.ServeJSON()
40 | b.StopRun()
41 | }
42 |
43 | func (b *BaseController) responseAjaxMore(more map[string]interface{}) {
44 | dst, _ := json.Marshal(b.result)
45 | src, _ := json.Marshal(more)
46 | result := utils.JSONMerger(dst, src)
47 | b.Data["json"] = result
48 | b.ServeJSON()
49 | b.StopRun()
50 | }
51 |
52 | type NsResponseBean struct {
53 | Code int `json:"code"`
54 | ErrMsg string `json:"errMsg"`
55 | Data interface{} `json:"data"`
56 | Count int `json:"count"`
57 | Msg string `json:"msg,omitempty"`
58 | }
59 |
--------------------------------------------------------------------------------
/controllers/default.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import (
4 | "github.com/astaxie/beego"
5 | "net/url"
6 | "strconv"
7 | )
8 |
9 | type MainController struct {
10 | beego.Controller
11 | }
12 |
13 | func (c *MainController) Get() {
14 | appId := beego.AppConfig.String("dingtalk.appid")
15 | //如果不配置dingtalk,则隐藏页面相关信息
16 | if len(appId) > 0 {
17 | redirectUrl := c.Ctx.Input.Site() + "/dingTalk"
18 | port := c.Ctx.Input.Port()
19 | if port != 80 && port != 443 {
20 | redirectUrl = c.Ctx.Input.Site() + ":" + strconv.Itoa(port) + "/dingTalk"
21 | }
22 | gotoUrl := "https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=" + appId + "&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=" + redirectUrl
23 | c.Data["goto"] = url.QueryEscape(gotoUrl)
24 | c.Data["goto_original"] = gotoUrl
25 | }
26 |
27 | c.TplName = "login.html"
28 | }
29 |
--------------------------------------------------------------------------------
/controllers/userRest.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import (
4 | "github.com/astaxie/beego"
5 | "github.com/astaxie/beego/httplib"
6 | )
7 |
8 | type UserController struct {
9 | BaseController
10 | }
11 |
12 | // @router /login [post]
13 | func (u *UserController) Login() {
14 | userId := u.GetString("userId")
15 | password := u.GetString("password")
16 | if len(userId) <= 0 || len(password) <= 0 {
17 | u.result.Code = 1
18 | u.result.ErrMsg = "userId or password is not empty"
19 | u.responseAjax()
20 | }
21 | ngrinderUrl := beego.AppConfig.String("ngrinder.serverurl")
22 | apiUrl := beego.AppConfig.String("ngrinder.api.login")
23 | req := httplib.Post(ngrinderUrl + apiUrl)
24 | req.Param("userId", userId)
25 | req.Param("password", password)
26 | js := new(NsResponseBean)
27 | err := req.ToJSON(js)
28 | if err != nil {
29 | u.result.Code = 1
30 | u.result.ErrMsg = err.Error()
31 | } else {
32 | u.result.Code = js.Code
33 | if js.Code == 0 {
34 | u.SetSession(SESSION_USER_ID, userId)
35 | nuser, ok := js.Data.(NUser)
36 | if ok {
37 | u.SetSession(SESSION_USER_NICK, nuser.UserName)
38 | } else {
39 | u.SetSession(SESSION_USER_NICK, userId)
40 | }
41 | } else {
42 | u.result.ErrMsg = js.ErrMsg
43 | }
44 | }
45 | u.responseAjax()
46 | }
47 |
48 | // @router /logout [get]
49 | func (u *UserController) Logout() {
50 | u.DestroySession()
51 | u.Redirect("/", 302)
52 | }
53 |
--------------------------------------------------------------------------------
/doc/images/mgrinder_report_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/mgrinder_report_detail.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_agent_download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_agent_download.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_announcement.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_announcement.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_data_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_data_file.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_login.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_monitor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_monitor.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_report_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_report_list.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_sampling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_sampling.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_sampling_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_sampling_detail.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_sampling_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_sampling_list.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_scenes_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_scenes_create.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_scenes_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_scenes_list.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_struct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_struct.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_test_advanced.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_test_advanced.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_test_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_test_config.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_test_rst.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_test_rst.png
--------------------------------------------------------------------------------
/doc/images/ngrinder_test_schedule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/doc/images/ngrinder_test_schedule.png
--------------------------------------------------------------------------------
/lastupdate.tmp:
--------------------------------------------------------------------------------
1 | {"D:\\works\\gopath\\src\\ngrinder-sampling\\controllers":1578713282614652500}
--------------------------------------------------------------------------------
/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/astaxie/beego"
5 | "ngrinder-sampling/models"
6 | _ "ngrinder-sampling/routers"
7 | )
8 |
9 | func main() {
10 | models.Init()
11 |
12 | beego.Run()
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/models/init.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import (
4 | "github.com/astaxie/beego"
5 | "github.com/astaxie/beego/orm"
6 | _ "github.com/go-sql-driver/mysql"
7 | "net/url"
8 | )
9 |
10 | func Init() {
11 | //数据库配置
12 | dbhost := beego.AppConfig.String("db.host")
13 | dbport := beego.AppConfig.String("db.port")
14 | dbuser := beego.AppConfig.String("db.user")
15 | dbpassword := beego.AppConfig.String("db.password")
16 | dbname := beego.AppConfig.String("db.name")
17 | timezone := beego.AppConfig.String("db.timezone")
18 |
19 | if dbport == "" {
20 | dbport = "3306"
21 | }
22 | dsn := dbuser + ":" + dbpassword + "@tcp(" + dbhost + ":" + dbport + ")/" + dbname + "?charset=utf8mb4"
23 | if timezone != "" {
24 | dsn = dsn + "&loc=" + url.QueryEscape(timezone)
25 | }
26 | //注册数据库
27 | orm.RegisterDataBase("default", "mysql", dsn, 10, 600)
28 | // 自动建表
29 | orm.RunSyncdb("default", false, true)
30 | //sql命令
31 | if beego.AppConfig.String("runmode") == "dev" {
32 | orm.Debug = true
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/models/requestPms.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import "github.com/astaxie/beego/orm"
4 |
5 | //请求api
6 | type RequestPms struct {
7 | Id int64
8 | TestPmsId int64
9 | ApiName string
10 | Sort int
11 | FunName string
12 | Type int
13 | Method string
14 | Timeout int64
15 | Url string
16 | Headers string
17 | ContentType string
18 | Body string
19 | Params string
20 | OutParams string
21 | Assertion string
22 | WaitTime int
23 | WaitVuserNum int
24 | }
25 |
26 | func init() {
27 | orm.RegisterModel(new(RequestPms))
28 | }
29 |
30 | func tableName() string {
31 | return "request_pms"
32 | }
33 |
34 | func RequestPmsSave(t *RequestPms, o orm.Ormer) (int64, error) {
35 | return o.Insert(t)
36 | }
37 |
38 | func RequestPmsUpdate(t *RequestPms, o orm.Ormer) error {
39 | if _, err := o.Update(t); err != nil {
40 | return err
41 | }
42 | return nil
43 | }
44 |
45 | func RequestPmsDelete(t *RequestPms, o orm.Ormer) (int64, error) {
46 | return o.Delete(t)
47 | }
48 |
49 | func RequestPmsDeleteByTestPmsId(testPmsId int64, o orm.Ormer) (int64, error) {
50 | return o.QueryTable(tableName()).Filter("test_pms_id", testPmsId).Delete()
51 | }
52 |
53 | func RequestPmsGetByTestPmsId(testPmsId int64) ([]RequestPms, error) {
54 | o := orm.NewOrm()
55 | var requestPmsList []RequestPms
56 | _, err := o.QueryTable(tableName()).Filter("test_pms_id", testPmsId).OrderBy("sort").All(&requestPmsList)
57 | if err != nil {
58 | return nil, err
59 | }
60 | return requestPmsList, nil
61 | }
62 |
--------------------------------------------------------------------------------
/models/valid_test.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import (
4 | "github.com/astaxie/beego/validation"
5 | "testing"
6 | "time"
7 | )
8 |
9 | func TestValid(t *testing.T) {
10 | var sences SencesRequestBean
11 | valid := validation.Validation{}
12 | b, err := valid.Valid(sences)
13 | if err != nil {
14 | print(err.Error())
15 | }
16 | if !b {
17 | // validation does not pass
18 | print(valid.Errors[0].Field + ":" + valid.Errors[0].Error())
19 | }
20 | }
21 |
22 | func TestTimes(t *testing.T) {
23 | times := 1574753897
24 | println(time.Unix(int64(times), 849e9).String())
25 | println(time.Now().String())
26 | }
27 |
--------------------------------------------------------------------------------
/pack.bat:
--------------------------------------------------------------------------------
1 | bee pack -be GOOS=linux
--------------------------------------------------------------------------------
/routers/router.go:
--------------------------------------------------------------------------------
1 | package routers
2 |
3 | import (
4 | "github.com/astaxie/beego"
5 | "ngrinder-sampling/controllers"
6 | )
7 |
8 | func init() {
9 | beego.Router("/", &controllers.MainController{})
10 | beego.Router("/dingTalk", &controllers.DingTalkOauthRest{})
11 |
12 | ns := beego.NewNamespace("/v1",
13 | beego.NSNamespace("/samp",
14 | beego.NSInclude(&controllers.SamplingController{})),
15 | beego.NSNamespace("/scenes",
16 | beego.NSInclude(&controllers.ScenesController{})),
17 | beego.NSNamespace("/script",
18 | beego.NSInclude(&controllers.ScriptController{})),
19 | beego.NSNamespace("/user",
20 | beego.NSInclude(&controllers.UserController{})),
21 | beego.NSNamespace("/home",
22 | beego.NSInclude(&controllers.HomeController{})),
23 | )
24 |
25 | beego.AddNamespace(ns)
26 | }
27 |
--------------------------------------------------------------------------------
/static/css/public.css:
--------------------------------------------------------------------------------
1 | .layuimini-content-page{background-color:#f2f2f2!important;}
2 | .layuimini-container {border:1px solid #f2f2f2;border-radius:5px;background-color:#f2f2f2}
3 | .layuimini-main {margin:10px 10px 10px 10px;border:5px solid #ffffff;border-radius:5px;background-color:#ffffff}
4 | .layui-breadcrumb>* {font-size: 13px;!important;}
5 |
6 | /**必填红点 */
7 | .layuimini-form>.layui-form-item>.required:after {content:'*';color:red;position:absolute;margin-left:4px;font-weight:bold;line-height:1.8em;top:6px;right:5px;}
8 | .layuimini-form>.layui-form-item>.layui-form-label {width:120px !important;}
9 | .layuimini-form>.layui-form-item>.layui-input-block {margin-left:150px !important;}
10 | .layuimini-form>.layui-form-item>.layui-input-block >tip {display:inline-block;margin-top:10px;line-height:10px;font-size:10px;color:#a29c9c;}
11 |
--------------------------------------------------------------------------------
/static/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/img/bg.jpg
--------------------------------------------------------------------------------
/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/img/favicon.ico
--------------------------------------------------------------------------------
/static/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/img/logo.png
--------------------------------------------------------------------------------
/static/js/reload.min.js:
--------------------------------------------------------------------------------
1 | function b(a){var c=new WebSocket(a);c.onclose=function(){setTimeout(function(){b(a)},2E3)};c.onmessage=function(){location.reload()}}try{if(window.WebSocket)try{b("ws://localhost:12450/reload")}catch(a){console.error(a)}else console.log("Your browser does not support WebSockets.")}catch(a){console.error("Exception during connecting to Reload:",a)};
2 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/HELP-US-OUT.txt:
--------------------------------------------------------------------------------
1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project,
2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome,
3 | comprehensive icon sets or copy and paste your own.
4 |
5 | Please. Check it out.
6 |
7 | -Dave Gandy
8 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/font-awesome/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/static/lib/font-awesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/font-awesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/static/lib/font-awesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/font-awesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/static/lib/font-awesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/font-awesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/static/lib/font-awesome/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/font-awesome/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/animated.less:
--------------------------------------------------------------------------------
1 | // Animated Icons
2 | // --------------------------
3 |
4 | .@{fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .@{fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/bordered-pulled.less:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em @fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .@{fa-css-prefix}-pull-left { float: left; }
11 | .@{fa-css-prefix}-pull-right { float: right; }
12 |
13 | .@{fa-css-prefix} {
14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .@{fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/core.less:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .@{fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/fixed-width.less:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .@{fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/font-awesome.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables.less";
7 | @import "mixins.less";
8 | @import "path.less";
9 | @import "core.less";
10 | @import "larger.less";
11 | @import "fixed-width.less";
12 | @import "list.less";
13 | @import "bordered-pulled.less";
14 | @import "animated.less";
15 | @import "rotated-flipped.less";
16 | @import "stacked.less";
17 | @import "icons.less";
18 | @import "screen-reader.less";
19 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/larger.less:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .@{fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .@{fa-css-prefix}-2x { font-size: 2em; }
11 | .@{fa-css-prefix}-3x { font-size: 3em; }
12 | .@{fa-css-prefix}-4x { font-size: 4em; }
13 | .@{fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/list.less:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: @fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .@{fa-css-prefix}-li {
11 | position: absolute;
12 | left: -@fa-li-width;
13 | width: @fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.@{fa-css-prefix}-lg {
17 | left: (-@fa-li-width + (4em / 14));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/path.less:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/rotated-flipped.less:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
7 |
8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .@{fa-css-prefix}-rotate-90,
15 | :root .@{fa-css-prefix}-rotate-180,
16 | :root .@{fa-css-prefix}-rotate-270,
17 | :root .@{fa-css-prefix}-flip-horizontal,
18 | :root .@{fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/screen-reader.less:
--------------------------------------------------------------------------------
1 | // Screen Readers
2 | // -------------------------
3 |
4 | .sr-only { .sr-only(); }
5 | .sr-only-focusable { .sr-only-focusable(); }
6 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/less/stacked.less:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; }
21 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_animated.scss:
--------------------------------------------------------------------------------
1 | // Spinning Icons
2 | // --------------------------
3 |
4 | .#{$fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .#{$fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_bordered-pulled.scss:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em $fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .#{$fa-css-prefix}-pull-left { float: left; }
11 | .#{$fa-css-prefix}-pull-right { float: right; }
12 |
13 | .#{$fa-css-prefix} {
14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .#{$fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_core.scss:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_fixed-width.scss:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .#{$fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_larger.scss:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .#{$fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .#{$fa-css-prefix}-2x { font-size: 2em; }
11 | .#{$fa-css-prefix}-3x { font-size: 3em; }
12 | .#{$fa-css-prefix}-4x { font-size: 4em; }
13 | .#{$fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_list.scss:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: $fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .#{$fa-css-prefix}-li {
11 | position: absolute;
12 | left: -$fa-li-width;
13 | width: $fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.#{$fa-css-prefix}-lg {
17 | left: -$fa-li-width + (4em / 14);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_path.scss:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_rotated-flipped.scss:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
7 |
8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .#{$fa-css-prefix}-rotate-90,
15 | :root .#{$fa-css-prefix}-rotate-180,
16 | :root .#{$fa-css-prefix}-rotate-270,
17 | :root .#{$fa-css-prefix}-flip-horizontal,
18 | :root .#{$fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_screen-reader.scss:
--------------------------------------------------------------------------------
1 | // Screen Readers
2 | // -------------------------
3 |
4 | .sr-only { @include sr-only(); }
5 | .sr-only-focusable { @include sr-only-focusable(); }
6 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/_stacked.scss:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; }
21 |
--------------------------------------------------------------------------------
/static/lib/font-awesome/scss/font-awesome.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables";
7 | @import "mixins";
8 | @import "path";
9 | @import "core";
10 | @import "larger";
11 | @import "fixed-width";
12 | @import "list";
13 | @import "bordered-pulled";
14 | @import "animated";
15 | @import "rotated-flipped";
16 | @import "stacked";
17 | @import "icons";
18 | @import "screen-reader";
19 |
--------------------------------------------------------------------------------
/static/lib/lay-config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * date:2019/08/16
3 | * author:Mr.Chung
4 | * description:此处放layui自定义扩展
5 | */
6 |
7 | window.rootPath = (function (src) {
8 | src = document.scripts[document.scripts.length - 1].src;
9 | return src.substring(0, src.lastIndexOf("/") + 1);
10 | })();
11 |
12 | layui.config({
13 | base: rootPath + "/",
14 | version: true
15 | }).extend({
16 | layuimini: "layuimini/layuimini", // layuimini扩展
17 | tableSelect: "tableSelect/tableSelect", // tableSelect
18 | apiTemplate: "apiTemplate/apiTemplate",
19 | });
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/code.css:
--------------------------------------------------------------------------------
1 | /** layui-v2.5.5 MIT License By https://www.layui.com */
2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/layer/default/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/css/modules/layer/default/icon-ext.png
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/layer/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/css/modules/layer/default/icon.png
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/layer/default/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/css/modules/layer/default/loading-0.gif
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/layer/default/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/css/modules/layer/default/loading-1.gif
--------------------------------------------------------------------------------
/static/lib/layui/css/modules/layer/default/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/css/modules/layer/default/loading-2.gif
--------------------------------------------------------------------------------
/static/lib/layui/font/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/font/iconfont.eot
--------------------------------------------------------------------------------
/static/lib/layui/font/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/font/iconfont.ttf
--------------------------------------------------------------------------------
/static/lib/layui/font/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/font/iconfont.woff
--------------------------------------------------------------------------------
/static/lib/layui/font/iconfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/font/iconfont.woff2
--------------------------------------------------------------------------------
/static/lib/layui/images/face/0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/0.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/1.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/10.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/11.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/12.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/13.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/14.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/15.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/16.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/17.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/18.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/19.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/2.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/20.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/21.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/22.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/23.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/24.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/25.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/26.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/27.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/28.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/29.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/3.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/30.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/31.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/32.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/33.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/34.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/35.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/36.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/37.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/38.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/39.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/4.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/40.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/41.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/42.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/43.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/44.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/45.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/46.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/47.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/48.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/49.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/5.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/50.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/51.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/52.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/53.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/54.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/55.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/56.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/57.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/58.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/59.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/6.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/60.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/61.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/62.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/63.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/64.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/65.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/66.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/67.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/68.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/69.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/7.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/70.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/71.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/8.gif
--------------------------------------------------------------------------------
/static/lib/layui/images/face/9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/static/lib/layui/images/face/9.gif
--------------------------------------------------------------------------------
/static/lib/layui/lay/modules/code.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.5.5 MIT License By https://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
- '+o.replace(/[\r\t\n]+/g,"
- ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend(''+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"
");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");
--------------------------------------------------------------------------------
/tests/default_test.go:
--------------------------------------------------------------------------------
1 | package test
2 |
3 | import (
4 | "net/http"
5 | "net/http/httptest"
6 | "testing"
7 | "runtime"
8 | "path/filepath"
9 | _ "ngrinder-sampling/routers"
10 |
11 | "github.com/astaxie/beego"
12 | . "github.com/smartystreets/goconvey/convey"
13 | )
14 |
15 | func init() {
16 | _, file, _, _ := runtime.Caller(0)
17 | apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator))))
18 | beego.TestBeegoInit(apppath)
19 | }
20 |
21 |
22 | // TestBeego is a sample to run an endpoint test
23 | func TestBeego(t *testing.T) {
24 | r, _ := http.NewRequest("GET", "/", nil)
25 | w := httptest.NewRecorder()
26 | beego.BeeApp.Handlers.ServeHTTP(w, r)
27 |
28 | beego.Trace("testing", "TestBeego", "Code[%d]\n%s", w.Code, w.Body.String())
29 |
30 | Convey("Subject: Test Station Endpoint\n", t, func() {
31 | Convey("Status Code Should Be 200", func() {
32 | So(w.Code, ShouldEqual, 200)
33 | })
34 | Convey("The Result Should Not Be Empty", func() {
35 | So(w.Body.Len(), ShouldBeGreaterThan, 0)
36 | })
37 | })
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/utils/jsonUtil.go:
--------------------------------------------------------------------------------
1 | package utils
2 |
3 | import (
4 | "encoding/json"
5 | "reflect"
6 | )
7 |
8 | func JSONMerger(dst, src []byte) map[string]interface{} {
9 | var m1, m2 map[string]interface{}
10 |
11 | json.Unmarshal((dst), &m1)
12 | json.Unmarshal((src), &m2)
13 |
14 | return JsonMerge(m1, m2)
15 | }
16 |
17 | func JsonMerge(dst, src map[string]interface{}) map[string]interface{} {
18 | return jsMerge(dst, src, 0)
19 | }
20 |
21 | func jsMerge(dst, src map[string]interface{}, depth int) map[string]interface{} {
22 | for key, srcVal := range src {
23 |
24 | if dstVal, ok := dst[key]; ok {
25 |
26 | srcMap, srcMapOk := jsMapify(srcVal)
27 | dstMap, dstMapOk := jsMapify(dstVal)
28 |
29 | if srcMapOk && dstMapOk {
30 | srcVal = jsMerge(dstMap, srcMap, depth+1)
31 | }
32 | }
33 |
34 | dst[key] = srcVal
35 | }
36 |
37 | return dst
38 | }
39 |
40 | func jsMapify(i interface{}) (map[string]interface{}, bool) {
41 |
42 | value := reflect.ValueOf(i)
43 |
44 | if value.Kind() == reflect.Map {
45 |
46 | m := map[string]interface{}{}
47 |
48 | for _, k := range value.MapKeys() {
49 | m[k.String()] = value.MapIndex(k).Interface()
50 | }
51 |
52 | return m, true
53 | }
54 |
55 | return map[string]interface{}{}, false
56 | }
57 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2014 astaxie
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.
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/cache/README.md:
--------------------------------------------------------------------------------
1 | ## cache
2 | cache is a Go cache manager. It can use many cache adapters. The repo is inspired by `database/sql` .
3 |
4 |
5 | ## How to install?
6 |
7 | go get github.com/astaxie/beego/cache
8 |
9 |
10 | ## What adapters are supported?
11 |
12 | As of now this cache support memory, Memcache and Redis.
13 |
14 |
15 | ## How to use it?
16 |
17 | First you must import it
18 |
19 | import (
20 | "github.com/astaxie/beego/cache"
21 | )
22 |
23 | Then init a Cache (example with memory adapter)
24 |
25 | bm, err := cache.NewCache("memory", `{"interval":60}`)
26 |
27 | Use it like this:
28 |
29 | bm.Put("astaxie", 1, 10 * time.Second)
30 | bm.Get("astaxie")
31 | bm.IsExist("astaxie")
32 | bm.Delete("astaxie")
33 |
34 |
35 | ## Memory adapter
36 |
37 | Configure memory adapter like this:
38 |
39 | {"interval":60}
40 |
41 | interval means the gc time. The cache will check at each time interval, whether item has expired.
42 |
43 |
44 | ## Memcache adapter
45 |
46 | Memcache adapter use the [gomemcache](http://github.com/bradfitz/gomemcache) client.
47 |
48 | Configure like this:
49 |
50 | {"conn":"127.0.0.1:11211"}
51 |
52 |
53 | ## Redis adapter
54 |
55 | Redis adapter use the [redigo](http://github.com/gomodule/redigo) client.
56 |
57 | Configure like this:
58 |
59 | {"conn":":6039"}
60 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/context/param/options.go:
--------------------------------------------------------------------------------
1 | package param
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | // MethodParamOption defines a func which apply options on a MethodParam
8 | type MethodParamOption func(*MethodParam)
9 |
10 | // IsRequired indicates that this param is required and can not be omitted from the http request
11 | var IsRequired MethodParamOption = func(p *MethodParam) {
12 | p.required = true
13 | }
14 |
15 | // InHeader indicates that this param is passed via an http header
16 | var InHeader MethodParamOption = func(p *MethodParam) {
17 | p.in = header
18 | }
19 |
20 | // InPath indicates that this param is part of the URL path
21 | var InPath MethodParamOption = func(p *MethodParam) {
22 | p.in = path
23 | }
24 |
25 | // InBody indicates that this param is passed as an http request body
26 | var InBody MethodParamOption = func(p *MethodParam) {
27 | p.in = body
28 | }
29 |
30 | // Default provides a default value for the http param
31 | func Default(defaultValue interface{}) MethodParamOption {
32 | return func(p *MethodParam) {
33 | if defaultValue != nil {
34 | p.defaultValue = fmt.Sprint(defaultValue)
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/context/renderer.go:
--------------------------------------------------------------------------------
1 | package context
2 |
3 | // Renderer defines an http response renderer
4 | type Renderer interface {
5 | Render(ctx *Context)
6 | }
7 |
8 | type rendererFunc func(ctx *Context)
9 |
10 | func (f rendererFunc) Render(ctx *Context) {
11 | f(ctx)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/context/response.go:
--------------------------------------------------------------------------------
1 | package context
2 |
3 | import (
4 | "strconv"
5 |
6 | "net/http"
7 | )
8 |
9 | const (
10 | //BadRequest indicates http error 400
11 | BadRequest StatusCode = http.StatusBadRequest
12 |
13 | //NotFound indicates http error 404
14 | NotFound StatusCode = http.StatusNotFound
15 | )
16 |
17 | // StatusCode sets the http response status code
18 | type StatusCode int
19 |
20 | func (s StatusCode) Error() string {
21 | return strconv.Itoa(int(s))
22 | }
23 |
24 | // Render sets the http status code
25 | func (s StatusCode) Render(ctx *Context) {
26 | ctx.Output.SetStatus(int(s))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package beego provide a MVC framework
3 | beego: an open-source, high-performance, modular, full-stack web framework
4 |
5 | It is used for rapid development of RESTful APIs, web apps and backend services in Go.
6 | beego is inspired by Tornado, Sinatra and Flask with the added benefit of some Go-specific features such as interfaces and struct embedding.
7 |
8 | package main
9 | import "github.com/astaxie/beego"
10 |
11 | func main() {
12 | beego.Run()
13 | }
14 |
15 | more information: http://beego.me
16 | */
17 | package beego
18 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/logs/README.md:
--------------------------------------------------------------------------------
1 | ## logs
2 | logs is a Go logs manager. It can use many logs adapters. The repo is inspired by `database/sql` .
3 |
4 |
5 | ## How to install?
6 |
7 | go get github.com/astaxie/beego/logs
8 |
9 |
10 | ## What adapters are supported?
11 |
12 | As of now this logs support console, file,smtp and conn.
13 |
14 |
15 | ## How to use it?
16 |
17 | First you must import it
18 |
19 | ```golang
20 | import (
21 | "github.com/astaxie/beego/logs"
22 | )
23 | ```
24 |
25 | Then init a Log (example with console adapter)
26 |
27 | ```golang
28 | log := logs.NewLogger(10000)
29 | log.SetLogger("console", "")
30 | ```
31 |
32 | > the first params stand for how many channel
33 |
34 | Use it like this:
35 |
36 | ```golang
37 | log.Trace("trace")
38 | log.Info("info")
39 | log.Warn("warning")
40 | log.Debug("debug")
41 | log.Critical("critical")
42 | ```
43 |
44 | ## File adapter
45 |
46 | Configure file adapter like this:
47 |
48 | ```golang
49 | log := NewLogger(10000)
50 | log.SetLogger("file", `{"filename":"test.log"}`)
51 | ```
52 |
53 | ## Conn adapter
54 |
55 | Configure like this:
56 |
57 | ```golang
58 | log := NewLogger(1000)
59 | log.SetLogger("conn", `{"net":"tcp","addr":":7020"}`)
60 | log.Info("info")
61 | ```
62 |
63 | ## Smtp adapter
64 |
65 | Configure like this:
66 |
67 | ```golang
68 | log := NewLogger(10000)
69 | log.SetLogger("smtp", `{"username":"beegotest@gmail.com","password":"xxxxxxxx","host":"smtp.gmail.com:587","sendTos":["xiemengjun@gmail.com"]}`)
70 | log.Critical("sendmail critical")
71 | time.Sleep(time.Second * 30)
72 | ```
73 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/toolbox/healthcheck.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 beego Author. All Rights Reserved.
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 |
15 | // Package toolbox healthcheck
16 | //
17 | // type DatabaseCheck struct {
18 | // }
19 | //
20 | // func (dc *DatabaseCheck) Check() error {
21 | // if dc.isConnected() {
22 | // return nil
23 | // } else {
24 | // return errors.New("can't connect database")
25 | // }
26 | // }
27 | //
28 | // AddHealthCheck("database",&DatabaseCheck{})
29 | //
30 | // more docs: http://beego.me/docs/module/toolbox.md
31 | package toolbox
32 |
33 | // AdminCheckList holds health checker map
34 | var AdminCheckList map[string]HealthChecker
35 |
36 | // HealthChecker health checker interface
37 | type HealthChecker interface {
38 | Check() error
39 | }
40 |
41 | // AddHealthCheck add health checker with name string
42 | func AddHealthCheck(name string, hc HealthChecker) {
43 | AdminCheckList[name] = hc
44 | }
45 |
46 | func init() {
47 | AdminCheckList = make(map[string]HealthChecker)
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/utils/caller.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 beego Author. All Rights Reserved.
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 |
15 | package utils
16 |
17 | import (
18 | "reflect"
19 | "runtime"
20 | )
21 |
22 | // GetFuncName get function name
23 | func GetFuncName(i interface{}) string {
24 | return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/utils/rand.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 beego Author. All Rights Reserved.
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 |
15 | package utils
16 |
17 | import (
18 | "crypto/rand"
19 | r "math/rand"
20 | "time"
21 | )
22 |
23 | var alphaNum = []byte(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`)
24 |
25 | // RandomCreateBytes generate random []byte by specify chars.
26 | func RandomCreateBytes(n int, alphabets ...byte) []byte {
27 | if len(alphabets) == 0 {
28 | alphabets = alphaNum
29 | }
30 | var bytes = make([]byte, n)
31 | var randBy bool
32 | if num, err := rand.Read(bytes); num != n || err != nil {
33 | r.Seed(time.Now().UnixNano())
34 | randBy = true
35 | }
36 | for i, b := range bytes {
37 | if randBy {
38 | bytes[i] = alphabets[r.Intn(len(alphabets))]
39 | } else {
40 | bytes[i] = alphabets[b%byte(len(alphabets))]
41 | }
42 | }
43 | return bytes
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/fatih/structs/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Fatih Arslan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/vendor/github.com/fatih/structs/tags.go:
--------------------------------------------------------------------------------
1 | package structs
2 |
3 | import "strings"
4 |
5 | // tagOptions contains a slice of tag options
6 | type tagOptions []string
7 |
8 | // Has returns true if the given option is available in tagOptions
9 | func (t tagOptions) Has(opt string) bool {
10 | for _, tagOpt := range t {
11 | if tagOpt == opt {
12 | return true
13 | }
14 | }
15 |
16 | return false
17 | }
18 |
19 | // parseTag splits a struct field's tag into its name and a list of options
20 | // which comes after a name. A tag is in the form of: "name,option1,option2".
21 | // The name can be neglectected.
22 | func parseTag(tag string) (string, tagOptions) {
23 | // tag is one of followings:
24 | // ""
25 | // "name"
26 | // "name,opt"
27 | // "name,opt,opt2"
28 | // ",opt"
29 |
30 | res := strings.Split(tag, ",")
31 | return res[0], res[1:]
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/github.com/gf-third/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/gf-third/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 | "context"
15 | "net"
16 |
17 | "google.golang.org/appengine/cloudsql"
18 | )
19 |
20 | func init() {
21 | RegisterDialContext("cloudsql", func(_ context.Context, instance string) (net.Conn, error) {
22 | // XXX: the cloudsql driver still does not export a Context-aware dialer.
23 | return cloudsql.Dial(instance)
24 | })
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/gf-third/mysql/conncheck.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2019 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 !windows,!appengine
10 |
11 | package mysql
12 |
13 | import (
14 | "errors"
15 | "io"
16 | "net"
17 | "syscall"
18 | )
19 |
20 | var errUnexpectedRead = errors.New("unexpected read from socket")
21 |
22 | func connCheck(c net.Conn) error {
23 | var (
24 | n int
25 | err error
26 | buff [1]byte
27 | )
28 |
29 | sconn, ok := c.(syscall.Conn)
30 | if !ok {
31 | return nil
32 | }
33 | rc, err := sconn.SyscallConn()
34 | if err != nil {
35 | return err
36 | }
37 | rerr := rc.Read(func(fd uintptr) bool {
38 | n, err = syscall.Read(int(fd), buff[:])
39 | return true
40 | })
41 | switch {
42 | case rerr != nil:
43 | return rerr
44 | case n == 0 && err == nil:
45 | return io.EOF
46 | case n > 0:
47 | return errUnexpectedRead
48 | case err == syscall.EAGAIN || err == syscall.EWOULDBLOCK:
49 | return nil
50 | default:
51 | return err
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/github.com/gf-third/mysql/conncheck_dummy.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2019 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 windows appengine
10 |
11 | package mysql
12 |
13 | import "net"
14 |
15 | func connCheck(c net.Conn) error {
16 | return nil
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/gf-third/mysql/driver_go110.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2018 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.10
10 |
11 | package mysql
12 |
13 | import (
14 | "database/sql/driver"
15 | )
16 |
17 | // NewConnector returns new driver.Connector.
18 | func NewConnector(cfg *Config) (driver.Connector, error) {
19 | cfg = cfg.Clone()
20 | // normalize the contents of cfg so calls to NewConnector have the same
21 | // behavior as MySQLDriver.OpenConnector
22 | if err := cfg.normalize(); err != nil {
23 | return nil, err
24 | }
25 | return &connector{cfg: cfg}, nil
26 | }
27 |
28 | // OpenConnector implements driver.DriverContext.
29 | func (d MySQLDriver) OpenConnector(dsn string) (driver.Connector, error) {
30 | cfg, err := ParseDSN(dsn)
31 | if err != nil {
32 | return nil, err
33 | }
34 | return &connector{
35 | cfg: cfg,
36 | }, nil
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/gf-third/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/gf-third/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/go-sql-driver/mysql/conncheck.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2019 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 !windows,!appengine
10 |
11 | package mysql
12 |
13 | import (
14 | "errors"
15 | "io"
16 | "net"
17 | "syscall"
18 | )
19 |
20 | var errUnexpectedRead = errors.New("unexpected read from socket")
21 |
22 | func connCheck(conn net.Conn) error {
23 | var sysErr error
24 |
25 | sysConn, ok := conn.(syscall.Conn)
26 | if !ok {
27 | return nil
28 | }
29 | rawConn, err := sysConn.SyscallConn()
30 | if err != nil {
31 | return err
32 | }
33 |
34 | err = rawConn.Read(func(fd uintptr) bool {
35 | var buf [1]byte
36 | n, err := syscall.Read(int(fd), buf[:])
37 | switch {
38 | case n == 0 && err == nil:
39 | sysErr = io.EOF
40 | case n > 0:
41 | sysErr = errUnexpectedRead
42 | case err == syscall.EAGAIN || err == syscall.EWOULDBLOCK:
43 | sysErr = nil
44 | default:
45 | sysErr = err
46 | }
47 | return true
48 | })
49 | if err != nil {
50 | return err
51 | }
52 |
53 | return sysErr
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2019 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 windows appengine
10 |
11 | package mysql
12 |
13 | import "net"
14 |
15 | func connCheck(conn net.Conn) error {
16 | return nil
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/driver_go110.go:
--------------------------------------------------------------------------------
1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2 | //
3 | // Copyright 2018 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.10
10 |
11 | package mysql
12 |
13 | import (
14 | "database/sql/driver"
15 | )
16 |
17 | // NewConnector returns new driver.Connector.
18 | func NewConnector(cfg *Config) (driver.Connector, error) {
19 | cfg = cfg.Clone()
20 | // normalize the contents of cfg so calls to NewConnector have the same
21 | // behavior as MySQLDriver.OpenConnector
22 | if err := cfg.normalize(); err != nil {
23 | return nil, err
24 | }
25 | return &connector{cfg: cfg}, nil
26 | }
27 |
28 | // OpenConnector implements driver.DriverContext.
29 | func (d MySQLDriver) OpenConnector(dsn string) (driver.Connector, error) {
30 | cfg, err := ParseDSN(dsn)
31 | if err != nil {
32 | return nil, err
33 | }
34 | return &connector{
35 | cfg: cfg,
36 | }, nil
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/go-sql-driver/mysql
2 |
3 | go 1.9
4 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/nulltime.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 | package mysql
10 |
11 | import (
12 | "database/sql/driver"
13 | "fmt"
14 | "time"
15 | )
16 |
17 | // Scan implements the Scanner interface.
18 | // The value type must be time.Time or string / []byte (formatted time-string),
19 | // otherwise Scan fails.
20 | func (nt *NullTime) Scan(value interface{}) (err error) {
21 | if value == nil {
22 | nt.Time, nt.Valid = time.Time{}, false
23 | return
24 | }
25 |
26 | switch v := value.(type) {
27 | case time.Time:
28 | nt.Time, nt.Valid = v, true
29 | return
30 | case []byte:
31 | nt.Time, err = parseDateTime(string(v), time.UTC)
32 | nt.Valid = (err == nil)
33 | return
34 | case string:
35 | nt.Time, err = parseDateTime(v, time.UTC)
36 | nt.Valid = (err == nil)
37 | return
38 | }
39 |
40 | nt.Valid = false
41 | return fmt.Errorf("Can't convert %T to time.Time", value)
42 | }
43 |
44 | // Value implements the driver Valuer interface.
45 | func (nt NullTime) Value() (driver.Value, error) {
46 | if !nt.Valid {
47 | return nil, nil
48 | }
49 | return nt.Time, nil
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/nulltime_go113.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 go1.13
10 |
11 | package mysql
12 |
13 | import (
14 | "database/sql"
15 | )
16 |
17 | // NullTime represents a time.Time that may be NULL.
18 | // NullTime implements the Scanner interface so
19 | // it can be used as a scan destination:
20 | //
21 | // var nt NullTime
22 | // err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
23 | // ...
24 | // if nt.Valid {
25 | // // use nt.Time
26 | // } else {
27 | // // NULL value
28 | // }
29 | //
30 | // This NullTime implementation is not driver-specific
31 | type NullTime sql.NullTime
32 |
--------------------------------------------------------------------------------
/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.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 !go1.13
10 |
11 | package mysql
12 |
13 | import (
14 | "time"
15 | )
16 |
17 | // NullTime represents a time.Time that may be NULL.
18 | // NullTime implements the Scanner interface so
19 | // it can be used as a scan destination:
20 | //
21 | // var nt NullTime
22 | // err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
23 | // ...
24 | // if nt.Valid {
25 | // // use nt.Time
26 | // } else {
27 | // // NULL value
28 | // }
29 | //
30 | // This NullTime implementation is not driver-specific
31 | type NullTime struct {
32 | Time time.Time
33 | Valid bool // Valid is true if Time is not NULL
34 | }
35 |
--------------------------------------------------------------------------------
/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/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/gogf/gf/DONATOR.MD:
--------------------------------------------------------------------------------
1 | # Donators
2 |
3 |
4 | | Name | Channel | Amount
5 | |---|---|---
6 | |[hailaz](https://gitee.com/hailaz)|gitee|¥20.00
7 | |[ireadx](https://github.com/ireadx)|alipay|¥301.00
8 | |[mg91](https://gitee.com/mg91)|gitee|¥10.00
9 | |[pibigstar](https://github.com/pibigstar)|alipay|¥10.00
10 | |[tiangenglan](https://gitee.com/tiangenglan)|gitee|¥30.00
11 | |[wxkj](https://gitee.com/wxkj)|wechat|¥10.00
12 | |[zhuhuan12](https://gitee.com/zhuhuan12)|gitee|¥50.00
13 | |[zfan_codes](https://gitee.com/zfan_codes)|gitee|¥10.00
14 | |[arden](https://github.com/arden)|alipay|¥10.00
15 | |[macnie](https://www.macnie.com)|wechat|¥100.00
16 | |lah|wechat|¥100.00
17 | |x*z|wechat|¥20.00
18 | |潘兄|wechat|¥100.00
19 | |Fly的狐狸|wechat|¥100.00
20 | |全|alipay|¥100.00
21 | |东东|wechat|¥100.00
22 | |严宇轩|alipay|¥99.99
23 | |土豆相公|alipay|¥66.60
24 | |Hades|alipay|¥66.66
25 | |蔡蔡|wechat|¥666.00
26 | |上海金保证网络科技|bank|¥2000.00
27 | |[foxhack](https://github.com/foxhack)|wechat|¥20.00
28 | |*栈|wechat|¥5.00
29 | |*络|wechat|¥10.00
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 john@goframe.org https://goframe.org
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/gogf/gf/container/garray/garray.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package garray provides concurrent-safe/unsafe arrays.
8 | package garray
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/container/gmap/gmap_tree_map.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with gm file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gmap
8 |
9 | import (
10 | "github.com/gogf/gf/container/gtree"
11 | )
12 |
13 | // Map based on red-black tree, alias of RedBlackTree.
14 | type TreeMap = gtree.RedBlackTree
15 |
16 | // NewTreeMap instantiates a tree map with the custom comparator.
17 | // The parameter used to specify whether using tree in un-concurrent-safety,
18 | // which is false in default.
19 | func NewTreeMap(comparator func(v1, v2 interface{}) int, safe ...bool) *TreeMap {
20 | return gtree.NewRedBlackTree(comparator, safe...)
21 | }
22 |
23 | // NewTreeMapFrom instantiates a tree map with the custom comparator and map.
24 | // Note that, the param map will be set as the underlying data map(no deep copy),
25 | // there might be some concurrent-safe issues when changing the map outside.
26 | // The parameter used to specify whether using tree in un-concurrent-safety,
27 | // which is false in default.
28 | func NewTreeMapFrom(comparator func(v1, v2 interface{}) int, data map[interface{}]interface{}, safe ...bool) *TreeMap {
29 | return gtree.NewRedBlackTreeFrom(comparator, data, safe...)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/container/gtree/gtree.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gtree provides concurrent-safe/unsafe tree containers.
8 | package gtree
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/container/gtype/gtype.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gtype provides kinds of high performance and concurrent-safe basic variable types.
8 | package gtype
9 |
10 | // Type is alias of Interface.
11 | type Type = Interface
12 |
13 | // New is alias of NewInterface.
14 | // See NewInterface.
15 | func New(value ...interface{}) *Type {
16 | return NewInterface(value...)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gdb/gdb_batch_result.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gdb
8 |
9 | import "database/sql"
10 |
11 | // 批量执行的结果对象
12 | type batchSqlResult struct {
13 | rowsAffected int64
14 | lastResult sql.Result
15 | }
16 |
17 | // see sql.Result.RowsAffected
18 | func (r *batchSqlResult) RowsAffected() (int64, error) {
19 | return r.rowsAffected, nil
20 | }
21 |
22 | // see sql.Result.LastInsertId
23 | func (r *batchSqlResult) LastInsertId() (int64, error) {
24 | return r.lastResult.LastInsertId()
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gdb/gdb_mysql.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gdb
8 |
9 | import (
10 | "database/sql"
11 | "fmt"
12 |
13 | _ "github.com/gf-third/mysql"
14 | )
15 |
16 | // 数据库链接对象
17 | type dbMysql struct {
18 | *dbBase
19 | }
20 |
21 | // 创建SQL操作对象,内部采用了lazy link处理
22 | func (db *dbMysql) Open(config *ConfigNode) (*sql.DB, error) {
23 | var source string
24 | if config.LinkInfo != "" {
25 | source = config.LinkInfo
26 | } else {
27 | source = fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=%s&multiStatements=true&parseTime=true&loc=Local",
28 | config.User, config.Pass, config.Host, config.Port, config.Name, config.Charset)
29 | }
30 | if db, err := sql.Open("gf-mysql", source); err == nil {
31 | return db, nil
32 | } else {
33 | return nil, err
34 | }
35 | }
36 |
37 | // 获得关键字操作符
38 | func (db *dbMysql) getChars() (charLeft string, charRight string) {
39 | return "`", "`"
40 | }
41 |
42 | // 在执行sql之前对sql进行进一步处理
43 | func (db *dbMysql) handleSqlBeforeExec(query string) string {
44 | return query
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gdb/gdb_type_record.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gdb
8 |
9 | import (
10 | "database/sql"
11 | "github.com/gogf/gf/container/gmap"
12 |
13 | "github.com/gogf/gf/encoding/gparser"
14 | )
15 |
16 | // 将记录结果转换为JSON字符串
17 | func (r Record) Json() string {
18 | content, _ := gparser.VarToJson(r.Map())
19 | return string(content)
20 | }
21 |
22 | // 将记录结果转换为XML字符串
23 | func (r Record) Xml(rootTag ...string) string {
24 | content, _ := gparser.VarToXml(r.Map(), rootTag...)
25 | return string(content)
26 | }
27 |
28 | // 将Record转换为Map类型
29 | func (r Record) Map() Map {
30 | m := make(map[string]interface{})
31 | for k, v := range r {
32 | m[k] = v.Val()
33 | }
34 | return m
35 | }
36 |
37 | // 将Record转换为常用的gmap.StrAnyMap类型
38 | func (r Record) GMap() *gmap.StrAnyMap {
39 | return gmap.NewStrAnyMapFrom(r.Map())
40 | }
41 |
42 | // 将Map变量映射到指定的struct对象中,注意参数应当是一个对象的指针
43 | func (r Record) Struct(pointer interface{}) error {
44 | if r == nil {
45 | return sql.ErrNoRows
46 | }
47 | return mapToStruct(r.Map(), pointer)
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gdb/gdb_type_record_deprecated.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gdb
8 |
9 | import (
10 | "database/sql"
11 | "github.com/gogf/gf/encoding/gparser"
12 | )
13 |
14 | // Deprecated.
15 | func (r Record) ToJson() string {
16 | content, _ := gparser.VarToJson(r.Map())
17 | return string(content)
18 | }
19 |
20 | // Deprecated.
21 | func (r Record) ToXml(rootTag ...string) string {
22 | content, _ := gparser.VarToXml(r.Map(), rootTag...)
23 | return string(content)
24 | }
25 |
26 | // Deprecated.
27 | func (r Record) ToMap() Map {
28 | m := make(map[string]interface{})
29 | for k, v := range r {
30 | m[k] = v.Val()
31 | }
32 | return m
33 | }
34 |
35 | // Deprecated.
36 | func (r Record) ToStruct(pointer interface{}) error {
37 | if r == nil {
38 | return sql.ErrNoRows
39 | }
40 | return mapToStruct(r.Map(), pointer)
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gredis/gredis_conn.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gredis
8 |
9 | import "github.com/gogf/gf/container/gvar"
10 |
11 | // DoVar returns value from Do as gvar.Var.
12 | func (c *Conn) DoVar(command string, args ...interface{}) (*gvar.Var, error) {
13 | v, err := c.Do(command, args...)
14 | return gvar.New(v), err
15 | }
16 |
17 | // ReceiveVar receives a single reply as gvar.Var from the Redis server.
18 | func (c *Conn) ReceiveVar() (*gvar.Var, error) {
19 | v, err := c.Receive()
20 | return gvar.New(v), err
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/database/gredis/gredis_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gredis
8 |
9 | import "github.com/gogf/gf/container/gmap"
10 |
11 | var (
12 | // Instance map
13 | instances = gmap.NewStrAnyMap(true)
14 | )
15 |
16 | // Instance returns an instance of redis client with specified group.
17 | // The param is unnecessary, if is not passed,
18 | // it returns a redis instance with default configuration group.
19 | func Instance(name ...string) *Redis {
20 | group := DEFAULT_GROUP_NAME
21 | if len(name) > 0 && name[0] != "" {
22 | group = name[0]
23 | }
24 | v := instances.GetOrSetFuncLock(group, func() interface{} {
25 | if config, ok := GetConfig(group); ok {
26 | r := New(config)
27 | r.group = group
28 | return r
29 | }
30 | return nil
31 | })
32 | if v != nil {
33 | return v.(*Redis)
34 | }
35 | return nil
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/encoding/gbinary/gbinary_func.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gbinary
8 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/encoding/gjson/gjson_api_config.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gjson
8 |
9 | // SetSplitChar sets the separator char for hierarchical data access.
10 | func (j *Json) SetSplitChar(char byte) {
11 | j.mu.Lock()
12 | j.c = char
13 | j.mu.Unlock()
14 | }
15 |
16 | // SetViolenceCheck enables/disables violence check for hierarchical data access.
17 | func (j *Json) SetViolenceCheck(enabled bool) {
18 | j.mu.Lock()
19 | j.vc = enabled
20 | j.mu.Unlock()
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/encoding/gparser/gparser.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://gitee.com/johng/gp.
6 |
7 | // Package gparser provides convenient API for accessing/converting variable and JSON/XML/YAML/TOML.
8 | package gparser
9 |
10 | import (
11 | "github.com/gogf/gf/encoding/gjson"
12 | )
13 |
14 | // Parser is actually alias of gjson.Json.
15 | type Parser = gjson.Json
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/encoding/gparser/gparser_api_encoding.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://gitee.com/johng/gp.
6 |
7 | package gparser
8 |
9 | func VarToXml(value interface{}, rootTag ...string) ([]byte, error) {
10 | return New(value).ToXml(rootTag...)
11 | }
12 |
13 | func VarToXmlIndent(value interface{}, rootTag ...string) ([]byte, error) {
14 | return New(value).ToXmlIndent(rootTag...)
15 | }
16 |
17 | func VarToJson(value interface{}) ([]byte, error) {
18 | return New(value).ToJson()
19 | }
20 |
21 | func VarToJsonString(value interface{}) (string, error) {
22 | return New(value).ToJsonString()
23 | }
24 |
25 | func VarToJsonIndent(value interface{}) ([]byte, error) {
26 | return New(value).ToJsonIndent()
27 | }
28 |
29 | func VarToJsonIndentString(value interface{}) (string, error) {
30 | return New(value).ToJsonIndentString()
31 | }
32 |
33 | func VarToYaml(value interface{}) ([]byte, error) {
34 | return New(value).ToYaml()
35 | }
36 |
37 | func VarToToml(value interface{}) ([]byte, error) {
38 | return New(value).ToToml()
39 | }
40 |
41 | func VarToIni(value interface{}) ([]byte, error) {
42 | return New(value).ToIni()
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/errors/gerror/gerror_stack.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gerror
8 |
9 | import "runtime"
10 |
11 | // stack represents a stack of program counters.
12 | type stack []uintptr
13 |
14 | const (
15 | gMAX_STACK_DEPTH = 32
16 | )
17 |
18 | func callers() stack {
19 | var pcs [gMAX_STACK_DEPTH]uintptr
20 | n := runtime.Callers(3, pcs[:])
21 | return pcs[0:n]
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/frame/g/g_logger.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package g
8 |
9 | import (
10 | "github.com/gogf/gf/os/glog"
11 | )
12 |
13 | // SetDebug disables/enables debug level for logging component globally.
14 | func SetDebug(debug bool) {
15 | glog.SetDebug(debug)
16 | }
17 |
18 | // SetLogLevel sets the logging level globally.
19 | func SetLogLevel(level int) {
20 | glog.SetLevel(level)
21 | }
22 |
23 | // GetLogLevel returns the global logging level.
24 | func GetLogLevel() int {
25 | return glog.GetLevel()
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/frame/g/g_setting.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package g
8 |
9 | import "github.com/gogf/gf/net/ghttp"
10 |
11 | // SetServerGraceful enables/disables graceful reload feature of http Web Server.
12 | // This feature is disabled in default.
13 | func SetServerGraceful(enabled bool) {
14 | ghttp.SetGraceful(enabled)
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/gogf/gf
2 |
3 | go 1.10
4 |
5 | require (
6 | github.com/BurntSushi/toml v0.3.1
7 | github.com/clbanning/mxj v1.8.4
8 | github.com/fatih/structs v1.1.0
9 | github.com/fsnotify/fsnotify v1.4.7
10 | github.com/gf-third/mysql v1.4.2
11 | github.com/gf-third/yaml v1.0.1
12 | github.com/gomodule/redigo v2.0.0+incompatible
13 | github.com/google/uuid v1.1.1
14 | github.com/gorilla/websocket v1.4.1
15 | github.com/grokify/html-strip-tags-go v0.0.0-20190921062105-daaa06bf1aaf
16 | github.com/mattn/go-runewidth v0.0.4 // indirect
17 | github.com/olekukonko/tablewriter v0.0.1
18 | golang.org/x/sys v0.0.0-20190924092210-98129a5cf4a0 // indirect
19 | golang.org/x/text v0.3.2
20 | google.golang.org/appengine v1.6.3 // indirect
21 | )
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/i18n/gi18n/gi18n.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gi18n implements internationalization and localization.
8 | package gi18n
9 |
10 | var (
11 | defaultManager = Instance()
12 | )
13 |
14 | // SetPath sets the directory path storing i18n files.
15 | func SetPath(path string) error {
16 | return defaultManager.SetPath(path)
17 | }
18 |
19 | // SetLanguage sets the language for translator.
20 | func SetLanguage(language string) {
21 | defaultManager.SetLanguage(language)
22 | }
23 |
24 | // SetDelimiters sets the delimiters for translator.
25 | func SetDelimiters(left, right string) {
26 | defaultManager.SetDelimiters(left, right)
27 | }
28 |
29 | // T is alias of Translate.
30 | func T(content string, language ...string) string {
31 | return defaultManager.T(content, language...)
32 | }
33 |
34 | // Translate translates with configured language.
35 | // The parameter specifies custom translation language ignoring configured language.
36 | func Translate(content string, language ...string) string {
37 | return defaultManager.Translate(content, language...)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/i18n/gi18n/gi18n_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gi18n
8 |
9 | import "github.com/gogf/gf/container/gmap"
10 |
11 | const (
12 | // Default group name for instance usage.
13 | DEFAULT_NAME = "default"
14 | )
15 |
16 | var (
17 | // Instances map.
18 | instances = gmap.NewStrAnyMap(true)
19 | )
20 |
21 | // Instance returns an instance of Resource.
22 | // The parameter is the name for the instance.
23 | func Instance(name ...string) *Manager {
24 | key := DEFAULT_NAME
25 | if len(name) > 0 && name[0] != "" {
26 | key = name[0]
27 | }
28 | return instances.GetOrSetFuncLock(key, func() interface{} {
29 | return New()
30 | }).(*Manager)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/internal/structs/structs.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package structs provides functions for struct conversion.
8 | package structs
9 |
10 | import (
11 | "github.com/fatih/structs"
12 | )
13 |
14 | // Field is alias of structs.Field.
15 | type Field = structs.Field
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/internal/utilbytes/utilbytes.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package utibytes provides some bytes functions for internal usage.
8 | package utilbytes
9 |
10 | import (
11 | "bytes"
12 | "fmt"
13 | )
14 |
15 | func Export(b []byte) string {
16 | buffer := bytes.NewBuffer(nil)
17 | buffer.WriteString(`[]byte("`)
18 | for _, v := range b {
19 | fmt.Fprintf(buffer, `\x%02x`, v)
20 | }
21 | buffer.WriteString(`")`)
22 | return buffer.String()
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package ghttp provides powerful http server and simple client implements.
8 | package ghttp
9 |
10 | var (
11 | paramTagPriority = []string{"param", "params", "p"}
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_client_response.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "io/ioutil"
11 | "net/http"
12 | "time"
13 | )
14 |
15 | // 客户端请求结果对象
16 | type ClientResponse struct {
17 | *http.Response
18 | cookies map[string]string
19 | }
20 |
21 | // 获得返回的指定COOKIE值
22 | func (r *ClientResponse) GetCookie(key string) string {
23 | if len(r.cookies) == 0 {
24 | now := time.Now()
25 | for _, v := range r.Cookies() {
26 | if v.Expires.UnixNano() < now.UnixNano() {
27 | continue
28 | }
29 | r.cookies[v.Name] = v.Value
30 | }
31 | }
32 | return r.cookies[key]
33 | }
34 |
35 | // 获取返回的数据(二进制).
36 | func (r *ClientResponse) ReadAll() []byte {
37 | body, err := ioutil.ReadAll(r.Body)
38 | if err != nil {
39 | return nil
40 | }
41 | return body
42 | }
43 |
44 | // 获取返回的数据(字符串).
45 | func (r *ClientResponse) ReadAllString() string {
46 | return string(r.ReadAll())
47 | }
48 |
49 | // 关闭返回的HTTP链接
50 | func (r *ClientResponse) Close() error {
51 | r.Response.Close = true
52 | return r.Body.Close()
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_controller.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | // 控制器接口
10 | type Controller interface {
11 | Init(*Request)
12 | Shut()
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_func.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "strings"
11 |
12 | "github.com/gogf/gf/encoding/gurl"
13 | "github.com/gogf/gf/util/gconv"
14 | )
15 |
16 | // 构建请求参数,参数支持任意数据类型,常见参数类型为string/map。
17 | // 如果参数为map类型,参数值将会进行urlencode编码;可以通过 noUrlEncode:true 参数取消编码。
18 | func BuildParams(params interface{}, noUrlEncode ...bool) (encodedParamStr string) {
19 | m, urlEncode := gconv.Map(params), true
20 | if len(m) == 0 {
21 | return gconv.String(params)
22 | }
23 | if len(noUrlEncode) == 1 {
24 | urlEncode = !noUrlEncode[0]
25 | }
26 | s := ""
27 | for k, v := range m {
28 | if len(encodedParamStr) > 0 {
29 | encodedParamStr += "&"
30 | }
31 | s = gconv.String(v)
32 | if urlEncode && len(s) > 6 && strings.Compare(s[0:6], "@file:") != 0 {
33 | s = gurl.Encode(s)
34 | }
35 | encodedParamStr += k + "=" + s
36 | }
37 | return
38 | }
39 |
40 | // 友好地调用方法
41 | func niceCallFunc(f func()) {
42 | defer func() {
43 | if err := recover(); err != nil {
44 | switch err {
45 | case gEXCEPTION_EXIT:
46 | fallthrough
47 | case gEXCEPTION_EXIT_ALL:
48 | return
49 | default:
50 | panic(err)
51 | }
52 | }
53 | }()
54 | f()
55 | }
56 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_request_hook.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | // 获得当前请求,指定类型的的钩子函数列表
10 | func (r *Request) getHookHandlers(hook string) []*handlerParsedItem {
11 | if !r.hasHookHandler {
12 | return nil
13 | }
14 | parsedItems := make([]*handlerParsedItem, 0, 4)
15 | for _, v := range r.handlers {
16 | if v.handler.hookName != hook {
17 | continue
18 | }
19 | item := v
20 | parsedItems = append(parsedItems, item)
21 | }
22 | return parsedItems
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_request_params.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import "github.com/gogf/gf/container/gvar"
10 |
11 | // 设置请求流程共享变量
12 | func (r *Request) SetParam(key string, value interface{}) {
13 | if r.params == nil {
14 | r.params = make(map[string]interface{})
15 | }
16 | r.params[key] = value
17 | }
18 |
19 | // 获取请求流程共享变量
20 | func (r *Request) GetParam(key string, def ...interface{}) interface{} {
21 | if r.params != nil {
22 | return r.params[key]
23 | }
24 | if len(def) > 0 {
25 | return def[0]
26 | }
27 | return nil
28 | }
29 |
30 | // 获取请求流程共享变量
31 | func (r *Request) GetParamVar(key string, def ...interface{}) *gvar.Var {
32 | return gvar.New(r.GetParam(key, def...))
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_request_router.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import "github.com/gogf/gf/container/gvar"
10 |
11 | func (r *Request) SetRouterValue(key string, value interface{}) {
12 | r.routerMap[key] = value
13 | }
14 |
15 | // 获得路由解析参数
16 | func (r *Request) GetRouterValue(key string, def ...interface{}) interface{} {
17 | if r.routerMap != nil {
18 | return r.routerMap[key]
19 | }
20 | if len(def) > 0 {
21 | return def[0]
22 | }
23 | return nil
24 | }
25 |
26 | // 获得路由解析参数
27 | func (r *Request) GetRouterVar(key string, def ...interface{}) *gvar.Var {
28 | return gvar.New(r.GetRouterValue(key, def...))
29 | }
30 |
31 | func (r *Request) GetRouterString(key string, def ...interface{}) string {
32 | return r.GetRouterVar(key, def...).String()
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_request_view.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import "github.com/gogf/gf/os/gview"
10 |
11 | // SetView sets template view engine object for this response.
12 | func (r *Request) SetView(view *gview.View) {
13 | r.view = view
14 | }
15 |
16 | // GetView returns the template view engine object for this response.
17 | func (r *Request) GetView() *gview.View {
18 | view := r.view
19 | if view == nil {
20 | view = r.Server.config.View
21 | }
22 | if view == nil {
23 | view = gview.Instance()
24 | }
25 | return view
26 | }
27 |
28 | // Assigns binds multiple template variables to current request.
29 | func (r *Request) Assigns(data gview.Params) {
30 | if r.viewParams == nil {
31 | r.viewParams = make(gview.Params, len(data))
32 | }
33 | for k, v := range data {
34 | r.viewParams[k] = v
35 | }
36 | }
37 |
38 | // Assign binds a template variable to current request.
39 | func (r *Request) Assign(key string, value interface{}) {
40 | if r.viewParams == nil {
41 | r.viewParams = make(gview.Params)
42 | }
43 | r.viewParams[key] = value
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_admin_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // +build !windows
8 |
9 | package ghttp
10 |
11 | import (
12 | "os"
13 | "os/signal"
14 | "syscall"
15 | )
16 |
17 | // 进程信号量监听消息队列
18 | var procSignalChan = make(chan os.Signal)
19 |
20 | // 信号量处理
21 | func handleProcessSignal() {
22 | var sig os.Signal
23 | signal.Notify(
24 | procSignalChan,
25 | syscall.SIGINT,
26 | syscall.SIGQUIT,
27 | syscall.SIGKILL,
28 | syscall.SIGTERM,
29 | syscall.SIGUSR1,
30 | syscall.SIGUSR2,
31 | )
32 | for {
33 | sig = <-procSignalChan
34 | switch sig {
35 | // 进程终止,停止所有子进程运行
36 | case syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL, syscall.SIGTERM:
37 | shutdownWebServers(sig.String())
38 | return
39 |
40 | // 用户信号,重启服务
41 | case syscall.SIGUSR1:
42 | restartWebServers(sig.String())
43 | return
44 |
45 | default:
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_admin_windows.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // +build windows
8 |
9 | package ghttp
10 |
11 | // windows不处理信号量
12 | func handleProcessSignal() {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_config_cookie.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "time"
11 | )
12 |
13 | // 设置http server参数 - CookieMaxAge
14 | func (s *Server) SetCookieMaxAge(ttl time.Duration) {
15 | s.config.CookieMaxAge = ttl
16 | }
17 |
18 | // 设置http server参数 - CookiePath
19 | func (s *Server) SetCookiePath(path string) {
20 | s.config.CookiePath = path
21 | }
22 |
23 | // 设置http server参数 - CookieDomain
24 | func (s *Server) SetCookieDomain(domain string) {
25 | s.config.CookieDomain = domain
26 | }
27 |
28 | // 获取http server参数 - CookieMaxAge
29 | func (s *Server) GetCookieMaxAge() time.Duration {
30 | return s.config.CookieMaxAge
31 | }
32 |
33 | // 获取http server参数 - CookiePath
34 | func (s *Server) GetCookiePath() string {
35 | return s.config.CookiePath
36 | }
37 |
38 | // 获取http server参数 - CookieDomain
39 | func (s *Server) GetCookieDomain() string {
40 | return s.config.CookieDomain
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_config_logging.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | // 设置日志目录,只有在设置了日志目录的情况下才会输出日志到日志文件中。
10 | func (s *Server) SetLogPath(path string) {
11 | if len(path) == 0 {
12 | return
13 | }
14 | s.config.LogPath = path
15 | s.config.ErrorLogEnabled = true
16 | s.config.AccessLogEnabled = true
17 | }
18 |
19 | // 设置日志内容是否输出到终端,默认情况下只有错误日志才会自动输出到终端。
20 | // 如果需要输出请求日志到终端,默认情况下使用SetAccessLogEnabled方法开启请求日志特性即可。
21 | func (s *Server) SetLogStdout(enabled bool) {
22 | s.config.LogStdout = enabled
23 | }
24 |
25 | // 设置是否开启access log日志功能
26 | func (s *Server) SetAccessLogEnabled(enabled bool) {
27 | s.config.AccessLogEnabled = enabled
28 | }
29 |
30 | // 设置是否开启error log日志功能
31 | func (s *Server) SetErrorLogEnabled(enabled bool) {
32 | s.config.ErrorLogEnabled = enabled
33 | }
34 |
35 | // 设置是否开启error stack打印功能
36 | func (s *Server) SetErrorStack(enabled bool) {
37 | s.config.ErrorStack = enabled
38 | }
39 |
40 | // 获取日志目录
41 | func (s *Server) GetLogPath() string {
42 | return s.config.LogPath
43 | }
44 |
45 | // access log日志功能是否开启
46 | func (s *Server) IsAccessLogEnabled() bool {
47 | return s.config.AccessLogEnabled
48 | }
49 |
50 | // error log日志功能是否开启
51 | func (s *Server) IsErrorLogEnabled() bool {
52 | return s.config.ErrorLogEnabled
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_config_mess.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | func (s *Server) SetGzipContentTypes(types []string) {
10 | s.config.GzipContentTypes = types
11 | }
12 |
13 | // 服务注册时对象和方法名称转换为URI时的规则
14 | func (s *Server) SetNameToUriType(t int) {
15 | s.config.NameToUriType = t
16 | }
17 |
18 | // 是否在程序启动时打印路由表信息
19 | func (s *Server) SetDumpRouteMap(enabled bool) {
20 | s.config.DumpRouteMap = enabled
21 | }
22 |
23 | // 设置路由缓存过期时间(秒)
24 | func (s *Server) SetRouterCacheExpire(expire int) {
25 | s.config.RouterCacheExpire = expire
26 | }
27 |
28 | func (s *Server) SetFormParsingMemory(maxMemory int64) {
29 | s.config.FormParsingMemory = maxMemory
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_config_route.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | func (s *Server) SetDenyIps(ips []string) {
10 | s.config.DenyIps = ips
11 | }
12 |
13 | func (s *Server) SetAllowIps(ips []string) {
14 | s.config.AllowIps = ips
15 | }
16 |
17 | func (s *Server) SetDenyRoutes(routes []string) {
18 | s.config.DenyRoutes = routes
19 | }
20 |
21 | // 设置URI重写规则
22 | func (s *Server) SetRewrite(uri string, rewrite string) {
23 | s.config.Rewrites[uri] = rewrite
24 | }
25 |
26 | // 设置URI重写规则(批量)
27 | func (s *Server) SetRewriteMap(rewrites map[string]string) {
28 | for k, v := range rewrites {
29 | s.config.Rewrites[k] = v
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_config_session.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "time"
11 |
12 | "github.com/gogf/gf/os/gsession"
13 | )
14 |
15 | // 设置http server参数 - SessionMaxAge
16 | func (s *Server) SetSessionMaxAge(ttl time.Duration) {
17 | s.config.SessionMaxAge = ttl
18 | }
19 |
20 | // 设置http server参数 - SessionIdName
21 | func (s *Server) SetSessionIdName(name string) {
22 | s.config.SessionIdName = name
23 | }
24 |
25 | // 设置http server参数 - SessionStorage
26 | func (s *Server) SetSessionStorage(storage gsession.Storage) {
27 | s.config.SessionStorage = storage
28 | }
29 |
30 | // 获取http server参数 - SessionMaxAge
31 | func (s *Server) GetSessionMaxAge() time.Duration {
32 | return s.config.SessionMaxAge
33 | }
34 |
35 | // 获取http server参数 - SessionIdName
36 | func (s *Server) GetSessionIdName() string {
37 | return s.config.SessionIdName
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_error_logger.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "bytes"
11 | "github.com/gogf/gf/os/glog"
12 | )
13 |
14 | // errorLogger is the error logging logger for underlying net/http.Server.
15 | type errorLogger struct {
16 | logger *glog.Logger
17 | }
18 |
19 | // Write implements the io.Writer interface.
20 | func (l *errorLogger) Write(p []byte) (n int, err error) {
21 | l.logger.Skip(1).Error(string(bytes.TrimRight(p, "\r\n")))
22 | return len(p), nil
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_router_middleware.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import (
10 | "reflect"
11 | "runtime"
12 | )
13 |
14 | const (
15 | gDEFAULT_MIDDLEWARE_PATTERN = "/*"
16 | )
17 |
18 | // 注册中间件,绑定到指定的路由规则上,中间件参数支持多个。
19 | func (s *Server) BindMiddleware(pattern string, handlers ...HandlerFunc) {
20 | for _, handler := range handlers {
21 | s.setHandler(pattern, &handlerItem{
22 | itemType: gHANDLER_TYPE_MIDDLEWARE,
23 | itemName: runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name(),
24 | itemFunc: handler,
25 | })
26 | }
27 | }
28 |
29 | // 注册中间件,绑定到全局路由规则("/*")上,中间件参数支持多个。
30 | func (s *Server) BindMiddlewareDefault(handlers ...HandlerFunc) {
31 | for _, handler := range handlers {
32 | s.setHandler(gDEFAULT_MIDDLEWARE_PATTERN, &handlerItem{
33 | itemType: gHANDLER_TYPE_MIDDLEWARE,
34 | itemName: runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name(),
35 | itemFunc: handler,
36 | })
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_session.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import "github.com/gogf/gf/os/gsession"
10 |
11 | type Session = gsession.Session
12 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_status.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 | // 状态码回调函数注册.
7 |
8 | package ghttp
9 |
10 | import (
11 | "fmt"
12 | )
13 |
14 | // 查询状态码回调函数
15 | func (s *Server) getStatusHandler(status int, r *Request) HandlerFunc {
16 | domains := []string{r.GetHost(), gDEFAULT_DOMAIN}
17 | for _, domain := range domains {
18 | if f, ok := s.statusHandlerMap[s.statusHandlerKey(status, domain)]; ok {
19 | return f
20 | }
21 | }
22 | return nil
23 | }
24 |
25 | // 不同状态码下的回调方法处理
26 | // pattern格式:domain#status
27 | func (s *Server) setStatusHandler(pattern string, handler HandlerFunc) {
28 | s.statusHandlerMap[pattern] = handler
29 | }
30 |
31 | // 生成状态码回调函数map存储键名
32 | func (s *Server) statusHandlerKey(status int, domain string) string {
33 | return fmt.Sprintf("%s#%d", domain, status)
34 | }
35 |
36 | // 绑定指定的状态码回调函数
37 | func (s *Server) BindStatusHandler(status int, handler HandlerFunc) {
38 | s.setStatusHandler(s.statusHandlerKey(status, gDEFAULT_DOMAIN), handler)
39 | }
40 |
41 | // 通过map批量绑定状态码回调函数
42 | func (s *Server) BindStatusHandlerByMap(handlerMap map[int]HandlerFunc) {
43 | for k, v := range handlerMap {
44 | s.BindStatusHandler(k, v)
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/ghttp/ghttp_server_websocket.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package ghttp
8 |
9 | import "github.com/gorilla/websocket"
10 |
11 | type WebSocket struct {
12 | *websocket.Conn
13 | }
14 |
15 | const (
16 | // TextMessage denotes a text data message. The text message payload is
17 | // interpreted as UTF-8 encoded text data.
18 | WS_MSG_TEXT = websocket.TextMessage
19 |
20 | // BinaryMessage denotes a binary data message.
21 | WS_MSG_BINARY = websocket.BinaryMessage
22 |
23 | // CloseMessage denotes a close control message. The optional message
24 | // payload contains a numeric code and text. Use the FormatCloseMessage
25 | // function to format a close message payload.
26 | WS_MSG_CLOSE = websocket.CloseMessage
27 |
28 | // PingMessage denotes a ping control message. The optional message payload
29 | // is UTF-8 encoded text.
30 | WS_MSG_PING = websocket.PingMessage
31 |
32 | // PongMessage denotes a pong control message. The optional message payload
33 | // is UTF-8 encoded text.
34 | WS_MSG_PONG = websocket.PongMessage
35 | )
36 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/gtcp/gtcp.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gtcp provides TCP server and client implementations.
8 | package gtcp
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/net/gudp/gudp.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gtcp provides UDP server and client implementations.
8 | package gudp
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gcache/gcache_cache.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gcache
8 |
9 | import (
10 | "sync/atomic"
11 | "time"
12 | "unsafe"
13 |
14 | "github.com/gogf/gf/os/gtimer"
15 | )
16 |
17 | // Cache struct.
18 | type Cache struct {
19 | *memCache
20 | }
21 |
22 | // New creates and returns a new cache object.
23 | func New(lruCap ...int) *Cache {
24 | c := &Cache{
25 | memCache: newMemCache(lruCap...),
26 | }
27 | gtimer.AddSingleton(time.Second, c.syncEventAndClearExpired)
28 | return c
29 | }
30 |
31 | // Clear clears all data of the cache.
32 | func (c *Cache) Clear() {
33 | // atomic swap to ensure atomicity.
34 | old := atomic.SwapPointer((*unsafe.Pointer)(unsafe.Pointer(&c.memCache)), unsafe.Pointer(newMemCache()))
35 | // close the old cache object.
36 | (*memCache)(old).Close()
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gcache/gcache_mem_cache_item.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gcache
8 |
9 | import (
10 | "github.com/gogf/gf/os/gtime"
11 | )
12 |
13 | // IsExpired checks whether - is expired.
14 | func (item *memCacheItem) IsExpired() bool {
15 | // Note that it should use greater than or equal judgement here
16 | // imagining that the cache time is only 1 millisecond.
17 | if item.e >= gtime.Millisecond() {
18 | return false
19 | }
20 | return true
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gcfg/gcfg_error.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gcfg
8 |
9 | import (
10 | "github.com/gogf/gf/internal/cmdenv"
11 | )
12 |
13 | const (
14 | // gERROR_PRINT_KEY is used to specify the key controlling error printing to stdout.
15 | // This error is designed not to be returned by functions.
16 | gERROR_PRINT_KEY = "gf.gcfg.errorprint"
17 | )
18 |
19 | // errorPrint checks whether printing error to stdout.
20 | func errorPrint() bool {
21 | return cmdenv.Get(gERROR_PRINT_KEY, true).Bool()
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gcfg/gcfg_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gcfg
8 |
9 | import (
10 | "github.com/gogf/gf/container/gmap"
11 | )
12 |
13 | const (
14 | // Default group name for instance usage.
15 | DEFAULT_NAME = "default"
16 | )
17 |
18 | var (
19 | // Instances map.
20 | instances = gmap.NewStrAnyMap(true)
21 | )
22 |
23 | // Instance returns an instance of Config with default settings.
24 | // The parameter is the name for the instance.
25 | func Instance(name ...string) *Config {
26 | key := DEFAULT_NAME
27 | if len(name) > 0 && name[0] != "" {
28 | key = name[0]
29 | }
30 | return instances.GetOrSetFuncLock(key, func() interface{} {
31 | return New()
32 | }).(*Config)
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gfile/gfile_sort.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017-2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gfile
8 |
9 | import (
10 | "strings"
11 |
12 | "github.com/gogf/gf/container/garray"
13 | )
14 |
15 | // fileSortFunc is the comparison function for files.
16 | // It sorts the array in order of: directory -> file.
17 | // If and are the same type, it then sorts them as strings.
18 | func fileSortFunc(path1, path2 string) int {
19 | isDirPath1 := IsDir(path1)
20 | isDirPath2 := IsDir(path2)
21 | if isDirPath1 && !isDirPath2 {
22 | return -1
23 | }
24 | if !isDirPath1 && isDirPath2 {
25 | return 1
26 | }
27 | if n := strings.Compare(path1, path2); n != 0 {
28 | return n
29 | } else {
30 | return -1
31 | }
32 | }
33 |
34 | // SortFiles sorts the in order of: directory -> file.
35 | // Note that the item of should be absolute path.
36 | func SortFiles(files []string) []string {
37 | array := garray.NewSortedStrArrayComparator(fileSortFunc)
38 | array.Add(files...)
39 | return array.Slice()
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gfile/gfile_time.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017-2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gfile
8 |
9 | import (
10 | "os"
11 | )
12 |
13 | // MTime returns the modification time of file given by in second.
14 | func MTime(path string) int64 {
15 | s, e := os.Stat(path)
16 | if e != nil {
17 | return 0
18 | }
19 | return s.ModTime().Unix()
20 | }
21 |
22 | // MTimeMillisecond returns the modification time of file given by in millisecond.
23 | func MTimeMillisecond(path string) int64 {
24 | s, e := os.Stat(path)
25 | if e != nil {
26 | return 0
27 | }
28 | return int64(s.ModTime().Nanosecond() / 1000000)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gfsnotify/gfsnotify_event.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // ThIs Source Code Form Is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not dIstributed with thIs file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gfsnotify
8 |
9 | // String returns current event as string.
10 | func (e *Event) String() string {
11 | return e.event.String()
12 | }
13 |
14 | // IsCreate checks whether current event contains file/folder create event.
15 | func (e *Event) IsCreate() bool {
16 | return e.Op == 1 || e.Op&CREATE == CREATE
17 | }
18 |
19 | // IsWrite checks whether current event contains file/folder write event.
20 | func (e *Event) IsWrite() bool {
21 | return e.Op&WRITE == WRITE
22 | }
23 |
24 | // IsRemove checks whether current event contains file/folder remove event.
25 | func (e *Event) IsRemove() bool {
26 | return e.Op&REMOVE == REMOVE
27 | }
28 |
29 | // IsRename checks whether current event contains file/folder rename event.
30 | func (e *Event) IsRename() bool {
31 | return e.Op&RENAME == RENAME
32 | }
33 |
34 | // IsChmod checks whether current event contains file/folder chmod event.
35 | func (e *Event) IsChmod() bool {
36 | return e.Op&CHMOD == CHMOD
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/glog/glog_config.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package glog
8 |
9 | // SetConfig set configurations for the logger.
10 | func SetConfig(config Config) error {
11 | return logger.SetConfig(config)
12 | }
13 |
14 | // SetConfigWithMap set configurations with map for the logger.
15 | func SetConfigWithMap(m map[string]interface{}) error {
16 | return logger.SetConfigWithMap(m)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/glog/glog_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package glog
8 |
9 | import "github.com/gogf/gf/container/gmap"
10 |
11 | const (
12 | // Default group name for instance usage.
13 | DEFAULT_NAME = "default"
14 | )
15 |
16 | var (
17 | // Instances map.
18 | instances = gmap.NewStrAnyMap(true)
19 | )
20 |
21 | // Instance returns an instance of Logger with default settings.
22 | // The parameter is the name for the instance.
23 | func Instance(name ...string) *Logger {
24 | key := DEFAULT_NAME
25 | if len(name) > 0 && name[0] != "" {
26 | key = name[0]
27 | }
28 | return instances.GetOrSetFuncLock(key, func() interface{} {
29 | return New()
30 | }).(*Logger)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/glog/glog_logger_writer.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package glog
8 |
9 | import "bytes"
10 |
11 | // Write implements the io.Writer interface.
12 | // It just prints the content using Print.
13 | func (l *Logger) Write(p []byte) (n int, err error) {
14 | l.Header(false).Print(string(bytes.TrimRight(p, "\r\n")))
15 | return len(p), nil
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gproc/gproc_comm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 | // "不要通过共享内存来通信,而应该通过通信来共享内存"
7 |
8 | package gproc
9 |
10 | import (
11 | "os"
12 |
13 | "github.com/gogf/gf/container/gmap"
14 | "github.com/gogf/gf/os/gfile"
15 | "github.com/gogf/gf/util/gconv"
16 | )
17 |
18 | // 进程通信数据结构
19 | type Msg struct {
20 | SendPid int `json:"spid"` // 发送进程ID
21 | RecvPid int `json:"rpid"` // 接收进程ID
22 | Group string `json:"group"` // 分组名称
23 | Data []byte `json:"data"` // 原始数据
24 | }
25 |
26 | // 本地进程通信接收消息队列(按照分组进行构建的map,键值为*gqueue.Queue对象)
27 | var commReceiveQueues = gmap.NewStrAnyMap(true)
28 |
29 | // (用于发送)已建立的PID对应的Conn通信对象,键值为一个Pool,防止并行使用同一个通信对象造成数据重叠
30 | var commPidConnMap = gmap.NewIntAnyMap(true)
31 |
32 | // 获取指定进程的通信文件地址
33 | func getCommFilePath(pid int) string {
34 | return getCommDirPath() + gfile.Separator + gconv.String(pid)
35 | }
36 |
37 | // 获取进程间通信目录地址
38 | func getCommDirPath() string {
39 | tempDir := os.Getenv(gPROC_TEMP_DIR_ENV_KEY)
40 | if tempDir == "" {
41 | tempDir = gfile.TempDir()
42 | }
43 | return tempDir + gfile.Separator + "gproc"
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gres/gres_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gres
8 |
9 | import "github.com/gogf/gf/container/gmap"
10 |
11 | const (
12 | // Default group name for instance usage.
13 | DEFAULT_NAME = "default"
14 | )
15 |
16 | var (
17 | // Instances map.
18 | instances = gmap.NewStrAnyMap(true)
19 | )
20 |
21 | // Instance returns an instance of Resource.
22 | // The parameter is the name for the instance.
23 | func Instance(name ...string) *Resource {
24 | key := DEFAULT_NAME
25 | if len(name) > 0 && name[0] != "" {
26 | key = name[0]
27 | }
28 | return instances.GetOrSetFuncLock(key, func() interface{} {
29 | return New()
30 | }).(*Resource)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gsession/gsession.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gsession implements manager and storage features for sessions.
8 | package gsession
9 |
10 | import (
11 | "errors"
12 | "strconv"
13 | "strings"
14 |
15 | "github.com/gogf/gf/os/gtime"
16 | "github.com/gogf/gf/util/grand"
17 | )
18 |
19 | var (
20 | ErrorDisabled = errors.New("this feature is disabled in this storage")
21 | )
22 |
23 | // NewSessionId creates and returns a new and unique session id string,
24 | // the length of which is 18 bytes.
25 | func NewSessionId() string {
26 | return strings.ToUpper(strconv.FormatInt(gtime.Nanosecond(), 36) + grand.Str(6))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gview/gview_error.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gview
8 |
9 | import (
10 | "github.com/gogf/gf/internal/cmdenv"
11 | )
12 |
13 | const (
14 | // gERROR_PRINT_KEY is used to specify the key controlling error printing to stdout.
15 | // This error is designed not to be returned by functions.
16 | gERROR_PRINT_KEY = "gf.gview.errorprint"
17 | )
18 |
19 | // errorPrint checks whether printing error to stdout.
20 | func errorPrint() bool {
21 | return cmdenv.Get(gERROR_PRINT_KEY, true).Bool()
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gview/gview_i18n.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gview
8 |
9 | import "github.com/gogf/gf/util/gconv"
10 |
11 | // i18nTranslate translate the content with i18n feature.
12 | func (view *View) i18nTranslate(content string, params Params) string {
13 | if view.i18nManager != nil {
14 | if v, ok := params["I18nLanguage"]; ok {
15 | language := gconv.String(v)
16 | if language != "" {
17 | return view.i18nManager.T(content, language)
18 | }
19 | }
20 | return view.i18nManager.T(content)
21 | }
22 | return content
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/os/gview/gview_instance.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gview
8 |
9 | import "github.com/gogf/gf/container/gmap"
10 |
11 | const (
12 | // Default group name for instance usage.
13 | DEFAULT_NAME = "default"
14 | )
15 |
16 | var (
17 | // Instances map.
18 | instances = gmap.NewStrAnyMap(true)
19 | )
20 |
21 | // Instance returns an instance of View with default settings.
22 | // The parameter is the name for the instance.
23 | func Instance(name ...string) *View {
24 | key := DEFAULT_NAME
25 | if len(name) > 0 && name[0] != "" {
26 | key = name[0]
27 | }
28 | return instances.GetOrSetFuncLock(key, func() interface{} {
29 | return New()
30 | }).(*View)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/text/gstr/gstr_domain.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gstr
8 |
9 | import "strings"
10 |
11 | // IsSubDomain checks whether is sub-domain of mainDomain.
12 | // It supports '*' in .
13 | func IsSubDomain(subDomain string, mainDomain string) bool {
14 | if p := strings.IndexByte(subDomain, ':'); p != -1 {
15 | subDomain = subDomain[0:p]
16 | }
17 | if p := strings.IndexByte(mainDomain, ':'); p != -1 {
18 | mainDomain = mainDomain[0:p]
19 | }
20 | subArray := strings.Split(subDomain, ".")
21 | mainArray := strings.Split(mainDomain, ".")
22 | subLength := len(subArray)
23 | mainLength := len(mainArray)
24 | // Eg:
25 | // "s.s.goframe.org" is not sub-domain of "*.goframe.org"
26 | // but
27 | // "s.s.goframe.org" is not sub-domain of "goframe.org"
28 | if mainLength > 2 && subLength > mainLength {
29 | return false
30 | }
31 | minLength := subLength
32 | if mainLength < minLength {
33 | minLength = mainLength
34 | }
35 | for i := minLength; i > 0; i-- {
36 | if mainArray[mainLength-i] == "*" {
37 | continue
38 | }
39 | if mainArray[mainLength-i] != subArray[subLength-i] {
40 | return false
41 | }
42 | }
43 | return true
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/util/gconv/gconv_unsafe.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | package gconv
8 |
9 | import "unsafe"
10 |
11 | // UnsafeStrToBytes converts string to []byte without memory copy.
12 | // Note that, if you completely sure you will never use
in the feature,
13 | // you can use this unsafe function to implement type conversion in high performance.
14 | func UnsafeStrToBytes(s string) []byte {
15 | return *(*[]byte)(unsafe.Pointer(&s))
16 | }
17 |
18 | // UnsafeBytesToStr converts []byte to string without memory copy.
19 | // Note that, if you completely sure you will never use in the feature,
20 | // you can use this unsafe function to implement type conversion in high performance.
21 | func UnsafeBytesToStr(b []byte) string {
22 | return *(*string)(unsafe.Pointer(&b))
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/util/gutil/gutil_map.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
2 | //
3 | // This Source Code Form is subject to the terms of the MIT License.
4 | // If a copy of the MIT was not distributed with this file,
5 | // You can obtain one at https://github.com/gogf/gf.
6 |
7 | // Package gutil provides utility functions.
8 | package gutil
9 |
10 | import (
11 | "regexp"
12 | "strings"
13 | )
14 |
15 | var (
16 | // replaceCharReg is the regular expression object for replacing chars in map keys.
17 | replaceCharReg, _ = regexp.Compile(`[\-\.\_\s]+`)
18 | )
19 |
20 | // MapCopy does memory from map to .
21 | func MapCopy(data map[string]interface{}) (copy map[string]interface{}) {
22 | copy = make(map[string]interface{}, len(data))
23 | for k, v := range data {
24 | copy[k] = v
25 | }
26 | return
27 | }
28 |
29 | // MapValueForPossibleKey tries to find the possible value for given key with or without
30 | // cases or chars '-'/'_'/'.'/' '.
31 | //
32 | // Note that this function might be of low performance.
33 | func MapPossibleValueForKey(data map[string]interface{}, key string) interface{} {
34 | if v, ok := data[key]; ok {
35 | return v
36 | }
37 | replacedKey := replaceCharReg.ReplaceAllString(key, "")
38 | if v, ok := data[replacedKey]; ok {
39 | return v
40 | }
41 | // Loop for check.
42 | for k, v := range data {
43 | if strings.EqualFold(replaceCharReg.ReplaceAllString(k, ""), replacedKey) {
44 | return v
45 | }
46 | }
47 | return nil
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/gogf/gf/version.go:
--------------------------------------------------------------------------------
1 | package gf
2 |
3 | const VERSION = "v1.9.10"
4 | const AUTHORS = "john"
5 |
--------------------------------------------------------------------------------
/vendor/github.com/gomodule/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 |
--------------------------------------------------------------------------------
/vendor/github.com/gomodule/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/gorilla/websocket/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of Gorilla WebSocket authors for copyright
2 | # purposes.
3 | #
4 | # Please keep the list sorted.
5 |
6 | Gary Burd
7 | Google LLC (https://opensource.google.com/)
8 | Joachim Bauch
9 |
10 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 The Gorilla WebSocket 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 met:
5 |
6 | Redistributions of source code must retain the above copyright notice, this
7 | list of conditions and the following disclaimer.
8 |
9 | Redistributions in binary form must reproduce the above copyright notice,
10 | this list of conditions and the following disclaimer in the documentation
11 | and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/client_clone.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket 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 go1.8
6 |
7 | package websocket
8 |
9 | import "crypto/tls"
10 |
11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config {
12 | if cfg == nil {
13 | return &tls.Config{}
14 | }
15 | return cfg.Clone()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/client_clone_legacy.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Gorilla WebSocket 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 !go1.8
6 |
7 | package websocket
8 |
9 | import "crypto/tls"
10 |
11 | // cloneTLSConfig clones all public fields except the fields
12 | // SessionTicketsDisabled and SessionTicketKey. This avoids copying the
13 | // sync.Mutex in the sync.Once and makes it safe to call cloneTLSConfig on a
14 | // config in active use.
15 | func cloneTLSConfig(cfg *tls.Config) *tls.Config {
16 | if cfg == nil {
17 | return &tls.Config{}
18 | }
19 | return &tls.Config{
20 | Rand: cfg.Rand,
21 | Time: cfg.Time,
22 | Certificates: cfg.Certificates,
23 | NameToCertificate: cfg.NameToCertificate,
24 | GetCertificate: cfg.GetCertificate,
25 | RootCAs: cfg.RootCAs,
26 | NextProtos: cfg.NextProtos,
27 | ServerName: cfg.ServerName,
28 | ClientAuth: cfg.ClientAuth,
29 | ClientCAs: cfg.ClientCAs,
30 | InsecureSkipVerify: cfg.InsecureSkipVerify,
31 | CipherSuites: cfg.CipherSuites,
32 | PreferServerCipherSuites: cfg.PreferServerCipherSuites,
33 | ClientSessionCache: cfg.ClientSessionCache,
34 | MinVersion: cfg.MinVersion,
35 | MaxVersion: cfg.MaxVersion,
36 | CurvePreferences: cfg.CurvePreferences,
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/conn_write.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket 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 go1.8
6 |
7 | package websocket
8 |
9 | import "net"
10 |
11 | func (c *Conn) writeBufs(bufs ...[]byte) error {
12 | b := net.Buffers(bufs)
13 | _, err := b.WriteTo(c.conn)
14 | return err
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/conn_write_legacy.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket 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 !go1.8
6 |
7 | package websocket
8 |
9 | func (c *Conn) writeBufs(bufs ...[]byte) error {
10 | for _, buf := range bufs {
11 | if len(buf) > 0 {
12 | if _, err := c.conn.Write(buf); err != nil {
13 | return err
14 | }
15 | }
16 | }
17 | return nil
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/gorilla/websocket
2 |
3 | go 1.12
4 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/go.sum:
--------------------------------------------------------------------------------
1 | github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
2 | github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
3 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/join.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Gorilla WebSocket Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package websocket
6 |
7 | import (
8 | "io"
9 | "strings"
10 | )
11 |
12 | // JoinMessages concatenates received messages to create a single io.Reader.
13 | // The string term is appended to each message. The returned reader does not
14 | // support concurrent calls to the Read method.
15 | func JoinMessages(c *Conn, term string) io.Reader {
16 | return &joinReader{c: c, term: term}
17 | }
18 |
19 | type joinReader struct {
20 | c *Conn
21 | term string
22 | r io.Reader
23 | }
24 |
25 | func (r *joinReader) Read(p []byte) (int, error) {
26 | if r.r == nil {
27 | var err error
28 | _, r.r, err = r.c.NextReader()
29 | if err != nil {
30 | return 0, err
31 | }
32 | if r.term != "" {
33 | r.r = io.MultiReader(r.r, strings.NewReader(r.term))
34 | }
35 | }
36 | n, err := r.r.Read(p)
37 | if err == io.EOF {
38 | err = nil
39 | r.r = nil
40 | }
41 | return n, err
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/mask.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
2 | // this source code is governed by a BSD-style license that can be found in the
3 | // LICENSE file.
4 |
5 | // +build !appengine
6 |
7 | package websocket
8 |
9 | import "unsafe"
10 |
11 | const wordSize = int(unsafe.Sizeof(uintptr(0)))
12 |
13 | func maskBytes(key [4]byte, pos int, b []byte) int {
14 | // Mask one byte at a time for small buffers.
15 | if len(b) < 2*wordSize {
16 | for i := range b {
17 | b[i] ^= key[pos&3]
18 | pos++
19 | }
20 | return pos & 3
21 | }
22 |
23 | // Mask one byte at a time to word boundary.
24 | if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 {
25 | n = wordSize - n
26 | for i := range b[:n] {
27 | b[i] ^= key[pos&3]
28 | pos++
29 | }
30 | b = b[n:]
31 | }
32 |
33 | // Create aligned word size key.
34 | var k [wordSize]byte
35 | for i := range k {
36 | k[i] = key[(pos+i)&3]
37 | }
38 | kw := *(*uintptr)(unsafe.Pointer(&k))
39 |
40 | // Mask one word at a time.
41 | n := (len(b) / wordSize) * wordSize
42 | for i := 0; i < n; i += wordSize {
43 | *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw
44 | }
45 |
46 | // Mask one byte at a time for remaining bytes.
47 | b = b[n:]
48 | for i := range b {
49 | b[i] ^= key[pos&3]
50 | pos++
51 | }
52 |
53 | return pos & 3
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/mask_safe.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of
2 | // this source code is governed by a BSD-style license that can be found in the
3 | // LICENSE file.
4 |
5 | // +build appengine
6 |
7 | package websocket
8 |
9 | func maskBytes(key [4]byte, pos int, b []byte) int {
10 | for i := range b {
11 | b[i] ^= key[pos&3]
12 | pos++
13 | }
14 | return pos & 3
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/trace.go:
--------------------------------------------------------------------------------
1 | // +build go1.8
2 |
3 | package websocket
4 |
5 | import (
6 | "crypto/tls"
7 | "net/http/httptrace"
8 | )
9 |
10 | func doHandshakeWithTrace(trace *httptrace.ClientTrace, tlsConn *tls.Conn, cfg *tls.Config) error {
11 | if trace.TLSHandshakeStart != nil {
12 | trace.TLSHandshakeStart()
13 | }
14 | err := doHandshake(tlsConn, cfg)
15 | if trace.TLSHandshakeDone != nil {
16 | trace.TLSHandshakeDone(tlsConn.ConnectionState(), err)
17 | }
18 | return err
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/websocket/trace_17.go:
--------------------------------------------------------------------------------
1 | // +build !go1.8
2 |
3 | package websocket
4 |
5 | import (
6 | "crypto/tls"
7 | "net/http/httptrace"
8 | )
9 |
10 | func doHandshakeWithTrace(trace *httptrace.ClientTrace, tlsConn *tls.Conn, cfg *tls.Config) error {
11 | return doHandshake(tlsConn, cfg)
12 | }
13 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/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_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/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/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/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 |
--------------------------------------------------------------------------------
/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/json-iterator/go/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/json-iterator/go
2 |
3 | go 1.12
4 |
5 | require (
6 | github.com/davecgh/go-spew v1.1.1
7 | github.com/google/gofuzz v1.0.0
8 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
9 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
10 | github.com/stretchr/testify v1.3.0
11 | )
12 |
--------------------------------------------------------------------------------
/vendor/github.com/json-iterator/go/go.sum:
--------------------------------------------------------------------------------
1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4 | github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
5 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
6 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
7 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
8 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
9 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
10 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
11 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
12 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
13 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
14 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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 |
--------------------------------------------------------------------------------
/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/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/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/modern-go/reflect2/reflect2_amd64.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/reflect2_amd64.s
--------------------------------------------------------------------------------
/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/modern-go/reflect2/relfect2_386.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_386.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_arm.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_arm64.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_arm64.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s
--------------------------------------------------------------------------------
/vendor/github.com/modern-go/reflect2/relfect2_s390x.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/litterGuy/ngrinder-sampling/0533ba67b33a32e302008e4194cab2c152a31232/vendor/github.com/modern-go/reflect2/relfect2_s390x.s
--------------------------------------------------------------------------------
/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/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/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/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/olekukonko/tablewriter/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (C) 2014 by Oleku Konko
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/github.com/olekukonko/tablewriter/csv.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Oleku Konko All rights reserved.
2 | // Use of this source code is governed by a MIT
3 | // license that can be found in the LICENSE file.
4 |
5 | // This module is a Table Writer API for the Go Programming Language.
6 | // The protocols were written in pure Go and works on windows and unix systems
7 |
8 | package tablewriter
9 |
10 | import (
11 | "encoding/csv"
12 | "io"
13 | "os"
14 | )
15 |
16 | // Start A new table by importing from a CSV file
17 | // Takes io.Writer and csv File name
18 | func NewCSV(writer io.Writer, fileName string, hasHeader bool) (*Table, error) {
19 | file, err := os.Open(fileName)
20 | if err != nil {
21 | return &Table{}, err
22 | }
23 | defer file.Close()
24 | csvReader := csv.NewReader(file)
25 | t, err := NewCSVReader(writer, csvReader, hasHeader)
26 | return t, err
27 | }
28 |
29 | // Start a New Table Writer with csv.Reader
30 | // This enables customisation such as reader.Comma = ';'
31 | // See http://golang.org/src/pkg/encoding/csv/reader.go?s=3213:3671#L94
32 | func NewCSVReader(writer io.Writer, csvReader *csv.Reader, hasHeader bool) (*Table, error) {
33 | t := NewWriter(writer)
34 | if hasHeader {
35 | // Read the first row
36 | headers, err := csvReader.Read()
37 | if err != nil {
38 | return &Table{}, err
39 | }
40 | t.SetHeader(headers)
41 | }
42 | for {
43 | record, err := csvReader.Read()
44 | if err == io.EOF {
45 | break
46 | } else if err != nil {
47 | return &Table{}, err
48 | }
49 | t.Append(record)
50 | }
51 | return t, nil
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/github.com/olekukonko/tablewriter/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/olekukonko/tablewriter
2 |
3 | go 1.12
4 |
5 | require github.com/mattn/go-runewidth v0.0.6
6 |
--------------------------------------------------------------------------------
/vendor/github.com/olekukonko/tablewriter/go.sum:
--------------------------------------------------------------------------------
1 | github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
2 | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
3 | github.com/mattn/go-runewidth v0.0.6 h1:V2iyH+aX9C5fsYCpK60U8BYIvmhqxuOL3JZcqc1NB7k=
4 | github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
5 | github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
6 | github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
7 |
--------------------------------------------------------------------------------
/vendor/github.com/shiena/ansicolor/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) [2014] [shiena]
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/shiena/ansicolor/ansicolor.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 shiena Authors. 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 ansicolor provides color console in Windows as ANSICON.
6 | package ansicolor
7 |
8 | import "io"
9 |
10 | type outputMode int
11 |
12 | // DiscardNonColorEscSeq supports the divided color escape sequence.
13 | // But non-color escape sequence is not output.
14 | // Please use the OutputNonColorEscSeq If you want to output a non-color
15 | // escape sequences such as ncurses. However, it does not support the divided
16 | // color escape sequence.
17 | const (
18 | _ outputMode = iota
19 | DiscardNonColorEscSeq
20 | OutputNonColorEscSeq
21 | )
22 |
23 | // NewAnsiColorWriter creates and initializes a new ansiColorWriter
24 | // using io.Writer w as its initial contents.
25 | // In the console of Windows, which change the foreground and background
26 | // colors of the text by the escape sequence.
27 | // In the console of other systems, which writes to w all text.
28 | func NewAnsiColorWriter(w io.Writer) io.Writer {
29 | return NewModeAnsiColorWriter(w, DiscardNonColorEscSeq)
30 | }
31 |
32 | // NewModeAnsiColorWriter create and initializes a new ansiColorWriter
33 | // by specifying the outputMode.
34 | func NewModeAnsiColorWriter(w io.Writer, mode outputMode) io.Writer {
35 | if _, ok := w.(*ansiColorWriter); !ok {
36 | return &ansiColorWriter{
37 | w: w,
38 | mode: mode,
39 | }
40 | }
41 | return w
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/github.com/shiena/ansicolor/ansicolor_ansi.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 shiena Authors. 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 !windows
6 |
7 | package ansicolor
8 |
9 | import "io"
10 |
11 | type ansiColorWriter struct {
12 | w io.Writer
13 | mode outputMode
14 | }
15 |
16 | func (cw *ansiColorWriter) Write(p []byte) (int, error) {
17 | return cw.w.Write(p)
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/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/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/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/views/preview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
请实时关注公告,以防出现使用问题
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{.announcement}}
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------