├── .gitignore ├── LICENSE ├── README.md ├── config.yaml ├── doc ├── IP开放高危服务表.png ├── brute.jpg ├── dashboard.png ├── install.md ├── key_dashboard.png ├── kibana.md └── wechat.jpg ├── ip.txt ├── ipExclude.txt ├── lib └── lib.go ├── main.go ├── models ├── brute.go ├── es.go ├── ip.go ├── masscan │ └── masscan.go ├── nmap │ └── nmap.go ├── notice.go ├── scan.go └── yaml.go ├── password.txt ├── plugins ├── ftp.go ├── ftp_test.go ├── mongodb.go ├── mongodb_test.go ├── mssql.go ├── mssql_test.go ├── mysql.go ├── mysql_test.go ├── plugins.go ├── postgres.go ├── postgres_test.go ├── redis.go ├── redis_test.go ├── ssh.go └── ssh_test.go ├── user.txt └── vendor ├── github.com ├── denisenkom │ └── go-mssqldb │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── batch │ │ ├── batch.go │ │ ├── batch_fuzz.go │ │ └── batch_test.go │ │ ├── buf.go │ │ ├── buf_test.go │ │ ├── bulkcopy.go │ │ ├── bulkcopy_sql.go │ │ ├── bulkcopy_test.go │ │ ├── bulkimport_example_test.go │ │ ├── conn_str.go │ │ ├── conn_str_test.go │ │ ├── convert.go │ │ ├── datetimeoffset_example_test.go │ │ ├── doc.go │ │ ├── doc │ │ ├── how-to-handle-date-and-time-types.md │ │ ├── how-to-perform-bulk-imports.md │ │ ├── how-to-use-applicatinintent-connection-property.md │ │ ├── how-to-use-newconnector.md │ │ └── how-to-use-table-valued-parameters.md │ │ ├── error.go │ │ ├── error_example_test.go │ │ ├── examples │ │ ├── bulk │ │ │ └── bulk.go │ │ ├── routine │ │ │ └── routine.go │ │ ├── simple │ │ │ └── simple.go │ │ ├── tsql │ │ │ └── tsql.go │ │ └── tvp │ │ │ └── tvp.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── internal │ │ ├── cp │ │ │ ├── charset.go │ │ │ ├── collation.go │ │ │ ├── cp1250.go │ │ │ ├── cp1251.go │ │ │ ├── cp1252.go │ │ │ ├── cp1253.go │ │ │ ├── cp1254.go │ │ │ ├── cp1255.go │ │ │ ├── cp1256.go │ │ │ ├── cp1257.go │ │ │ ├── cp1258.go │ │ │ ├── cp437.go │ │ │ ├── cp850.go │ │ │ ├── cp874.go │ │ │ ├── cp932.go │ │ │ ├── cp936.go │ │ │ ├── cp949.go │ │ │ └── cp950.go │ │ ├── decimal │ │ │ ├── decimal.go │ │ │ └── decimal_test.go │ │ └── querytext │ │ │ ├── parser.go │ │ │ └── parser_test.go │ │ ├── lastinsertid_example_test.go │ │ ├── log.go │ │ ├── mssql.go │ │ ├── mssql_go110.go │ │ ├── mssql_go110pre.go │ │ ├── mssql_go19.go │ │ ├── mssql_go19pre.go │ │ ├── mssql_test.go │ │ ├── net.go │ │ ├── newconnector_example_test.go │ │ ├── ntlm.go │ │ ├── ntlm_test.go │ │ ├── queries_go110_test.go │ │ ├── queries_go110pre_test.go │ │ ├── queries_go19_test.go │ │ ├── queries_test.go │ │ ├── rpc.go │ │ ├── sspi_windows.go │ │ ├── tds.go │ │ ├── tds_go110_test.go │ │ ├── tds_go110pre_test.go │ │ ├── tds_test.go │ │ ├── token.go │ │ ├── token_string.go │ │ ├── tran.go │ │ ├── tvp_example_test.go │ │ ├── tvp_go19.go │ │ ├── tvp_go19_db_test.go │ │ ├── tvp_go19_test.go │ │ ├── types.go │ │ ├── types_test.go │ │ ├── uniqueidentifier.go │ │ └── uniqueidentifier_test.go ├── go-redis │ └── redis │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── bench_test.go │ │ ├── cluster.go │ │ ├── cluster_commands.go │ │ ├── cluster_test.go │ │ ├── command.go │ │ ├── command_test.go │ │ ├── commands.go │ │ ├── commands_test.go │ │ ├── doc.go │ │ ├── example_instrumentation_test.go │ │ ├── example_test.go │ │ ├── export_test.go │ │ ├── internal │ │ ├── consistenthash │ │ │ ├── consistenthash.go │ │ │ └── consistenthash_test.go │ │ ├── error.go │ │ ├── hashtag │ │ │ ├── hashtag.go │ │ │ └── hashtag_test.go │ │ ├── internal.go │ │ ├── internal_test.go │ │ ├── log.go │ │ ├── once.go │ │ ├── pool │ │ │ ├── bench_test.go │ │ │ ├── conn.go │ │ │ ├── main_test.go │ │ │ ├── pool.go │ │ │ ├── pool_single.go │ │ │ ├── pool_sticky.go │ │ │ └── pool_test.go │ │ ├── proto │ │ │ ├── proto_test.go │ │ │ ├── reader.go │ │ │ ├── reader_test.go │ │ │ ├── scan.go │ │ │ ├── scan_test.go │ │ │ ├── write_buffer_test.go │ │ │ └── writer.go │ │ ├── util.go │ │ └── util │ │ │ ├── safe.go │ │ │ ├── strconv.go │ │ │ └── unsafe.go │ │ ├── internal_test.go │ │ ├── iterator.go │ │ ├── iterator_test.go │ │ ├── main_test.go │ │ ├── options.go │ │ ├── options_test.go │ │ ├── pipeline.go │ │ ├── pipeline_test.go │ │ ├── pool_test.go │ │ ├── pubsub.go │ │ ├── pubsub_test.go │ │ ├── race_test.go │ │ ├── redis.go │ │ ├── redis_test.go │ │ ├── result.go │ │ ├── ring.go │ │ ├── ring_test.go │ │ ├── script.go │ │ ├── sentinel.go │ │ ├── sentinel_test.go │ │ ├── testdata │ │ └── redis.conf │ │ ├── tx.go │ │ ├── tx_test.go │ │ ├── universal.go │ │ └── universal_test.go ├── go-sql-driver │ └── mysql │ │ ├── .github │ │ ├── CONTRIBUTING.md │ │ ├── ISSUE_TEMPLATE.md │ │ └── PULL_REQUEST_TEMPLATE.md │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── .travis │ │ ├── docker.cnf │ │ ├── gofmt.sh │ │ └── wait_mysql.sh │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── auth.go │ │ ├── auth_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── conncheck.go │ │ ├── conncheck_dummy.go │ │ ├── conncheck_test.go │ │ ├── connection.go │ │ ├── connection_test.go │ │ ├── connector.go │ │ ├── connector_test.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── driver_test.go │ │ ├── dsn.go │ │ ├── dsn_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── fields.go │ │ ├── go.mod │ │ ├── infile.go │ │ ├── nulltime.go │ │ ├── nulltime_go113.go │ │ ├── nulltime_legacy.go │ │ ├── nulltime_test.go │ │ ├── packets.go │ │ ├── packets_test.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── statement_test.go │ │ ├── transaction.go │ │ ├── utils.go │ │ └── utils_test.go ├── golang-sql │ └── civil │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ └── civil.go ├── jlaffaye │ └── ftp │ │ ├── LICENSE │ │ ├── README.md │ │ ├── client_test.go │ │ ├── conn_test.go │ │ ├── debug.go │ │ ├── ftp.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── parse.go │ │ ├── parse_test.go │ │ ├── scanner.go │ │ ├── scanner_test.go │ │ ├── status.go │ │ └── status_test.go ├── lair-framework │ └── go-nmap │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ └── nmap.go ├── lib │ └── pq │ │ ├── .gitignore │ │ ├── .travis.sh │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── TESTS.md │ │ ├── array.go │ │ ├── array_test.go │ │ ├── bench_test.go │ │ ├── buf.go │ │ ├── buf_test.go │ │ ├── certs │ │ ├── README │ │ ├── bogus_root.crt │ │ ├── postgresql.crt │ │ ├── postgresql.key │ │ ├── root.crt │ │ ├── server.crt │ │ └── server.key │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── conn_test.go │ │ ├── connector.go │ │ ├── connector_example_test.go │ │ ├── connector_test.go │ │ ├── copy.go │ │ ├── copy_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── error.go │ │ ├── example │ │ └── listen │ │ │ └── doc.go │ │ ├── go.mod │ │ ├── go18_test.go │ │ ├── go19_test.go │ │ ├── hstore │ │ ├── hstore.go │ │ └── hstore_test.go │ │ ├── issues_test.go │ │ ├── notify.go │ │ ├── notify_test.go │ │ ├── oid │ │ ├── doc.go │ │ ├── gen.go │ │ └── types.go │ │ ├── rows.go │ │ ├── rows_test.go │ │ ├── scram │ │ └── scram.go │ │ ├── ssl.go │ │ ├── ssl_permissions.go │ │ ├── ssl_test.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── url_test.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ ├── uuid.go │ │ └── uuid_test.go ├── mailru │ └── easyjson │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── benchmark │ │ ├── Makefile │ │ ├── codec_test.go │ │ ├── data.go │ │ ├── data_codec.go │ │ ├── data_ffjson.go │ │ ├── data_var.go │ │ ├── default_test.go │ │ ├── dummy_test.go │ │ ├── easyjson_test.go │ │ ├── example.json │ │ ├── ffjson_test.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── jsoniter_test.go │ │ ├── tools.go │ │ └── ujson.sh │ │ ├── bootstrap │ │ └── bootstrap.go │ │ ├── buffer │ │ ├── pool.go │ │ └── pool_test.go │ │ ├── easyjson │ │ └── main.go │ │ ├── gen │ │ ├── decoder.go │ │ ├── encoder.go │ │ ├── generator.go │ │ └── generator_test.go │ │ ├── go.mod │ │ ├── helpers.go │ │ ├── jlexer │ │ ├── bytestostr.go │ │ ├── bytestostr_nounsafe.go │ │ ├── error.go │ │ ├── lexer.go │ │ └── lexer_test.go │ │ ├── jwriter │ │ └── writer.go │ │ ├── opt │ │ ├── gotemplate_Bool.go │ │ ├── gotemplate_Float32.go │ │ ├── gotemplate_Float64.go │ │ ├── gotemplate_Int.go │ │ ├── gotemplate_Int16.go │ │ ├── gotemplate_Int32.go │ │ ├── gotemplate_Int64.go │ │ ├── gotemplate_Int8.go │ │ ├── gotemplate_String.go │ │ ├── gotemplate_Uint.go │ │ ├── gotemplate_Uint16.go │ │ ├── gotemplate_Uint32.go │ │ ├── gotemplate_Uint64.go │ │ ├── gotemplate_Uint8.go │ │ ├── optional │ │ │ └── opt.go │ │ └── opts.go │ │ ├── parser │ │ ├── parser.go │ │ └── pkgpath.go │ │ ├── raw.go │ │ └── tests │ │ ├── basic_test.go │ │ ├── custom_map_key_type.go │ │ ├── data.go │ │ ├── disallow_unknown.go │ │ ├── embedded_type.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── key_marshaler_map.go │ │ ├── named_type.go │ │ ├── nested_easy.go │ │ ├── nothing.go │ │ ├── omitempty.go │ │ ├── opt_test.go │ │ ├── reference_to_pointer.go │ │ ├── required_test.go │ │ └── snake.go ├── netxfly │ └── mysql │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── benchmark_go18_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_go18.go │ │ ├── connection_go18_test.go │ │ ├── connection_test.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── driver_go18_test.go │ │ ├── driver_test.go │ │ ├── dsn.go │ │ ├── dsn_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── packets_test.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── statement_test.go │ │ ├── transaction.go │ │ ├── utils.go │ │ ├── utils_go17.go │ │ ├── utils_go18.go │ │ ├── utils_go18_test.go │ │ └── utils_test.go ├── olivere │ └── elastic │ │ ├── CHANGELOG-3.0.md │ │ ├── CHANGELOG-5.0.md │ │ ├── CHANGELOG-6.0.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── ISSUE_TEMPLATE.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── acknowledged_response.go │ │ ├── backoff.go │ │ ├── bulk.go │ │ ├── bulk_delete_request.go │ │ ├── bulk_index_request.go │ │ ├── bulk_processor.go │ │ ├── bulk_request.go │ │ ├── bulk_update_request.go │ │ ├── canonicalize.go │ │ ├── clear_scroll.go │ │ ├── client.go │ │ ├── cluster_health.go │ │ ├── cluster_state.go │ │ ├── cluster_stats.go │ │ ├── config │ │ ├── config.go │ │ └── doc.go │ │ ├── connection.go │ │ ├── count.go │ │ ├── decoder.go │ │ ├── delete.go │ │ ├── delete_by_query.go │ │ ├── doc.go │ │ ├── docker-compose.yml │ │ ├── errors.go │ │ ├── exists.go │ │ ├── explain.go │ │ ├── fetch_source_context.go │ │ ├── field_stats.go │ │ ├── geo_point.go │ │ ├── get.go │ │ ├── highlight.go │ │ ├── index.go │ │ ├── indices_analyze.go │ │ ├── indices_close.go │ │ ├── indices_create.go │ │ ├── indices_delete.go │ │ ├── indices_delete_template.go │ │ ├── indices_exists.go │ │ ├── indices_exists_template.go │ │ ├── indices_exists_type.go │ │ ├── indices_flush.go │ │ ├── indices_forcemerge.go │ │ ├── indices_get.go │ │ ├── indices_get_aliases.go │ │ ├── indices_get_field_mapping.go │ │ ├── indices_get_mapping.go │ │ ├── indices_get_settings.go │ │ ├── indices_get_template.go │ │ ├── indices_open.go │ │ ├── indices_put_alias.go │ │ ├── indices_put_mapping.go │ │ ├── indices_put_settings.go │ │ ├── indices_put_template.go │ │ ├── indices_refresh.go │ │ ├── indices_rollover.go │ │ ├── indices_shrink.go │ │ ├── indices_stats.go │ │ ├── ingest_delete_pipeline.go │ │ ├── ingest_get_pipeline.go │ │ ├── ingest_put_pipeline.go │ │ ├── ingest_simulate_pipeline.go │ │ ├── inner_hit.go │ │ ├── logger.go │ │ ├── mget.go │ │ ├── msearch.go │ │ ├── mtermvectors.go │ │ ├── nodes_info.go │ │ ├── nodes_stats.go │ │ ├── ping.go │ │ ├── plugins.go │ │ ├── query.go │ │ ├── reindex.go │ │ ├── request.go │ │ ├── rescore.go │ │ ├── rescorer.go │ │ ├── response.go │ │ ├── retrier.go │ │ ├── retry.go │ │ ├── run-es.sh │ │ ├── script.go │ │ ├── scroll.go │ │ ├── search.go │ │ ├── search_aggs.go │ │ ├── search_aggs_bucket_children.go │ │ ├── search_aggs_bucket_date_histogram.go │ │ ├── search_aggs_bucket_date_range.go │ │ ├── search_aggs_bucket_filter.go │ │ ├── search_aggs_bucket_filters.go │ │ ├── search_aggs_bucket_geo_distance.go │ │ ├── search_aggs_bucket_geohash_grid.go │ │ ├── search_aggs_bucket_global.go │ │ ├── search_aggs_bucket_histogram.go │ │ ├── search_aggs_bucket_missing.go │ │ ├── search_aggs_bucket_nested.go │ │ ├── search_aggs_bucket_range.go │ │ ├── search_aggs_bucket_reverse_nested.go │ │ ├── search_aggs_bucket_sampler.go │ │ ├── search_aggs_bucket_significant_terms.go │ │ ├── search_aggs_bucket_terms.go │ │ ├── search_aggs_matrix_stats.go │ │ ├── search_aggs_metrics_avg.go │ │ ├── search_aggs_metrics_cardinality.go │ │ ├── search_aggs_metrics_extended_stats.go │ │ ├── search_aggs_metrics_geo_bounds.go │ │ ├── search_aggs_metrics_max.go │ │ ├── search_aggs_metrics_min.go │ │ ├── search_aggs_metrics_percentile_ranks.go │ │ ├── search_aggs_metrics_percentiles.go │ │ ├── search_aggs_metrics_stats.go │ │ ├── search_aggs_metrics_sum.go │ │ ├── search_aggs_metrics_top_hits.go │ │ ├── search_aggs_metrics_value_count.go │ │ ├── search_aggs_pipeline_avg_bucket.go │ │ ├── search_aggs_pipeline_bucket_script.go │ │ ├── search_aggs_pipeline_bucket_selector.go │ │ ├── search_aggs_pipeline_cumulative_sum.go │ │ ├── search_aggs_pipeline_derivative.go │ │ ├── search_aggs_pipeline_max_bucket.go │ │ ├── search_aggs_pipeline_min_bucket.go │ │ ├── search_aggs_pipeline_mov_avg.go │ │ ├── search_aggs_pipeline_percentiles_bucket.go │ │ ├── search_aggs_pipeline_serial_diff.go │ │ ├── search_aggs_pipeline_stats_bucket.go │ │ ├── search_aggs_pipeline_sum_bucket.go │ │ ├── search_collapse_builder.go │ │ ├── search_queries_bool.go │ │ ├── search_queries_boosting.go │ │ ├── search_queries_common_terms.go │ │ ├── search_queries_constant_score.go │ │ ├── search_queries_dis_max.go │ │ ├── search_queries_exists.go │ │ ├── search_queries_fsq.go │ │ ├── search_queries_fsq_score_funcs.go │ │ ├── search_queries_fuzzy.go │ │ ├── search_queries_geo_bounding_box.go │ │ ├── search_queries_geo_distance.go │ │ ├── search_queries_geo_polygon.go │ │ ├── search_queries_has_child.go │ │ ├── search_queries_has_parent.go │ │ ├── search_queries_ids.go │ │ ├── search_queries_match.go │ │ ├── search_queries_match_all.go │ │ ├── search_queries_match_none.go │ │ ├── search_queries_match_phrase.go │ │ ├── search_queries_match_phrase_prefix.go │ │ ├── search_queries_more_like_this.go │ │ ├── search_queries_multi_match.go │ │ ├── search_queries_nested.go │ │ ├── search_queries_parent_id.go │ │ ├── search_queries_percolator.go │ │ ├── search_queries_prefix.go │ │ ├── search_queries_query_string.go │ │ ├── search_queries_range.go │ │ ├── search_queries_raw_string.go │ │ ├── search_queries_regexp.go │ │ ├── search_queries_script.go │ │ ├── search_queries_simple_query_string.go │ │ ├── search_queries_slice.go │ │ ├── search_queries_term.go │ │ ├── search_queries_terms.go │ │ ├── search_queries_type.go │ │ ├── search_queries_wildcard.go │ │ ├── search_request.go │ │ ├── search_source.go │ │ ├── search_terms_lookup.go │ │ ├── snapshot_create.go │ │ ├── snapshot_create_repository.go │ │ ├── snapshot_delete_repository.go │ │ ├── snapshot_get_repository.go │ │ ├── snapshot_verify_repository.go │ │ ├── sort.go │ │ ├── suggest_field.go │ │ ├── suggester.go │ │ ├── suggester_completion.go │ │ ├── suggester_completion_fuzzy.go │ │ ├── suggester_context.go │ │ ├── suggester_context_category.go │ │ ├── suggester_context_geo.go │ │ ├── suggester_phrase.go │ │ ├── suggester_term.go │ │ ├── tasks_cancel.go │ │ ├── tasks_get_task.go │ │ ├── tasks_list.go │ │ ├── termvectors.go │ │ ├── update.go │ │ ├── update_by_query.go │ │ └── uritemplates │ │ ├── LICENSE │ │ ├── uritemplates.go │ │ └── utils.go ├── panjf2000 │ ├── ants │ │ └── v2 │ │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ ├── bug_report.md │ │ │ │ └── feature_request.md │ │ │ └── pull_request_template.md │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── README_ZH.md │ │ │ ├── ants.go │ │ │ ├── ants_benchmark_test.go │ │ │ ├── ants_test.go │ │ │ ├── doc.go │ │ │ ├── examples │ │ │ └── main.go │ │ │ ├── go.mod │ │ │ ├── internal │ │ │ └── spinlock.go │ │ │ ├── pool.go │ │ │ ├── pool_func.go │ │ │ ├── worker.go │ │ │ ├── worker_array.go │ │ │ ├── worker_func.go │ │ │ ├── worker_loop_queue.go │ │ │ ├── worker_loop_queue_test.go │ │ │ ├── worker_stack.go │ │ │ └── worker_stack_test.go │ └── ants@v1.3.0 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_ZH.md │ │ ├── ants.go │ │ ├── ants_benchmark_test.go │ │ ├── ants_test.go │ │ ├── examples │ │ └── main.go │ │ ├── pool.go │ │ ├── pool_func.go │ │ ├── worker.go │ │ └── worker_func.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── bench_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── example_test.go │ │ ├── format_test.go │ │ ├── go113_test.go │ │ ├── json_test.go │ │ ├── stack.go │ │ └── stack_test.go └── stacktitan │ └── smb │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── gss │ ├── gss.go │ └── oid.go │ ├── ntlmssp │ ├── crypto.go │ ├── crypto_test.go │ ├── ntlmssp.go │ └── ntlmssp_test.go │ └── smb │ ├── encoder │ ├── encoder.go │ ├── encoder_test.go │ └── unicode.go │ ├── session.go │ └── smb.go ├── golang.org └── x │ └── crypto │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── acme │ ├── acme.go │ ├── acme_test.go │ ├── autocert │ │ ├── autocert.go │ │ ├── autocert_test.go │ │ ├── cache.go │ │ ├── cache_test.go │ │ ├── example_test.go │ │ ├── internal │ │ │ └── acmetest │ │ │ │ └── ca.go │ │ ├── listener.go │ │ ├── renewal.go │ │ └── renewal_test.go │ ├── http.go │ ├── http_test.go │ ├── internal │ │ └── acmeprobe │ │ │ └── prober.go │ ├── jws.go │ ├── jws_test.go │ ├── rfc8555.go │ ├── rfc8555_test.go │ ├── types.go │ ├── types_test.go │ └── version_go112.go │ ├── argon2 │ ├── argon2.go │ ├── argon2_test.go │ ├── blake2b.go │ ├── blamka_amd64.go │ ├── blamka_amd64.s │ ├── blamka_generic.go │ └── blamka_ref.go │ ├── bcrypt │ ├── base64.go │ ├── bcrypt.go │ └── bcrypt_test.go │ ├── blake2b │ ├── blake2b.go │ ├── blake2bAVX2_amd64.go │ ├── blake2bAVX2_amd64.s │ ├── blake2b_amd64.go │ ├── blake2b_amd64.s │ ├── blake2b_generic.go │ ├── blake2b_ref.go │ ├── blake2b_test.go │ ├── blake2x.go │ └── register.go │ ├── blake2s │ ├── blake2s.go │ ├── blake2s_386.go │ ├── blake2s_386.s │ ├── blake2s_amd64.go │ ├── blake2s_amd64.s │ ├── blake2s_generic.go │ ├── blake2s_ref.go │ ├── blake2s_test.go │ ├── blake2x.go │ └── register.go │ ├── blowfish │ ├── block.go │ ├── blowfish_test.go │ ├── cipher.go │ └── const.go │ ├── bn256 │ ├── bn256.go │ ├── bn256_test.go │ ├── constants.go │ ├── curve.go │ ├── example_test.go │ ├── gfp12.go │ ├── gfp2.go │ ├── gfp6.go │ ├── optate.go │ └── twist.go │ ├── cast5 │ ├── cast5.go │ └── cast5_test.go │ ├── chacha20 │ ├── chacha_arm64.go │ ├── chacha_arm64.s │ ├── chacha_generic.go │ ├── chacha_noasm.go │ ├── chacha_ppc64le.go │ ├── chacha_ppc64le.s │ ├── chacha_s390x.go │ ├── chacha_s390x.s │ ├── chacha_test.go │ ├── vectors_test.go │ └── xor.go │ ├── chacha20poly1305 │ ├── chacha20poly1305.go │ ├── chacha20poly1305_amd64.go │ ├── chacha20poly1305_amd64.s │ ├── chacha20poly1305_generic.go │ ├── chacha20poly1305_noasm.go │ ├── chacha20poly1305_test.go │ ├── chacha20poly1305_vectors_test.go │ └── xchacha20poly1305.go │ ├── codereview.cfg │ ├── cryptobyte │ ├── asn1.go │ ├── asn1 │ │ └── asn1.go │ ├── asn1_test.go │ ├── builder.go │ ├── cryptobyte_test.go │ ├── example_test.go │ └── string.go │ ├── curve25519 │ ├── curve25519.go │ ├── curve25519_amd64.go │ ├── curve25519_amd64.s │ ├── curve25519_generic.go │ ├── curve25519_noasm.go │ ├── curve25519_test.go │ └── vectors_test.go │ ├── ed25519 │ ├── ed25519.go │ ├── ed25519_go113.go │ ├── ed25519_test.go │ ├── go113_test.go │ ├── internal │ │ └── edwards25519 │ │ │ ├── const.go │ │ │ └── edwards25519.go │ └── testdata │ │ └── sign.input.gz │ ├── go.mod │ ├── go.sum │ ├── hkdf │ ├── example_test.go │ ├── hkdf.go │ └── hkdf_test.go │ ├── internal │ ├── subtle │ │ ├── aliasing.go │ │ ├── aliasing_appengine.go │ │ └── aliasing_test.go │ └── wycheproof │ │ ├── README.md │ │ ├── dsa_test.go │ │ ├── ecdsa_test.go │ │ ├── eddsa_test.go │ │ ├── internal │ │ ├── dsa │ │ │ └── dsa.go │ │ └── ecdsa │ │ │ └── ecdsa.go │ │ ├── rsa_pss_test.go │ │ ├── rsa_signature_test.go │ │ └── wycheproof_test.go │ ├── md4 │ ├── example_test.go │ ├── md4.go │ ├── md4_test.go │ └── md4block.go │ ├── nacl │ ├── auth │ │ ├── auth.go │ │ ├── auth_test.go │ │ └── example_test.go │ ├── box │ │ ├── box.go │ │ ├── box_test.go │ │ └── example_test.go │ ├── secretbox │ │ ├── example_test.go │ │ ├── secretbox.go │ │ └── secretbox_test.go │ └── sign │ │ ├── sign.go │ │ └── sign_test.go │ ├── ocsp │ ├── ocsp.go │ └── ocsp_test.go │ ├── openpgp │ ├── armor │ │ ├── armor.go │ │ ├── armor_test.go │ │ └── encode.go │ ├── canonical_text.go │ ├── canonical_text_test.go │ ├── clearsign │ │ ├── clearsign.go │ │ └── clearsign_test.go │ ├── elgamal │ │ ├── elgamal.go │ │ └── elgamal_test.go │ ├── errors │ │ └── errors.go │ ├── keys.go │ ├── keys_data_test.go │ ├── keys_test.go │ ├── packet │ │ ├── compressed.go │ │ ├── compressed_test.go │ │ ├── config.go │ │ ├── encrypted_key.go │ │ ├── encrypted_key_test.go │ │ ├── literal.go │ │ ├── ocfb.go │ │ ├── ocfb_test.go │ │ ├── one_pass_signature.go │ │ ├── opaque.go │ │ ├── opaque_test.go │ │ ├── packet.go │ │ ├── packet_test.go │ │ ├── private_key.go │ │ ├── private_key_test.go │ │ ├── public_key.go │ │ ├── public_key_test.go │ │ ├── public_key_v3.go │ │ ├── public_key_v3_test.go │ │ ├── reader.go │ │ ├── signature.go │ │ ├── signature_test.go │ │ ├── signature_v3.go │ │ ├── signature_v3_test.go │ │ ├── symmetric_key_encrypted.go │ │ ├── symmetric_key_encrypted_test.go │ │ ├── symmetrically_encrypted.go │ │ ├── symmetrically_encrypted_test.go │ │ ├── userattribute.go │ │ ├── userattribute_test.go │ │ ├── userid.go │ │ └── userid_test.go │ ├── read.go │ ├── read_test.go │ ├── s2k │ │ ├── s2k.go │ │ └── s2k_test.go │ ├── write.go │ └── write_test.go │ ├── otr │ ├── libotr_test_helper.c │ ├── otr.go │ ├── otr_test.go │ └── smp.go │ ├── pbkdf2 │ ├── pbkdf2.go │ └── pbkdf2_test.go │ ├── pkcs12 │ ├── bmp-string.go │ ├── bmp-string_test.go │ ├── crypto.go │ ├── crypto_test.go │ ├── errors.go │ ├── internal │ │ └── rc2 │ │ │ ├── bench_test.go │ │ │ ├── rc2.go │ │ │ └── rc2_test.go │ ├── mac.go │ ├── mac_test.go │ ├── pbkdf.go │ ├── pbkdf_test.go │ ├── pkcs12.go │ ├── pkcs12_test.go │ └── safebags.go │ ├── poly1305 │ ├── bits_compat.go │ ├── bits_go1.13.go │ ├── mac_noasm.go │ ├── poly1305.go │ ├── poly1305_test.go │ ├── sum_amd64.go │ ├── sum_amd64.s │ ├── sum_generic.go │ ├── sum_noasm.go │ ├── sum_ppc64le.go │ ├── sum_ppc64le.s │ ├── sum_s390x.go │ ├── sum_s390x.s │ ├── sum_vmsl_s390x.s │ └── vectors_test.go │ ├── ripemd160 │ ├── ripemd160.go │ ├── ripemd160_test.go │ └── ripemd160block.go │ ├── salsa20 │ ├── salsa │ │ ├── hsalsa20.go │ │ ├── salsa208.go │ │ ├── salsa20_amd64.go │ │ ├── salsa20_amd64.s │ │ ├── salsa20_amd64_test.go │ │ ├── salsa20_noasm.go │ │ ├── salsa20_ref.go │ │ └── salsa_test.go │ ├── salsa20.go │ └── salsa20_test.go │ ├── scrypt │ ├── example_test.go │ ├── scrypt.go │ └── scrypt_test.go │ ├── sha3 │ ├── doc.go │ ├── hashes.go │ ├── hashes_generic.go │ ├── keccakf.go │ ├── keccakf_amd64.go │ ├── keccakf_amd64.s │ ├── register.go │ ├── sha3.go │ ├── sha3_s390x.go │ ├── sha3_s390x.s │ ├── sha3_test.go │ ├── shake.go │ ├── shake_generic.go │ ├── testdata │ │ └── keccakKats.json.deflate │ ├── xor.go │ ├── xor_generic.go │ └── xor_unaligned.go │ ├── ssh │ ├── agent │ │ ├── client.go │ │ ├── client_test.go │ │ ├── example_test.go │ │ ├── forward.go │ │ ├── keyring.go │ │ ├── keyring_test.go │ │ ├── server.go │ │ ├── server_test.go │ │ └── testdata_test.go │ ├── benchmark_test.go │ ├── buffer.go │ ├── buffer_test.go │ ├── certs.go │ ├── certs_test.go │ ├── channel.go │ ├── cipher.go │ ├── cipher_test.go │ ├── client.go │ ├── client_auth.go │ ├── client_auth_test.go │ ├── client_test.go │ ├── common.go │ ├── common_test.go │ ├── connection.go │ ├── doc.go │ ├── example_test.go │ ├── handshake.go │ ├── handshake_test.go │ ├── kex.go │ ├── kex_test.go │ ├── keys.go │ ├── keys_test.go │ ├── knownhosts │ │ ├── knownhosts.go │ │ └── knownhosts_test.go │ ├── mac.go │ ├── mempipe_test.go │ ├── messages.go │ ├── messages_test.go │ ├── mux.go │ ├── mux_test.go │ ├── server.go │ ├── session.go │ ├── session_test.go │ ├── ssh_gss.go │ ├── ssh_gss_test.go │ ├── streamlocal.go │ ├── tcpip.go │ ├── tcpip_test.go │ ├── terminal │ │ ├── terminal.go │ │ ├── terminal_test.go │ │ ├── util.go │ │ ├── util_aix.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ ├── test │ │ ├── agent_unix_test.go │ │ ├── banner_test.go │ │ ├── cert_test.go │ │ ├── dial_unix_test.go │ │ ├── doc.go │ │ ├── forward_unix_test.go │ │ ├── multi_auth_test.go │ │ ├── session_test.go │ │ ├── sshd_test_pw.c │ │ ├── test_unix_test.go │ │ └── testdata_test.go │ ├── testdata │ │ ├── doc.go │ │ └── keys.go │ ├── testdata_test.go │ ├── transport.go │ └── transport_test.go │ ├── tea │ ├── cipher.go │ └── tea_test.go │ ├── twofish │ ├── twofish.go │ └── twofish_test.go │ ├── xtea │ ├── block.go │ ├── cipher.go │ └── xtea_test.go │ └── xts │ ├── xts.go │ └── xts_test.go └── gopkg.in ├── gomail.v2 ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── auth.go ├── auth_test.go ├── doc.go ├── example_test.go ├── message.go ├── message_test.go ├── mime.go ├── mime_go14.go ├── send.go ├── send_test.go ├── smtp.go ├── smtp_test.go └── writeto.go ├── mgo.v2 ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── auth.go ├── auth_test.go ├── bson │ ├── LICENSE │ ├── bson.go │ ├── bson_test.go │ ├── decimal.go │ ├── decimal_test.go │ ├── decode.go │ ├── encode.go │ ├── json.go │ ├── json_test.go │ ├── specdata │ │ └── update.sh │ └── specdata_test.go ├── bulk.go ├── bulk_test.go ├── cluster.go ├── cluster_test.go ├── dbtest │ ├── dbserver.go │ ├── dbserver_test.go │ └── export_test.go ├── doc.go ├── export_test.go ├── gridfs.go ├── gridfs_test.go ├── harness │ ├── certs │ │ ├── client.crt │ │ ├── client.key │ │ ├── client.pem │ │ ├── client.req │ │ ├── server.crt │ │ ├── server.key │ │ └── server.pem │ ├── daemons │ │ ├── .env │ │ ├── cfg1 │ │ │ ├── db │ │ │ │ ├── .empty │ │ │ │ ├── journal │ │ │ │ │ └── tempLatencyTest │ │ │ │ └── mongod.lock │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── cfg2 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── cfg3 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db1 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db2 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db3 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs4a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── s1 │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── s2 │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ └── s3 │ │ │ ├── log │ │ │ └── run │ │ │ └── run │ ├── mongojs │ │ ├── dropall.js │ │ ├── init.js │ │ └── wait.js │ └── setup.sh ├── internal │ ├── json │ │ ├── LICENSE │ │ ├── bench_test.go │ │ ├── decode.go │ │ ├── decode_test.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── example_test.go │ │ ├── extension.go │ │ ├── extension_test.go │ │ ├── fold.go │ │ ├── fold_test.go │ │ ├── indent.go │ │ ├── number_test.go │ │ ├── scanner.go │ │ ├── scanner_test.go │ │ ├── stream.go │ │ ├── stream_test.go │ │ ├── tagkey_test.go │ │ ├── tags.go │ │ ├── tags_test.go │ │ └── testdata │ │ │ └── code.json.gz │ ├── sasl │ │ ├── sasl.c │ │ ├── sasl.go │ │ ├── sasl_windows.c │ │ ├── sasl_windows.go │ │ ├── sasl_windows.h │ │ ├── sspi_windows.c │ │ └── sspi_windows.h │ └── scram │ │ ├── scram.go │ │ └── scram_test.go ├── log.go ├── queue.go ├── queue_test.go ├── raceoff.go ├── raceon.go ├── saslimpl.go ├── saslstub.go ├── server.go ├── session.go ├── session_test.go ├── socket.go ├── stats.go ├── suite_test.go ├── syscall_test.go ├── syscall_windows_test.go └── txn │ ├── chaos.go │ ├── debug.go │ ├── dockey_test.go │ ├── flusher.go │ ├── output.txt │ ├── sim_test.go │ ├── tarjan.go │ ├── tarjan_test.go │ ├── txn.go │ └── txn_test.go └── 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 /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | /asset-scan-* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 ATpiu,2018 Dean 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 all 11 | 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 THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | version: 1.0 2 | nmap: 3 | path: #不指定则使用系统默认的nmap 4 | 5 | masscan: 6 | path: #不指定则使用系统默认的masscan 7 | rate: 3000 #masscan扫描速度,不建议设很大 8 | 9 | es: 10 | address: 127.0.0.1:9200 #elasticsearch地址 11 | 12 | scan: 13 | ipFile: ip.txt #包含扫描的ip范围文件,文件内容格式参照nmap -iL参数所支持的格式 14 | ipexcludeFile: ipExclude.txt #包含需排除的ip范围文件,文件内容格式参照nmap --excludefile参数所支持的格式 15 | port: 1-65535 #扫描端口范围 16 | mas_num: 1 #同时可运行的最大masscan数 17 | nmap_num: 20 #同时可运行的最大nmap数 18 | scan_interval: 30 #扫描间隔,单位:秒 19 | userDict: user.txt #对服务进行弱口令爆破的用户名字典 20 | passwordDict: password.txt #对服务进行弱口令爆破的密码字典 21 | 22 | observe: 23 | switch: on #观察者模式开关:(1)开启:on (2)关闭:off 24 | 25 | mail: #告警邮箱设置,若观察者模式始终开启,则可忽略邮箱配置 26 | host: xxx.xxx.com 27 | port: 123 28 | username: xxx@xxx.com 29 | password: xxx 30 | from: xxx@xxx.com 31 | to: ["xxx@xxx.com","xxx@xxx.com"] -------------------------------------------------------------------------------- /doc/IP开放高危服务表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/doc/IP开放高危服务表.png -------------------------------------------------------------------------------- /doc/brute.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/doc/brute.jpg -------------------------------------------------------------------------------- /doc/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/doc/dashboard.png -------------------------------------------------------------------------------- /doc/key_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/doc/key_dashboard.png -------------------------------------------------------------------------------- /doc/kibana.md: -------------------------------------------------------------------------------- 1 | # kibana图表模板 2 | ## 模板导入 3 | 4 | - 访问`http://xx.xx.xx.xx:5601`(kibana所在ip地址),左侧菜单单击`Management`,然后选择`Saved Objects` 5 | 6 | - 在新出现页面右上角点击`Import`,选择[release](https://github.com/ATpiu/asset-scan/releases)压缩包中的`dashboard.json`,导入dashboard模板。再次点击`Import`,导入压缩包中的`visualize.json`,导入visualize模板。 7 | 8 | ## 模板Dashboard说明 9 | 10 | ![](key_dashboard.png) 11 | 12 | 有了扫描的基础数据,即可通过kibana来自定义各类表盘,为我们安全人员服务,产生价值 13 | 在此以模板Dashboard为例,说明上图每个图表作用: 14 | 1. 图1:单IP开放端口排序,可以看到前五个外网IP开放端口数明显多于其他几个,一般可能是开启防火墙导致,可添加白名单配置 15 | 2. 图2:可查看23、80和3389等常见端口开放的服务 16 | 3. 图3和图4:左图可查看作者自定义的高危服务及其IP分布,右图可查看详情并下载CSV表格到本地(滚轮下滑到最底部,单击`RAW`导出CSB格式结果),方便推动攻击面收敛工作 17 | 4. 图5和图6:masscan和nmap扫描耗时TOP10,可对扫描时间特别长的IP进行排查,优化扫描策略 18 | 19 | **模板Dashboard仅供大家参考学习,具体可根据自己实际需求,在kibana上定制不同的表盘** -------------------------------------------------------------------------------- /doc/wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/doc/wechat.jpg -------------------------------------------------------------------------------- /ip.txt: -------------------------------------------------------------------------------- 1 | 127.0.0.1 -------------------------------------------------------------------------------- /ipExclude.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/ipExclude.txt -------------------------------------------------------------------------------- /lib/lib.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "log" 5 | "net" 6 | "runtime" 7 | "strconv" 8 | "time" 9 | ) 10 | 11 | func GetUnixTime() string { 12 | return strconv.FormatInt(time.Now().UnixNano()/1e6, 10) 13 | } 14 | 15 | func CheckSystem() { 16 | if runtime.GOOS != "linux" { 17 | FatalError("[*]目前仅支持Linux系统") 18 | } 19 | } 20 | 21 | func FatalError(err string) { 22 | log.Fatal(err) 23 | } 24 | 25 | func TCPSend(ip string, port string, data []byte) (error, []byte) { 26 | var err error 27 | conn, err := net.DialTimeout("tcp", ip+":"+port, time.Second*time.Duration(3)) 28 | if err != nil { 29 | return err, nil 30 | } 31 | defer conn.Close() 32 | _, err = conn.Write(data) 33 | if err != nil { 34 | return err, nil 35 | } 36 | buf := make([]byte, 20000) 37 | n, err := conn.Read(buf) 38 | if err != nil { 39 | return err, nil 40 | } 41 | return nil, buf[:n] 42 | } 43 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "asset-scan/lib" 5 | "asset-scan/models" 6 | "time" 7 | ) 8 | 9 | func init() { 10 | lib.CheckSystem() 11 | } 12 | 13 | func main() { 14 | s := &models.Scanner{ 15 | Conf: &models.Config{}, 16 | } 17 | s.ScanInit() 18 | models.Esinit(s.Conf) 19 | go s.BruteForce() 20 | ticker := time.NewTicker(time.Second * time.Duration(s.Conf.S.ScanInterval)) 21 | defer ticker.Stop() 22 | for { 23 | s.ScanInit() 24 | if err := s.StartScan(); err != nil { 25 | lib.FatalError(err.Error()) 26 | } 27 | <-ticker.C 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /models/notice.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "asset-scan/lib" 5 | "crypto/tls" 6 | "gopkg.in/gomail.v2" 7 | ) 8 | 9 | func SendMail(mail Mail, subject string, body string) (err error) { 10 | m := gomail.NewDialer(mail.Host, mail.Port, mail.Username, mail.Passwrod) 11 | m.TLSConfig = &tls.Config{InsecureSkipVerify: true} 12 | msg := gomail.NewMessage() 13 | 14 | msg.SetAddressHeader("From", mail.From, "") 15 | msg.SetHeader("To", mail.To...) 16 | msg.SetHeader("Subject", subject) 17 | msg.SetBody("text/html", body) 18 | 19 | if err = m.DialAndSend(msg); err != nil { 20 | lib.FatalError("sendMail:" + err.Error()) 21 | } 22 | return 23 | } 24 | -------------------------------------------------------------------------------- /password.txt: -------------------------------------------------------------------------------- 1 | 123456 -------------------------------------------------------------------------------- /plugins/ftp.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "github.com/jlaffaye/ftp" 5 | "time" 6 | ) 7 | 8 | func ScanFtp(ip string, port string, username string, password string) (err error, result bool) { 9 | conn, err := ftp.DialTimeout(ip+":"+port, time.Second*3) 10 | if err == nil { 11 | err = conn.Login(username, password) 12 | if err == nil { 13 | result = true 14 | conn.Logout() 15 | } 16 | } 17 | return err, result 18 | } 19 | -------------------------------------------------------------------------------- /plugins/ftp_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | "testing" 6 | ) 7 | 8 | func TestScanFtp(t *testing.T) { 9 | t.Log(plugins.ScanFtp("127.0.0.1", "21", "root", "123456")) 10 | } 11 | -------------------------------------------------------------------------------- /plugins/mongodb.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "gopkg.in/mgo.v2" 5 | "time" 6 | ) 7 | 8 | //mongodb未授权和弱口令漏洞 9 | func ScanMongodb(ip string, port string, username string, password string) (err error, result bool) { 10 | session, err := mgo.DialWithTimeout("mongodb://"+username+":"+password+"@"+ip+":"+port+"/"+"admin", time.Second*3) 11 | if err == nil && session.Ping() == nil { 12 | defer session.Close() 13 | if err == nil && session.Run("serverStatus", nil) == nil { 14 | result = true 15 | } 16 | } 17 | return err, result 18 | } 19 | 20 | func MongoUnauth(ip string, port string) (err error, result bool) { 21 | session, err := mgo.Dial(ip + ":" + port) 22 | if err == nil && session.Run("serverStatus", nil) == nil { 23 | result = true 24 | } 25 | return err, result 26 | } 27 | -------------------------------------------------------------------------------- /plugins/mongodb_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | "testing" 6 | ) 7 | 8 | func TestScanMongodb(t *testing.T) { 9 | t.Log(plugins.ScanMongodb("127.0.0.1", "27017", "root", "123456")) 10 | } 11 | -------------------------------------------------------------------------------- /plugins/mssql.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "database/sql" 5 | _ "github.com/denisenkom/go-mssqldb" 6 | ) 7 | 8 | func ScanMssql(ip string, port string, username string, password string) (err error, result bool) { 9 | db, err := sql.Open("mssql", "server="+ip+";port="+port+";user id="+username+";password="+password+";database=master") 10 | if err == nil { 11 | defer db.Close() 12 | err = db.Ping() 13 | if err == nil { 14 | result = true 15 | } 16 | } 17 | return err, result 18 | } 19 | -------------------------------------------------------------------------------- /plugins/mssql_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | "testing" 6 | ) 7 | 8 | func TestScanMssql(t *testing.T) { 9 | t.Log(plugins.ScanMssql("127.0.0.1", "1433", "sa", "123456")) 10 | } 11 | -------------------------------------------------------------------------------- /plugins/mysql.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | _ "github.com/go-sql-driver/mysql" 7 | "time" 8 | ) 9 | 10 | func ScanMysql(ip string, port string, username string, password string) (err error, result bool) { 11 | connStr := fmt.Sprintf("%s:%s@tcp(%s)/?timeout=%ds", username, password, ip+":"+port, time.Second*3) 12 | db, err := sql.Open("mysql", connStr) 13 | if err == nil { 14 | defer db.Close() 15 | err = db.Ping() 16 | if err == nil { 17 | result = true 18 | } 19 | } 20 | return err, result 21 | } 22 | -------------------------------------------------------------------------------- /plugins/mysql_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | "testing" 6 | ) 7 | 8 | func TestScanMysql(t *testing.T) { 9 | t.Log(plugins.ScanMysql("127.0.0.1", "3306", "root", "123456")) 10 | } 11 | -------------------------------------------------------------------------------- /plugins/plugins.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | type ScanType func(ip string, port string, username string, password string) (err error, result bool) 4 | 5 | var ScanTypeMap map[string]ScanType 6 | 7 | func init() { 8 | ScanTypeMap = make(map[string]ScanType, 0) 9 | ScanTypeMap["ftp"] = ScanFtp 10 | ScanTypeMap["mongod"] = ScanMongodb 11 | ScanTypeMap["ms-sql-s"] = ScanMssql 12 | ScanTypeMap["mysql"] = ScanMysql 13 | ScanTypeMap["postgresql"] = ScanPostgres 14 | ScanTypeMap["redis"] = ScanRedis 15 | ScanTypeMap["ssh"] = ScanSsh 16 | } 17 | -------------------------------------------------------------------------------- /plugins/postgres.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | _ "github.com/lib/pq" 5 | 6 | "database/sql" 7 | "fmt" 8 | ) 9 | 10 | func ScanPostgres(ip string, port string, username string, password string) (err error, result bool) { 11 | db, err := sql.Open("postgres", fmt.Sprintf("postgres://%v:%v@%v:%v/%v?sslmode=%v", username, password, ip, port, "postgres", "disable")) 12 | if err == nil { 13 | defer db.Close() 14 | err = db.Ping() 15 | if err == nil { 16 | result = true 17 | } 18 | } 19 | return err, result 20 | } 21 | -------------------------------------------------------------------------------- /plugins/postgres_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | "testing" 6 | ) 7 | 8 | func TestScanPostgres(t *testing.T) { 9 | t.Log(plugins.ScanPostgres("127.0.0.1", "5432", "postgres", "123456")) 10 | } 11 | -------------------------------------------------------------------------------- /plugins/redis.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "github.com/go-redis/redis" 5 | "time" 6 | ) 7 | 8 | func ScanRedis(ip string, port string, username string, password string) (err error, result bool) { 9 | client := redis.NewClient(&redis.Options{Addr: ip + ":" + port, Password: password, DB: 0, DialTimeout: time.Second * 3}) 10 | defer client.Close() 11 | _, err = client.Ping().Result() 12 | if err == nil { 13 | result = true 14 | } 15 | return err, result 16 | } 17 | -------------------------------------------------------------------------------- /plugins/redis_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | 6 | "testing" 7 | ) 8 | 9 | func TestScanRedis(t *testing.T) { 10 | t.Log(plugins.ScanRedis("127.0.0.1", "6379", "", "")) 11 | } 12 | -------------------------------------------------------------------------------- /plugins/ssh.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "golang.org/x/crypto/ssh" 5 | "net" 6 | "time" 7 | ) 8 | 9 | func ScanSsh(ip string, port string, username string, password string) (err error, result bool) { 10 | config := &ssh.ClientConfig{ 11 | User: username, 12 | Auth: []ssh.AuthMethod{ 13 | ssh.Password(password), 14 | }, 15 | HostKeyCallback: func(hostname string, remote net.Addr, key ssh.PublicKey) error { 16 | return nil 17 | }, 18 | Timeout: time.Second * 3, 19 | } 20 | 21 | client, err := ssh.Dial("tcp", ip+":"+port, config) 22 | if err == nil { 23 | defer client.Close() 24 | session, err := client.NewSession() 25 | defer session.Close() 26 | errRet := session.Run("echo xsec") 27 | if err == nil && errRet == nil { 28 | result = true 29 | } 30 | } 31 | return err, result 32 | } 33 | -------------------------------------------------------------------------------- /plugins/ssh_test.go: -------------------------------------------------------------------------------- 1 | package plugins_test 2 | 3 | import ( 4 | "asset-scan/plugins" 5 | 6 | "testing" 7 | ) 8 | 9 | func TestScanSsh(t *testing.T) { 10 | t.Log(plugins.ScanSsh("127.0.0.1", "22", "root", "123456")) 11 | } 12 | -------------------------------------------------------------------------------- /user.txt: -------------------------------------------------------------------------------- 1 | root -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/batch/batch_fuzz.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gofuzz 6 | 7 | package batch 8 | 9 | func Fuzz(data []byte) int { 10 | Split(string(data), "GO") 11 | return 0 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/doc.go: -------------------------------------------------------------------------------- 1 | // package mssql implements the TDS protocol used to connect to MS SQL Server (sqlserver) 2 | // database servers. 3 | // 4 | // This package registers the driver: 5 | // sqlserver: uses native "@" parameter placeholder names and does no pre-processing. 6 | // 7 | // If the ordinal position is used for query parameters, identifiers will be named 8 | // "@p1", "@p2", ... "@pN". 9 | // 10 | // Please refer to the README for the format of the DSN. There are multiple DSN 11 | // formats accepted: ADO style, ODBC style, and URL style. The following is an 12 | // example of a URL style DSN: 13 | // sqlserver://sa:mypass@localhost:1234?database=master&connection+timeout=30 14 | package mssql 15 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/error_example_test.go: -------------------------------------------------------------------------------- 1 | package mssql 2 | 3 | import "fmt" 4 | 5 | func ExampleError_1() { 6 | // call a function that might return a mssql error 7 | err := callUsingMSSQL() 8 | 9 | type ErrorWithNumber interface { 10 | SQLErrorNumber() int32 11 | } 12 | 13 | if errorWithNumber, ok := err.(ErrorWithNumber); ok { 14 | if errorWithNumber.SQLErrorNumber() == 1205 { 15 | fmt.Println("deadlock error") 16 | } 17 | } 18 | } 19 | 20 | func ExampleError_2() { 21 | // call a function that might return a mssql error 22 | err := callUsingMSSQL() 23 | 24 | type SQLError interface { 25 | SQLErrorNumber() int32 26 | SQLErrorMessage() string 27 | } 28 | 29 | if sqlError, ok := err.(SQLError); ok { 30 | if sqlError.SQLErrorNumber() == 1205 { 31 | fmt.Println("deadlock error", sqlError.SQLErrorMessage()) 32 | } 33 | } 34 | } 35 | 36 | func callUsingMSSQL() error { 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/denisenkom/go-mssqldb 2 | 3 | go 1.11 4 | 5 | require ( 6 | github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe 7 | golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/go.sum: -------------------------------------------------------------------------------- 1 | github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= 2 | github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= 3 | golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= 4 | golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 5 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 6 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/internal/cp/collation.go: -------------------------------------------------------------------------------- 1 | package cp 2 | 3 | // http://msdn.microsoft.com/en-us/library/dd340437.aspx 4 | 5 | type Collation struct { 6 | LcidAndFlags uint32 7 | SortId uint8 8 | } 9 | 10 | func (c Collation) getLcid() uint32 { 11 | return c.LcidAndFlags & 0x000fffff 12 | } 13 | 14 | func (c Collation) getFlags() uint32 { 15 | return (c.LcidAndFlags & 0x0ff00000) >> 20 16 | } 17 | 18 | func (c Collation) getVersion() uint32 { 19 | return (c.LcidAndFlags & 0xf0000000) >> 28 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/log.go: -------------------------------------------------------------------------------- 1 | package mssql 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | type Logger interface { 8 | Printf(format string, v ...interface{}) 9 | Println(v ...interface{}) 10 | } 11 | 12 | type optionalLogger struct { 13 | logger Logger 14 | } 15 | 16 | func (o optionalLogger) Printf(format string, v ...interface{}) { 17 | if o.logger != nil { 18 | o.logger.Printf(format, v...) 19 | } else { 20 | log.Printf(format, v...) 21 | } 22 | } 23 | 24 | func (o optionalLogger) Println(v ...interface{}) { 25 | if o.logger != nil { 26 | o.logger.Println(v...) 27 | } else { 28 | log.Println(v...) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/mssql_go110pre.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package mssql 4 | 5 | import ( 6 | "database/sql/driver" 7 | "errors" 8 | ) 9 | 10 | func (r *Result) LastInsertId() (int64, error) { 11 | s, err := r.c.Prepare("select cast(@@identity as bigint)") 12 | if err != nil { 13 | return 0, err 14 | } 15 | defer s.Close() 16 | rows, err := s.Query(nil) 17 | if err != nil { 18 | return 0, err 19 | } 20 | defer rows.Close() 21 | dest := make([]driver.Value, 1) 22 | err = rows.Next(dest) 23 | if err != nil { 24 | return 0, err 25 | } 26 | if dest[0] == nil { 27 | return -1, errors.New("There is no generated identity value") 28 | } 29 | lastInsertId := dest[0].(int64) 30 | return lastInsertId, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/mssql_go19pre.go: -------------------------------------------------------------------------------- 1 | // +build !go1.9 2 | 3 | package mssql 4 | 5 | import ( 6 | "database/sql/driver" 7 | "fmt" 8 | ) 9 | 10 | func (s *Stmt) makeParamExtra(val driver.Value) (param, error) { 11 | return param{}, fmt.Errorf("mssql: unknown type for %T", val) 12 | } 13 | 14 | func scanIntoOut(name string, fromServer, scanInto interface{}) error { 15 | return fmt.Errorf("mssql: unsupported OUTPUT type, use a newer Go version") 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/mssql_test.go: -------------------------------------------------------------------------------- 1 | package mssql 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | ) 7 | 8 | func TestBadOpen(t *testing.T) { 9 | drv := driverWithProcess(t) 10 | _, err := drv.open(context.Background(), "port=bad") 11 | if err == nil { 12 | t.Fail() 13 | } 14 | } 15 | 16 | func TestIsProc(t *testing.T) { 17 | list := []struct { 18 | s string 19 | is bool 20 | }{ 21 | {"proc", true}, 22 | {"select 1;", false}, 23 | {"select 1", false}, 24 | {"[proc 1]", true}, 25 | {"[proc\n1]", false}, 26 | {"schema.name", true}, 27 | {"[schema].[name]", true}, 28 | {"schema.[name]", true}, 29 | {"[schema].name", true}, 30 | {"schema.[proc name]", true}, 31 | } 32 | 33 | for _, item := range list { 34 | got := isProc(item.s) 35 | if got != item.is { 36 | t.Errorf("for %q, got %t want %t", item.s, got, item.is) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/tds_go110_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package mssql 4 | 5 | import ( 6 | "database/sql" 7 | "testing" 8 | ) 9 | 10 | func open(t *testing.T) *sql.DB { 11 | checkConnStr(t) 12 | SetLogger(testLogger{t}) 13 | connector, err := NewConnector(makeConnStr(t).String()) 14 | if err != nil { 15 | t.Error("Open connection failed:", err.Error()) 16 | return nil 17 | } 18 | return sql.OpenDB(connector) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/denisenkom/go-mssqldb/tds_go110pre_test.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package mssql 4 | 5 | import ( 6 | "database/sql" 7 | "testing" 8 | ) 9 | 10 | func open(t *testing.T) *sql.DB { 11 | checkConnStr(t) 12 | SetLogger(testLogger{t}) 13 | conn, err := sql.Open("sqlserver", makeConnStr(t).String()) 14 | if err != nil { 15 | t.Error("Open connection failed:", err.Error()) 16 | return nil 17 | } 18 | return conn 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/.gitignore: -------------------------------------------------------------------------------- 1 | *.rdb 2 | testdata/*/ 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | services: 5 | - redis-server 6 | 7 | go: 8 | - 1.9.x 9 | - 1.10.x 10 | - 1.11.x 11 | - tip 12 | 13 | matrix: 14 | allow_failures: 15 | - go: tip 16 | 17 | install: 18 | - go get github.com/onsi/ginkgo 19 | - go get github.com/onsi/gomega 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Unreleased 4 | 5 | - Cluster and Ring pipelines process commands for each node in its own goroutine. 6 | 7 | ## 6.14 8 | 9 | - Added Options.MinIdleConns. 10 | - Added Options.MaxConnAge. 11 | - PoolStats.FreeConns is renamed to PoolStats.IdleConns. 12 | - Add Client.Do to simplify creating custom commands. 13 | - Add Cmd.String, Cmd.Int, Cmd.Int64, Cmd.Uint64, Cmd.Float64, and Cmd.Bool helpers. 14 | - Lower memory usage. 15 | 16 | ## v6.13 17 | 18 | - Ring got new options called `HashReplicas` and `Hash`. It is recommended to set `HashReplicas = 1000` for better keys distribution between shards. 19 | - Cluster client was optimized to use much less memory when reloading cluster state. 20 | - PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout occurres. In most cases it is recommended to use PubSub.Channel instead. 21 | - Dialer.KeepAlive is set to 5 minutes by default. 22 | 23 | ## v6.12 24 | 25 | - ClusterClient got new option called `ClusterSlots` which allows to build cluster of normal Redis Servers that don't have cluster mode enabled. See https://godoc.org/github.com/go-redis/redis#example-NewClusterClient--ManualSetup 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/Makefile: -------------------------------------------------------------------------------- 1 | all: testdeps 2 | go test ./... 3 | go test ./... -short -race 4 | env GOOS=linux GOARCH=386 go test ./... 5 | go vet 6 | go get github.com/gordonklaus/ineffassign 7 | ineffassign . 8 | 9 | testdeps: testdata/redis/src/redis-server 10 | 11 | bench: testdeps 12 | go test ./... -test.run=NONE -test.bench=. -test.benchmem 13 | 14 | .PHONY: all test testdeps bench 15 | 16 | testdata/redis: 17 | mkdir -p $@ 18 | wget -qO- https://github.com/antirez/redis/archive/unstable.tar.gz | tar xvz --strip-components=1 -C $@ 19 | 20 | testdata/redis/src/redis-server: testdata/redis 21 | sed -i.bak 's/libjemalloc.a/libjemalloc.a -lrt/g' $ maxBackoff || backoff < minBackoff { 17 | backoff = maxBackoff 18 | } 19 | 20 | if backoff == 0 { 21 | return 0 22 | } 23 | return time.Duration(rand.Int63n(int64(backoff))) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/internal_test.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestRetryBackoff(t *testing.T) { 11 | RegisterTestingT(t) 12 | 13 | for i := -1; i <= 16; i++ { 14 | backoff := RetryBackoff(i, time.Millisecond, 512*time.Millisecond) 15 | Expect(backoff >= 0).To(BeTrue()) 16 | Expect(backoff <= 512*time.Millisecond).To(BeTrue()) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/log.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | ) 7 | 8 | var Logger *log.Logger 9 | 10 | func Logf(s string, args ...interface{}) { 11 | if Logger == nil { 12 | return 13 | } 14 | Logger.Output(2, fmt.Sprintf(s, args...)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/pool/main_test.go: -------------------------------------------------------------------------------- 1 | package pool_test 2 | 3 | import ( 4 | "net" 5 | "sync" 6 | "testing" 7 | 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | ) 11 | 12 | func TestGinkgoSuite(t *testing.T) { 13 | RegisterFailHandler(Fail) 14 | RunSpecs(t, "pool") 15 | } 16 | 17 | func perform(n int, cbs ...func(int)) { 18 | var wg sync.WaitGroup 19 | for _, cb := range cbs { 20 | for i := 0; i < n; i++ { 21 | wg.Add(1) 22 | go func(cb func(int), i int) { 23 | defer GinkgoRecover() 24 | defer wg.Done() 25 | 26 | cb(i) 27 | }(cb, i) 28 | } 29 | } 30 | wg.Wait() 31 | } 32 | 33 | func dummyDialer() (net.Conn, error) { 34 | return &net.TCPConn{}, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/pool/pool_single.go: -------------------------------------------------------------------------------- 1 | package pool 2 | 3 | type SingleConnPool struct { 4 | cn *Conn 5 | } 6 | 7 | var _ Pooler = (*SingleConnPool)(nil) 8 | 9 | func NewSingleConnPool(cn *Conn) *SingleConnPool { 10 | return &SingleConnPool{ 11 | cn: cn, 12 | } 13 | } 14 | 15 | func (p *SingleConnPool) NewConn() (*Conn, error) { 16 | panic("not implemented") 17 | } 18 | 19 | func (p *SingleConnPool) CloseConn(*Conn) error { 20 | panic("not implemented") 21 | } 22 | 23 | func (p *SingleConnPool) Get() (*Conn, error) { 24 | return p.cn, nil 25 | } 26 | 27 | func (p *SingleConnPool) Put(cn *Conn) { 28 | if p.cn != cn { 29 | panic("p.cn != cn") 30 | } 31 | } 32 | 33 | func (p *SingleConnPool) Remove(cn *Conn) { 34 | if p.cn != cn { 35 | panic("p.cn != cn") 36 | } 37 | } 38 | 39 | func (p *SingleConnPool) Len() int { 40 | return 1 41 | } 42 | 43 | func (p *SingleConnPool) IdleLen() int { 44 | return 0 45 | } 46 | 47 | func (p *SingleConnPool) Stats() *Stats { 48 | return nil 49 | } 50 | 51 | func (p *SingleConnPool) Close() error { 52 | return nil 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/proto/proto_test.go: -------------------------------------------------------------------------------- 1 | package proto_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestGinkgoSuite(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "proto") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/proto/scan_test.go: -------------------------------------------------------------------------------- 1 | package proto 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | type testScanSliceStruct struct { 11 | ID int 12 | Name string 13 | } 14 | 15 | func (s *testScanSliceStruct) MarshalBinary() ([]byte, error) { 16 | return json.Marshal(s) 17 | } 18 | 19 | func (s *testScanSliceStruct) UnmarshalBinary(b []byte) error { 20 | return json.Unmarshal(b, s) 21 | } 22 | 23 | var _ = Describe("ScanSlice", func() { 24 | data := []string{ 25 | `{"ID":-1,"Name":"Back Yu"}`, 26 | `{"ID":1,"Name":"szyhf"}`, 27 | } 28 | 29 | It("[]testScanSliceStruct", func() { 30 | var slice []testScanSliceStruct 31 | err := ScanSlice(data, &slice) 32 | Expect(err).NotTo(HaveOccurred()) 33 | Expect(slice).To(Equal([]testScanSliceStruct{ 34 | {-1, "Back Yu"}, 35 | {1, "szyhf"}, 36 | })) 37 | }) 38 | 39 | It("var testContainer []*testScanSliceStruct", func() { 40 | var slice []*testScanSliceStruct 41 | err := ScanSlice(data, &slice) 42 | Expect(err).NotTo(HaveOccurred()) 43 | Expect(slice).To(Equal([]*testScanSliceStruct{ 44 | {-1, "Back Yu"}, 45 | {1, "szyhf"}, 46 | })) 47 | }) 48 | }) 49 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import "github.com/go-redis/redis/internal/util" 4 | 5 | func ToLower(s string) string { 6 | if isLower(s) { 7 | return s 8 | } 9 | 10 | b := make([]byte, len(s)) 11 | for i := range b { 12 | c := s[i] 13 | if c >= 'A' && c <= 'Z' { 14 | c += 'a' - 'A' 15 | } 16 | b[i] = c 17 | } 18 | return util.BytesToString(b) 19 | } 20 | 21 | func isLower(s string) bool { 22 | for i := 0; i < len(s); i++ { 23 | c := s[i] 24 | if c >= 'A' && c <= 'Z' { 25 | return false 26 | } 27 | } 28 | return true 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/safe.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package util 4 | 5 | func BytesToString(b []byte) string { 6 | return string(b) 7 | } 8 | 9 | func StringToBytes(s string) []byte { 10 | return []byte(s) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/strconv.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "strconv" 4 | 5 | func Atoi(b []byte) (int, error) { 6 | return strconv.Atoi(BytesToString(b)) 7 | } 8 | 9 | func ParseInt(b []byte, base int, bitSize int) (int64, error) { 10 | return strconv.ParseInt(BytesToString(b), base, bitSize) 11 | } 12 | 13 | func ParseUint(b []byte, base int, bitSize int) (uint64, error) { 14 | return strconv.ParseUint(BytesToString(b), base, bitSize) 15 | } 16 | 17 | func ParseFloat(b []byte, bitSize int) (float64, error) { 18 | return strconv.ParseFloat(BytesToString(b), bitSize) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package util 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // BytesToString converts byte slice to string. 10 | func BytesToString(b []byte) string { 11 | return *(*string)(unsafe.Pointer(&b)) 12 | } 13 | 14 | // StringToBytes converts string to byte slice. 15 | func StringToBytes(s string) []byte { 16 | return *(*[]byte)(unsafe.Pointer( 17 | &struct { 18 | string 19 | Cap int 20 | }{s, len(s)}, 21 | )) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/testdata/redis.conf: -------------------------------------------------------------------------------- 1 | # Minimal redis.conf 2 | 3 | port 6379 4 | daemonize no 5 | dir . 6 | save "" 7 | appendonly yes 8 | cluster-config-file nodes.conf 9 | cluster-node-timeout 30000 10 | maxclients 1001 -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/universal_test.go: -------------------------------------------------------------------------------- 1 | package redis_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "github.com/go-redis/redis" 8 | ) 9 | 10 | var _ = Describe("UniversalClient", func() { 11 | var client redis.UniversalClient 12 | 13 | AfterEach(func() { 14 | if client != nil { 15 | Expect(client.Close()).To(Succeed()) 16 | } 17 | }) 18 | 19 | It("should connect to failover servers", func() { 20 | client = redis.NewUniversalClient(&redis.UniversalOptions{ 21 | MasterName: sentinelName, 22 | Addrs: []string{":" + sentinelPort}, 23 | }) 24 | Expect(client.Ping().Err()).NotTo(HaveOccurred()) 25 | }) 26 | 27 | It("should connect to simple servers", func() { 28 | client = redis.NewUniversalClient(&redis.UniversalOptions{ 29 | Addrs: []string{redisAddr}, 30 | }) 31 | Expect(client.Ping().Err()).NotTo(HaveOccurred()) 32 | }) 33 | 34 | It("should connect to clusters", func() { 35 | client = redis.NewUniversalClient(&redis.UniversalOptions{ 36 | Addrs: cluster.addrs(), 37 | }) 38 | Expect(client.Ping().Err()).NotTo(HaveOccurred()) 39 | }) 40 | 41 | }) 42 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.github/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/go-sql-driver/mysql/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Issue description 2 | Tell us what should happen and what happens instead 3 | 4 | ### Example code 5 | ```go 6 | If possible, please enter some example code here to reproduce the issue. 7 | ``` 8 | 9 | ### Error log 10 | ``` 11 | If you have an error log, please paste it here. 12 | ``` 13 | 14 | ### Configuration 15 | *Driver version (or git SHA):* 16 | 17 | *Go version:* run `go version` in your console 18 | 19 | *Server version:* E.g. MySQL 5.6, MariaDB 10.0.20 20 | 21 | *Server OS:* E.g. Debian 8.1 (Jessie), Windows 10 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | Please explain the changes you made here. 3 | 4 | ### Checklist 5 | - [ ] Code compiles correctly 6 | - [ ] Created tests which fail without the change (if possible) 7 | - [ ] All tests passing 8 | - [ ] Extended the README / documentation, if necessary 9 | - [ ] Added myself / the copyright holder to the AUTHORS file 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | Icon? 7 | ehthumbs.db 8 | Thumbs.db 9 | .idea 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.travis/docker.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | user = gotest 3 | password = secret 4 | host = 127.0.0.1 5 | port = 3307 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.travis/gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | # Only check for go1.10+ since the gofmt style changed 5 | if [[ $(go version) =~ go1\.([0-9]+) ]] && ((${BASH_REMATCH[1]} >= 10)); then 6 | test -z "$(gofmt -d -s . | tee /dev/stderr)" 7 | fi 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.travis/wait_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while : 3 | do 4 | if mysql -e 'select version()' 2>&1 | grep 'version()\|ERROR 2059 (HY000):'; then 5 | break 6 | fi 7 | sleep 3 8 | done 9 | -------------------------------------------------------------------------------- /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 !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos 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/conncheck_test.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 linux darwin dragonfly freebsd netbsd openbsd solaris illumos 10 | 11 | package mysql 12 | 13 | import ( 14 | "testing" 15 | "time" 16 | ) 17 | 18 | func TestStaleConnectionChecks(t *testing.T) { 19 | runTests(t, dsn, func(dbt *DBTest) { 20 | dbt.mustExec("SET @@SESSION.wait_timeout = 2") 21 | 22 | if err := dbt.db.Ping(); err != nil { 23 | dbt.Fatal(err) 24 | } 25 | 26 | // wait for MySQL to close our connection 27 | time.Sleep(3 * time.Second) 28 | 29 | tx, err := dbt.db.Begin() 30 | if err != nil { 31 | dbt.Fatal(err) 32 | } 33 | 34 | if err := tx.Rollback(); err != nil { 35 | dbt.Fatal(err) 36 | } 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/connector_test.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "context" 5 | "net" 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func TestConnectorReturnsTimeout(t *testing.T) { 11 | connector := &connector{&Config{ 12 | Net: "tcp", 13 | Addr: "1.1.1.1:1234", 14 | Timeout: 10 * time.Millisecond, 15 | }} 16 | 17 | _, err := connector.Connect(context.Background()) 18 | if err == nil { 19 | t.Fatal("error expected") 20 | } 21 | 22 | if nerr, ok := err.(*net.OpError); ok { 23 | expected := "dial tcp 1.1.1.1:1234: i/o timeout" 24 | if nerr.Error() != expected { 25 | t.Fatalf("expected %q, got %q", expected, nerr.Error()) 26 | } 27 | } else { 28 | t.Fatalf("expected %T, got %T", nerr, err) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/errors_test.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 | "bytes" 13 | "log" 14 | "testing" 15 | ) 16 | 17 | func TestErrorsSetLogger(t *testing.T) { 18 | previous := errLog 19 | defer func() { 20 | errLog = previous 21 | }() 22 | 23 | // set up logger 24 | const expected = "prefix: test\n" 25 | buffer := bytes.NewBuffer(make([]byte, 0, 64)) 26 | logger := log.New(buffer, "prefix: ", 0) 27 | 28 | // print 29 | SetLogger(logger) 30 | errLog.Print("test") 31 | 32 | // check result 33 | if actual := buffer.String(); actual != expected { 34 | t.Errorf("expected %q, got %q", expected, actual) 35 | } 36 | } 37 | 38 | func TestErrorsStrictIgnoreNotes(t *testing.T) { 39 | runTests(t, dsn+"&sql_notes=false", func(dbt *DBTest) { 40 | dbt.mustExec("DROP TABLE IF EXISTS does_not_exist") 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/go-sql-driver/mysql 2 | 3 | go 1.10 4 | -------------------------------------------------------------------------------- /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/golang-sql/civil/README.md: -------------------------------------------------------------------------------- 1 | # Civil Date and Time 2 | 3 | [![GoDoc](https://godoc.org/github.com/golang-sql/civil?status.svg)](https://godoc.org/github.com/golang-sql/civil) 4 | 5 | Civil provides Date, Time of Day, and DateTime data types. 6 | 7 | While there are many uses, using specific types when working 8 | with databases make is conceptually eaiser to understand what value 9 | is set in the remote system. 10 | 11 | ## Source 12 | 13 | This civil package was extracted and forked from `cloud.google.com/go/civil`. 14 | As such the license and contributing requirements remain the same as that 15 | module. 16 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, Julien Laffaye 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/debug.go: -------------------------------------------------------------------------------- 1 | package ftp 2 | 3 | import "io" 4 | 5 | type debugWrapper struct { 6 | conn io.ReadWriteCloser 7 | io.Reader 8 | io.Writer 9 | } 10 | 11 | func newDebugWrapper(conn io.ReadWriteCloser, w io.Writer) io.ReadWriteCloser { 12 | return &debugWrapper{ 13 | Reader: io.TeeReader(conn, w), 14 | Writer: io.MultiWriter(w, conn), 15 | conn: conn, 16 | } 17 | } 18 | 19 | func (w *debugWrapper) Close() error { 20 | return w.conn.Close() 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jlaffaye/ftp 2 | 3 | go 1.13 4 | 5 | require github.com/stretchr/testify v1.4.0 6 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 4 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 5 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 6 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= 7 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 8 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 9 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 10 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 11 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 12 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/scanner_test.go: -------------------------------------------------------------------------------- 1 | package ftp 2 | 3 | import "testing" 4 | import "github.com/stretchr/testify/assert" 5 | 6 | func TestScanner(t *testing.T) { 7 | assert := assert.New(t) 8 | 9 | s := newScanner("foo bar x y") 10 | assert.Equal("foo", s.Next()) 11 | assert.Equal(" bar x y", s.Remaining()) 12 | assert.Equal("bar", s.Next()) 13 | assert.Equal("x y", s.Remaining()) 14 | assert.Equal("x", s.Next()) 15 | assert.Equal(" y", s.Remaining()) 16 | assert.Equal("y", s.Next()) 17 | assert.Equal("", s.Next()) 18 | assert.Equal("", s.Remaining()) 19 | } 20 | 21 | func TestScannerEmpty(t *testing.T) { 22 | assert := assert.New(t) 23 | 24 | s := newScanner("") 25 | assert.Equal("", s.Next()) 26 | assert.Equal("", s.Next()) 27 | assert.Equal("", s.Remaining()) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/jlaffaye/ftp/status_test.go: -------------------------------------------------------------------------------- 1 | package ftp 2 | 3 | import "testing" 4 | 5 | func TestValidStatusText(t *testing.T) { 6 | txt := StatusText(StatusInvalidCredentials) 7 | if txt == "" { 8 | t.Fatal("exptected status text, got empty string") 9 | } 10 | } 11 | 12 | func TestInvalidStatusText(t *testing.T) { 13 | txt := StatusText(0) 14 | if txt != "" { 15 | t.Fatalf("got status text %q, expected empty string", txt) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/lair-framework/go-nmap/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/lair-framework/go-nmap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Tom Steele 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/lair-framework/go-nmap/README.md: -------------------------------------------------------------------------------- 1 | gonmap 2 | ====== 3 | 4 | Nmap XML parsing library for Go 5 | 6 | ##Usage## 7 | http://godoc.org/github.com/tomsteele/go-nmap#Parse 8 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - master 7 | 8 | sudo: true 9 | 10 | env: 11 | global: 12 | - PGUSER=postgres 13 | - PQGOSSLTESTS=1 14 | - PQSSLCERTTEST_PATH=$PWD/certs 15 | - PGHOST=127.0.0.1 16 | matrix: 17 | - PGVERSION=10 18 | - PGVERSION=9.6 19 | - PGVERSION=9.5 20 | - PGVERSION=9.4 21 | 22 | before_install: 23 | - ./.travis.sh postgresql_uninstall 24 | - ./.travis.sh pgdg_repository 25 | - ./.travis.sh postgresql_install 26 | - ./.travis.sh postgresql_configure 27 | - ./.travis.sh client_configure 28 | - go get golang.org/x/tools/cmd/goimports 29 | - go get golang.org/x/lint/golint 30 | - GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@2019.2.1 31 | 32 | before_script: 33 | - createdb pqgotest 34 | - createuser -DRS pqgossltest 35 | - createuser -DRS pqgosslcert 36 | 37 | script: 38 | - > 39 | goimports -d -e $(find -name '*.go') | awk '{ print } END { exit NR == 0 ? 0 : 1 }' 40 | - go vet ./... 41 | - staticcheck -go 1.11 ./... 42 | - golint ./... 43 | - PQTEST_BINARY_PARAMETERS=no go test -race -v ./... 44 | - PQTEST_BINARY_PARAMETERS=yes go test -race -v ./... 45 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/TESTS.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | ## Running Tests 4 | 5 | `go test` is used for testing. A running PostgreSQL 6 | server is required, with the ability to log in. The 7 | database to connect to test with is "pqgotest," on 8 | "localhost" but these can be overridden using [environment 9 | variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html). 10 | 11 | Example: 12 | 13 | PGHOST=/run/postgresql go test 14 | 15 | ## Benchmarks 16 | 17 | A benchmark suite can be run as part of the tests: 18 | 19 | go test -bench . 20 | 21 | ## Example setup (Docker) 22 | 23 | Run a postgres container: 24 | 25 | ``` 26 | docker run --expose 5432:5432 postgres 27 | ``` 28 | 29 | Run tests: 30 | 31 | ``` 32 | PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test 33 | ``` 34 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/buf_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import "testing" 4 | 5 | func Benchmark_writeBuf_string(b *testing.B) { 6 | var buf writeBuf 7 | const s = "foo" 8 | 9 | b.ReportAllocs() 10 | b.ResetTimer() 11 | 12 | for i := 0; i < b.N; i++ { 13 | buf.string(s) 14 | buf.buf = buf.buf[:0] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/README: -------------------------------------------------------------------------------- 1 | This directory contains certificates and private keys for testing some 2 | SSL-related functionality in Travis. Do NOT use these certificates for 3 | anything other than testing. 4 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/bogus_root.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBjCCAe6gAwIBAgIQSnDYp/Naet9HOZljF5PuwDANBgkqhkiG9w0BAQsFADAr 3 | MRIwEAYDVQQKEwlDb2Nrcm9hY2gxFTATBgNVBAMTDENvY2tyb2FjaCBDQTAeFw0x 4 | NjAyMDcxNjQ0MzdaFw0xNzAyMDYxNjQ0MzdaMCsxEjAQBgNVBAoTCUNvY2tyb2Fj 5 | aDEVMBMGA1UEAxMMQ29ja3JvYWNoIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A 6 | MIIBCgKCAQEAxdln3/UdgP7ayA/G1kT7upjLe4ERwQjYQ25q0e1+vgsB5jhiirxJ 7 | e0+WkhhYu/mwoSAXzvlsbZ2PWFyfdanZeD/Lh6SvIeWXVVaPcWVWL1TEcoN2jr5+ 8 | E85MMHmbbmaT2he8s6br2tM/UZxyTQ2XRprIzApbDssyw1c0Yufcpu3C6267FLEl 9 | IfcWrzDhnluFhthhtGXv3ToD8IuMScMC5qlKBXtKmD1B5x14ngO/ecNJ+OlEi0HU 10 | mavK4KWgI2rDXRZ2EnCpyTZdkc3kkRnzKcg653oOjMDRZdrhfIrha+Jq38ACsUmZ 11 | Su7Sp5jkIHOCO8Zg+l6GKVSq37dKMapD8wIDAQABoyYwJDAOBgNVHQ8BAf8EBAMC 12 | AuQwEgYDVR0TAQH/BAgwBgEB/wIBATANBgkqhkiG9w0BAQsFAAOCAQEAwZ2Tu0Yu 13 | rrSVdMdoPEjT1IZd+5OhM/SLzL0ddtvTithRweLHsw2lDQYlXFqr24i3UGZJQ1sp 14 | cqSrNwswgLUQT3vWyTjmM51HEb2vMYWKmjZ+sBQYAUP1CadrN/+OTfNGnlF1+B4w 15 | IXOzh7EvQmJJnNybLe4a/aRvj1NE2n8Z898B76SVU9WbfKKz8VwLzuIPDqkKcZda 16 | lMy5yzthyztV9YjcWs2zVOUGZvGdAhDrvZuUq6mSmxrBEvR2LBOggmVf3tGRT+Ls 17 | lW7c9Lrva5zLHuqmoPP07A+vuI9a0D1X44jwGDuPWJ5RnTOQ63Uez12mKNjqleHw 18 | DnkwNanuO8dhAA== 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/postgresql.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0 3 | WAKy55RYwejlu9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+ 4 | bE0rlJc8VbzR0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQAB 5 | AoGAM5dM6/kp9P700i8qjOgRPym96Zoh5nGfz/rIE5z/r36NBkdvIg8OVZfR96nH 6 | b0b9TOMR5lsPp0sI9yivTWvX6qyvLJRWy2vvx17hXK9NxXUNTAm0PYZUTvCtcPeX 7 | RnJpzQKNZQPkFzF0uXBc4CtPK2Vz0+FGvAelrhYAxnw1dIkCQQD+9qaW5QhXjsjb 8 | Nl85CmXgxPmGROcgLQCO+omfrjf9UXrituU9Dz6auym5lDGEdMFnkzfr+wpasEy9 9 | mf5ZZOhDAkEA5HjXfVGaCtpydOt6hDon/uZsyssCK2lQ7NSuE3vP+sUsYMzIpEoy 10 | t3VWXqKbo+g9KNDTP4WEliqp1aiSIylzzQJANPeqzihQnlgEdD4MdD4rwhFJwVIp 11 | Le8Lcais1KaN7StzOwxB/XhgSibd2TbnPpw+3bSg5n5lvUdo+e62/31OHwJAU1jS 12 | I+F09KikQIr28u3UUWT2IzTT4cpVv1AHAQyV3sG3YsjSGT0IK20eyP9BEBZU2WL0 13 | 7aNjrvR5aHxKc5FXsQJABsFtyGpgI5X4xufkJZVZ+Mklz2n7iXa+XPatMAHFxAtb 14 | EEMt60rngwMjXAzBSC6OYuYogRRAY3UCacNC5VhLYQ== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/connector_example_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package pq_test 4 | 5 | import ( 6 | "database/sql" 7 | "fmt" 8 | 9 | "github.com/lib/pq" 10 | ) 11 | 12 | func ExampleNewConnector() { 13 | name := "" 14 | connector, err := pq.NewConnector(name) 15 | if err != nil { 16 | fmt.Println(err) 17 | return 18 | } 19 | db := sql.OpenDB(connector) 20 | defer db.Close() 21 | 22 | // Use the DB 23 | txn, err := db.Begin() 24 | if err != nil { 25 | fmt.Println(err) 26 | return 27 | } 28 | txn.Rollback() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lib/pq 2 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/issues_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import "testing" 4 | 5 | func TestIssue494(t *testing.T) { 6 | db := openTestConn(t) 7 | defer db.Close() 8 | 9 | query := `CREATE TEMP TABLE t (i INT PRIMARY KEY)` 10 | if _, err := db.Exec(query); err != nil { 11 | t.Fatal(err) 12 | } 13 | 14 | txn, err := db.Begin() 15 | if err != nil { 16 | t.Fatal(err) 17 | } 18 | 19 | if _, err := txn.Prepare(CopyIn("t", "i")); err != nil { 20 | t.Fatal(err) 21 | } 22 | 23 | if _, err := txn.Query("SELECT 1"); err == nil { 24 | t.Fatal("expected error") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_permissions.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pq 4 | 5 | import "os" 6 | 7 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 8 | // The key file should have very little access. 9 | // 10 | // libpq does not check key file permissions on Windows. 11 | func sslKeyPermissions(sslkey string) error { 12 | info, err := os.Stat(sslkey) 13 | if err != nil { 14 | return err 15 | } 16 | if info.Mode().Perm()&0077 != 0 { 17 | return ErrSSLKeyHasWorldPermissions 18 | } 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pq 4 | 5 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 6 | // The key file should have very little access. 7 | // 8 | // libpq does not check key file permissions on Windows. 9 | func sslKeyPermissions(string) error { return nil } 10 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "reflect" 5 | "strings" 6 | "testing" 7 | ) 8 | 9 | func TestDecodeUUIDBinaryError(t *testing.T) { 10 | t.Parallel() 11 | _, err := decodeUUIDBinary([]byte{0x12, 0x34}) 12 | 13 | if err == nil { 14 | t.Fatal("Expected error, got none") 15 | } 16 | if !strings.HasPrefix(err.Error(), "pq:") { 17 | t.Errorf("Expected error to start with %q, got %q", "pq:", err.Error()) 18 | } 19 | if !strings.Contains(err.Error(), "bad length: 2") { 20 | t.Errorf("Expected error to contain length, got %q", err.Error()) 21 | } 22 | } 23 | 24 | func BenchmarkDecodeUUIDBinary(b *testing.B) { 25 | x := []byte{0x03, 0xa3, 0x52, 0x2f, 0x89, 0x28, 0x49, 0x87, 0x84, 0xd6, 0x93, 0x7b, 0x36, 0xec, 0x27, 0x6f} 26 | 27 | for i := 0; i < b.N; i++ { 28 | decodeUUIDBinary(x) 29 | } 30 | } 31 | 32 | func TestDecodeUUIDBackend(t *testing.T) { 33 | db := openTestConn(t) 34 | defer db.Close() 35 | 36 | var s = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a" 37 | var scanned interface{} 38 | 39 | err := db.QueryRow(`SELECT $1::uuid`, s).Scan(&scanned) 40 | if err != nil { 41 | t.Fatalf("Expected no error, got %v", err) 42 | } 43 | if !reflect.DeepEqual(scanned, []byte(s)) { 44 | t.Errorf("Expected []byte(%q), got %T(%q)", s, scanned, scanned) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/.gitignore: -------------------------------------------------------------------------------- 1 | .root 2 | *_easyjson.go 3 | *.iml 4 | .idea 5 | *.swp 6 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | - stable 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | 11 | install: 12 | - go get golang.org/x/lint/golint 13 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Mail.Ru Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/benchmark/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test -benchmem -bench . 3 | go test -benchmem -tags use_ffjson -bench . 4 | go test -benchmem -tags use_jsoniter -bench . 5 | go test -benchmem -tags use_codec -bench . 6 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/benchmark/dummy_test.go: -------------------------------------------------------------------------------- 1 | package benchmark 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | type DummyWriter struct{} 8 | 9 | func (w DummyWriter) Write(data []byte) (int, error) { return len(data), nil } 10 | 11 | func TestToSuppressNoTestsWarning(t *testing.T) {} 12 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/benchmark/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mailru/easyjson/benchmark 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/json-iterator/go v1.1.7 7 | github.com/mailru/easyjson v0.0.0 8 | github.com/pquerna/ffjson v0.0.0-20190813045741-dac163c6c0a9 9 | github.com/ugorji/go/codec v1.1.7 10 | github.com/ugorji/go/codec/codecgen v1.1.7 11 | golang.org/x/tools v0.0.0-20190829051458-42f498d34c4d // indirect 12 | ) 13 | 14 | replace github.com/mailru/easyjson => ../ 15 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/benchmark/tools.go: -------------------------------------------------------------------------------- 1 | //+build tools 2 | 3 | // Package tools tracks dependencies on binaries not otherwise referenced in the codebase. 4 | // https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module 5 | package tools 6 | 7 | import ( 8 | _ "github.com/ugorji/go/codec/codecgen" 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/benchmark/ujson.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | echo -n "Python ujson module, DECODE: " 4 | python -m timeit -s "import ujson; data = open('`dirname $0`/example.json', 'r').read()" 'ujson.loads(data)' 5 | 6 | echo -n "Python ujson module, ENCODE: " 7 | python -m timeit -s "import ujson; data = open('`dirname $0`/example.json', 'r').read(); obj = ujson.loads(data)" 'ujson.dumps(obj)' 8 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mailru/easyjson 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/bytestostr.go: -------------------------------------------------------------------------------- 1 | // This file will only be included to the build if neither 2 | // easyjson_nounsafe nor appengine build tag is set. See README notes 3 | // for more details. 4 | 5 | //+build !easyjson_nounsafe 6 | //+build !appengine 7 | 8 | package jlexer 9 | 10 | import ( 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | // bytesToStr creates a string pointing at the slice to avoid copying. 16 | // 17 | // Warning: the string returned by the function should be used with care, as the whole input data 18 | // chunk may be either blocked from being freed by GC because of a single string or the buffer.Data 19 | // may be garbage-collected even when the string exists. 20 | func bytesToStr(data []byte) string { 21 | h := (*reflect.SliceHeader)(unsafe.Pointer(&data)) 22 | shdr := reflect.StringHeader{Data: h.Data, Len: h.Len} 23 | return *(*string)(unsafe.Pointer(&shdr)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go: -------------------------------------------------------------------------------- 1 | // This file is included to the build if any of the buildtags below 2 | // are defined. Refer to README notes for more details. 3 | 4 | //+build easyjson_nounsafe appengine 5 | 6 | package jlexer 7 | 8 | // bytesToStr creates a string normally from []byte 9 | // 10 | // Note that this method is roughly 1.5x slower than using the 'unsafe' method. 11 | func bytesToStr(data []byte) string { 12 | return string(data) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/error.go: -------------------------------------------------------------------------------- 1 | package jlexer 2 | 3 | import "fmt" 4 | 5 | // LexerError implements the error interface and represents all possible errors that can be 6 | // generated during parsing the JSON data. 7 | type LexerError struct { 8 | Reason string 9 | Offset int 10 | Data string 11 | } 12 | 13 | func (l *LexerError) Error() string { 14 | return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/custom_map_key_type.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import fmt "fmt" 4 | 5 | //easyjson:json 6 | type CustomMapKeyType struct { 7 | Map map[customKeyType]int 8 | } 9 | 10 | type customKeyType [2]byte 11 | 12 | func (k customKeyType) MarshalJSON() ([]byte, error) { 13 | return []byte(fmt.Sprintf(`"%02x"`, k)), nil 14 | } 15 | 16 | func (k *customKeyType) UnmarshalJSON(b []byte) error { 17 | _, err := fmt.Sscanf(string(b), `"%02x%02x"`, &k[0], &k[1]) 18 | return err 19 | } 20 | 21 | var customMapKeyTypeValue CustomMapKeyType 22 | 23 | func init() { 24 | customMapKeyTypeValue.Map = map[customKeyType]int{ 25 | customKeyType{0x01, 0x02}: 3, 26 | } 27 | } 28 | 29 | var customMapKeyTypeValueString = `{"Map":{"0102":3}}` 30 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/disallow_unknown.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type DisallowUnknown struct { 5 | FieldOne string `json:"field_one"` 6 | } 7 | 8 | var disallowUnknownString = `{"field_one": "one", "field_two": "two"}` 9 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/embedded_type.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type EmbeddedType struct { 5 | EmbeddedInnerType 6 | Inner struct { 7 | EmbeddedInnerType 8 | } 9 | Field2 int 10 | EmbeddedInnerType2 `json:"named"` 11 | } 12 | 13 | type EmbeddedInnerType struct { 14 | Field1 int 15 | } 16 | 17 | type EmbeddedInnerType2 struct { 18 | Field3 int 19 | } 20 | 21 | var embeddedTypeValue EmbeddedType 22 | 23 | func init() { 24 | embeddedTypeValue.Field1 = 1 25 | embeddedTypeValue.Field2 = 2 26 | embeddedTypeValue.Inner.Field1 = 3 27 | embeddedTypeValue.Field3 = 4 28 | } 29 | 30 | var embeddedTypeValueString = `{"Inner":{"Field1":3},"Field2":2,"named":{"Field3":4},"Field1":1}` 31 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/errors.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type ErrorIntSlice []int 5 | 6 | //easyjson:json 7 | type ErrorBoolSlice []bool 8 | 9 | //easyjson:json 10 | type ErrorUintSlice []uint 11 | 12 | //easyjson:json 13 | type ErrorStruct struct { 14 | Int int `json:"int"` 15 | String string `json:"string"` 16 | Slice []int `json:"slice"` 17 | IntSlice []int `json:"int_slice"` 18 | } 19 | 20 | type ErrorNestedStruct struct { 21 | ErrorStruct ErrorStruct `json:"error_struct"` 22 | Int int `json:"int"` 23 | } 24 | 25 | //easyjson:json 26 | type ErrorIntMap map[uint32]string 27 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/key_marshaler_map.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | type KeyWithEncodingMarshaler int 4 | 5 | func (f KeyWithEncodingMarshaler) MarshalText() (text []byte, err error) { 6 | return []byte("hello"), nil 7 | } 8 | 9 | func (f *KeyWithEncodingMarshaler) UnmarshalText(text []byte) error { 10 | if string(text) == "hello" { 11 | *f = 5 12 | } 13 | return nil 14 | } 15 | 16 | //easyjson:json 17 | type KeyWithEncodingMarshalers map[KeyWithEncodingMarshaler]string 18 | 19 | var mapWithEncodingMarshaler KeyWithEncodingMarshalers = KeyWithEncodingMarshalers{5: "hello"} 20 | var mapWithEncodingMarshalerString = `{"hello":"hello"}` 21 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/named_type.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type NamedType struct { 5 | Inner struct { 6 | // easyjson is mistakenly naming the type of this field 'tests.MyString' in the generated output 7 | // something about a named type inside an anonmymous type is triggering this bug 8 | Field MyString `tag:"value"` 9 | Field2 int "tag:\"value with ` in it\"" 10 | } 11 | } 12 | 13 | type MyString string 14 | 15 | var namedTypeValue NamedType 16 | 17 | func init() { 18 | namedTypeValue.Inner.Field = "test" 19 | namedTypeValue.Inner.Field2 = 123 20 | } 21 | 22 | var namedTypeValueString = `{"Inner":{"Field":"test","Field2":123}}` 23 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/nested_easy.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "github.com/mailru/easyjson" 5 | "github.com/mailru/easyjson/jwriter" 6 | ) 7 | 8 | //easyjson:json 9 | type NestedInterfaces struct { 10 | Value interface{} 11 | Slice []interface{} 12 | Map map[string]interface{} 13 | } 14 | 15 | type NestedEasyMarshaler struct { 16 | EasilyMarshaled bool 17 | } 18 | 19 | var _ easyjson.Marshaler = &NestedEasyMarshaler{} 20 | 21 | func (i *NestedEasyMarshaler) MarshalEasyJSON(w *jwriter.Writer) { 22 | // We use this method only to indicate that easyjson.Marshaler 23 | // interface was really used while encoding. 24 | i.EasilyMarshaled = true 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/nothing.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | // No structs in this file 4 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/omitempty.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type OmitEmptyDefault struct { 5 | Field string 6 | Str string 7 | Str1 string `json:"s,!omitempty"` 8 | Str2 string `json:",!omitempty"` 9 | } 10 | 11 | var omitEmptyDefaultValue = OmitEmptyDefault{Field: "test"} 12 | var omitEmptyDefaultString = `{"Field":"test","s":"","Str2":""}` 13 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/reference_to_pointer.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | type Struct1 struct { 4 | } 5 | 6 | //easyjson:json 7 | type Struct2 struct { 8 | From *Struct1 `json:"from,omitempty"` 9 | Through *Struct1 `json:"through,omitempty"` 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/required_test.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestRequiredField(t *testing.T) { 9 | cases := []struct{ json, errorMessage string }{ 10 | {`{"first_name":"Foo", "last_name": "Bar"}`, ""}, 11 | {`{"last_name":"Bar"}`, "key 'first_name' is required"}, 12 | {"{}", "key 'first_name' is required"}, 13 | } 14 | 15 | for _, tc := range cases { 16 | var v RequiredOptionalStruct 17 | err := v.UnmarshalJSON([]byte(tc.json)) 18 | if tc.errorMessage == "" { 19 | if err != nil { 20 | t.Errorf("%s. UnmarshalJSON didn`t expect error: %v", tc.json, err) 21 | } 22 | } else { 23 | if fmt.Sprintf("%v", err) != tc.errorMessage { 24 | t.Errorf("%s. UnmarshalJSON expected error: %v. got: %v", tc.json, tc.errorMessage, err) 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/tests/snake.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | //easyjson:json 4 | type SnakeStruct struct { 5 | WeirdHTTPStuff bool 6 | CustomNamedField string `json:"cUsToM"` 7 | } 8 | 9 | var snakeStructValue SnakeStruct 10 | var snakeStructString = `{"weird_http_stuff":false,"cUsToM":""}` 11 | -------------------------------------------------------------------------------- /vendor/github.com/netxfly/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | Icon? 7 | ehthumbs.db 8 | Thumbs.db 9 | .idea 10 | -------------------------------------------------------------------------------- /vendor/github.com/netxfly/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/netxfly/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/netxfly/mysql/connection_go18_test.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build go1.8 10 | 11 | package mysql 12 | 13 | import ( 14 | "database/sql/driver" 15 | "testing" 16 | ) 17 | 18 | func TestCheckNamedValue(t *testing.T) { 19 | value := driver.NamedValue{Value: ^uint64(0)} 20 | x := &mysqlConn{} 21 | err := x.CheckNamedValue(&value) 22 | 23 | if err != nil { 24 | t.Fatal("uint64 high-bit not convertible", err) 25 | } 26 | 27 | if value.Value != "18446744073709551615" { 28 | t.Fatalf("uint64 high-bit not converted, got %#v %T", value.Value, value.Value) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/netxfly/mysql/errors_test.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 | "bytes" 13 | "log" 14 | "testing" 15 | ) 16 | 17 | func TestErrorsSetLogger(t *testing.T) { 18 | previous := errLog 19 | defer func() { 20 | errLog = previous 21 | }() 22 | 23 | // set up logger 24 | const expected = "prefix: test\n" 25 | buffer := bytes.NewBuffer(make([]byte, 0, 64)) 26 | logger := log.New(buffer, "prefix: ", 0) 27 | 28 | // print 29 | SetLogger(logger) 30 | errLog.Print("test") 31 | 32 | // check result 33 | if actual := buffer.String(); actual != expected { 34 | t.Errorf("expected %q, got %q", expected, actual) 35 | } 36 | } 37 | 38 | func TestErrorsStrictIgnoreNotes(t *testing.T) { 39 | runTests(t, dsn+"&sql_notes=false", func(dbt *DBTest) { 40 | dbt.mustExec("DROP TABLE IF EXISTS does_not_exist") 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/netxfly/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/netxfly/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/olivere/elastic/CHANGELOG-6.0.md: -------------------------------------------------------------------------------- 1 | # Changes from 5.0 to 6.0 2 | 3 | See [breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-6.0.html). 4 | 5 | ## _all removed 6 | 7 | 6.0 has removed support for the `_all` field. 8 | 9 | ## Boolean values coerced 10 | 11 | Only use `true` or `false` for boolean values, not `0` or `1` or `on` or `off`. 12 | 13 | ## Single Type Indices 14 | 15 | Notice that 6.0 and future versions will default to single type indices, i.e. you may not use multiple types when e.g. adding an index with a mapping. 16 | 17 | See [here for details](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/removal-of-types.html#_what_are_mapping_types). 18 | 19 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please use the following questions as a guideline to help me answer 2 | your issue/question without further inquiry. Thank you. 3 | 4 | ### Which version of Elastic are you using? 5 | 6 | [ ] elastic.v2 (for Elasticsearch 1.x) 7 | [ ] elastic.v3 (for Elasticsearch 2.x) 8 | [ ] elastic.v5 (for Elasticsearch 5.x) 9 | [ ] elastic.v6 (for Elasticsearch 6.x) 10 | 11 | ### Please describe the expected behavior 12 | 13 | 14 | ### Please describe the actual behavior 15 | 16 | 17 | ### Any steps to reproduce the behavior? 18 | 19 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2012-2015 Oliver Eilhard 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/acknowledged_response.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // AcknowledgedResponse is returned from various APIs. It simply indicates 8 | // whether the operation is ack'd or not. 9 | type AcknowledgedResponse struct { 10 | Acknowledged bool `json:"acknowledged"` 11 | ShardsAcknowledged bool `json:"shards_acknowledged"` 12 | Index string `json:"index,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/bulk_request.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // -- Bulkable request (index/update/delete) -- 12 | 13 | // BulkableRequest is a generic interface to bulkable requests. 14 | type BulkableRequest interface { 15 | fmt.Stringer 16 | Source() ([]string, error) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/canonicalize.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "net/url" 8 | 9 | // canonicalize takes a list of URLs and returns its canonicalized form, i.e. 10 | // remove anything but scheme, userinfo, host, path, and port. 11 | // It also removes all trailing slashes. Invalid URLs or URLs that do not 12 | // use protocol http or https are skipped. 13 | // 14 | // Example: 15 | // http://127.0.0.1:9200/?query=1 -> http://127.0.0.1:9200 16 | // http://127.0.0.1:9200/db1/ -> http://127.0.0.1:9200/db1 17 | func canonicalize(rawurls ...string) []string { 18 | var canonicalized []string 19 | for _, rawurl := range rawurls { 20 | u, err := url.Parse(rawurl) 21 | if err == nil { 22 | if u.Scheme == "http" || u.Scheme == "https" { 23 | // Trim trailing slashes 24 | for len(u.Path) > 0 && u.Path[len(u.Path)-1] == '/' { 25 | u.Path = u.Path[0 : len(u.Path)-1] 26 | } 27 | u.Fragment = "" 28 | u.RawQuery = "" 29 | canonicalized = append(canonicalized, u.String()) 30 | } 31 | } 32 | } 33 | return canonicalized 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/config/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | /* 6 | Package config allows parsing a configuration for Elasticsearch 7 | from a URL. 8 | */ 9 | package config 10 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/decoder.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | ) 10 | 11 | // Decoder is used to decode responses from Elasticsearch. 12 | // Users of elastic can implement their own marshaler for advanced purposes 13 | // and set them per Client (see SetDecoder). If none is specified, 14 | // DefaultDecoder is used. 15 | type Decoder interface { 16 | Decode(data []byte, v interface{}) error 17 | } 18 | 19 | // DefaultDecoder uses json.Unmarshal from the Go standard library 20 | // to decode JSON data. 21 | type DefaultDecoder struct{} 22 | 23 | // Decode decodes with json.Unmarshal from the Go standard library. 24 | func (u *DefaultDecoder) Decode(data []byte, v interface{}) error { 25 | return json.Unmarshal(data, v) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | elasticsearch: 5 | image: docker.elastic.co/elasticsearch/elasticsearch:6.0.0 6 | # container_name: elasticsearch 7 | hostname: elasticsearch 8 | environment: 9 | - "ES_JAVA_OPTS=-Xms1g -Xmx1g" 10 | - bootstrap.memory_lock=true 11 | - xpack.security.enabled=false 12 | - xpack.monitoring.enabled=false 13 | - xpack.ml.enabled=false 14 | - xpack.graph.enabled=false 15 | - xpack.watcher.enabled=false 16 | ulimits: 17 | nproc: 65536 18 | nofile: 19 | soft: 65536 20 | hard: 65536 21 | memlock: 22 | soft: -1 23 | hard: -1 24 | volumes: 25 | - ./etc:/usr/share/elasticsearch/config 26 | ports: 27 | - 9200:9200 28 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Logger specifies the interface for all log operations. 8 | type Logger interface { 9 | Printf(format string, v ...interface{}) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/plugins.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "context" 8 | 9 | // HasPlugin indicates whether the cluster has the named plugin. 10 | func (c *Client) HasPlugin(name string) (bool, error) { 11 | plugins, err := c.Plugins() 12 | if err != nil { 13 | return false, nil 14 | } 15 | for _, plugin := range plugins { 16 | if plugin == name { 17 | return true, nil 18 | } 19 | } 20 | return false, nil 21 | } 22 | 23 | // Plugins returns the list of all registered plugins. 24 | func (c *Client) Plugins() ([]string, error) { 25 | stats, err := c.ClusterStats().Do(context.Background()) 26 | if err != nil { 27 | return nil, err 28 | } 29 | if stats == nil { 30 | return nil, err 31 | } 32 | if stats.Nodes == nil { 33 | return nil, err 34 | } 35 | var plugins []string 36 | for _, plugin := range stats.Nodes.Plugins { 37 | plugins = append(plugins, plugin.Name) 38 | } 39 | return plugins, nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Query represents the generic query interface. A query's sole purpose 8 | // is to return the source of the query as a JSON-serializable object. 9 | // Returning map[string]interface{} is the norm for queries. 10 | type Query interface { 11 | // Source returns the JSON-serializable query request. 12 | Source() (interface{}, error) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/rescore.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | type Rescore struct { 8 | rescorer Rescorer 9 | windowSize *int 10 | defaultRescoreWindowSize *int 11 | } 12 | 13 | func NewRescore() *Rescore { 14 | return &Rescore{} 15 | } 16 | 17 | func (r *Rescore) WindowSize(windowSize int) *Rescore { 18 | r.windowSize = &windowSize 19 | return r 20 | } 21 | 22 | func (r *Rescore) IsEmpty() bool { 23 | return r.rescorer == nil 24 | } 25 | 26 | func (r *Rescore) Rescorer(rescorer Rescorer) *Rescore { 27 | r.rescorer = rescorer 28 | return r 29 | } 30 | 31 | func (r *Rescore) Source() (interface{}, error) { 32 | source := make(map[string]interface{}) 33 | if r.windowSize != nil { 34 | source["window_size"] = *r.windowSize 35 | } else if r.defaultRescoreWindowSize != nil { 36 | source["window_size"] = *r.defaultRescoreWindowSize 37 | } 38 | rescorerSrc, err := r.rescorer.Source() 39 | if err != nil { 40 | return nil, err 41 | } 42 | source[r.rescorer.Name()] = rescorerSrc 43 | return source, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/response.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | "io/ioutil" 10 | "net/http" 11 | ) 12 | 13 | // Response represents a response from Elasticsearch. 14 | type Response struct { 15 | // StatusCode is the HTTP status code, e.g. 200. 16 | StatusCode int 17 | // Header is the HTTP header from the HTTP response. 18 | // Keys in the map are canonicalized (see http.CanonicalHeaderKey). 19 | Header http.Header 20 | // Body is the deserialized response body. 21 | Body json.RawMessage 22 | } 23 | 24 | // newResponse creates a new response from the HTTP response. 25 | func (c *Client) newResponse(res *http.Response) (*Response, error) { 26 | r := &Response{ 27 | StatusCode: res.StatusCode, 28 | Header: res.Header, 29 | } 30 | if res.Body != nil { 31 | slurp, err := ioutil.ReadAll(res.Body) 32 | if err != nil { 33 | return nil, err 34 | } 35 | // HEAD requests return a body but no content 36 | if len(slurp) > 0 { 37 | r.Body = json.RawMessage(slurp) 38 | } 39 | } 40 | return r, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/run-es.sh: -------------------------------------------------------------------------------- 1 | docker run --rm -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:6.0.0 elasticsearch -Expack.security.enabled=false -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ 2 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/search_queries_match_none.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // MatchNoneQuery returns no documents. It is the inverse of 8 | // MatchAllQuery. 9 | // 10 | // For more details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-match-all-query.html 12 | type MatchNoneQuery struct { 13 | queryName string 14 | } 15 | 16 | // NewMatchNoneQuery creates and initializes a new match none query. 17 | func NewMatchNoneQuery() *MatchNoneQuery { 18 | return &MatchNoneQuery{} 19 | } 20 | 21 | // QueryName sets the query name. 22 | func (q *MatchNoneQuery) QueryName(name string) *MatchNoneQuery { 23 | q.queryName = name 24 | return q 25 | } 26 | 27 | // Source returns JSON for the match none query. 28 | func (q MatchNoneQuery) Source() (interface{}, error) { 29 | // { 30 | // "match_none" : { ... } 31 | // } 32 | source := make(map[string]interface{}) 33 | params := make(map[string]interface{}) 34 | source["match_none"] = params 35 | if q.queryName != "" { 36 | params["_name"] = q.queryName 37 | } 38 | return source, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/search_queries_raw_string.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard, John Stanford. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "encoding/json" 8 | 9 | // RawStringQuery can be used to treat a string representation of an ES query 10 | // as a Query. Example usage: 11 | // q := RawStringQuery("{\"match_all\":{}}") 12 | // db.Search().Query(q).From(1).Size(100).Do() 13 | type RawStringQuery string 14 | 15 | // NewRawStringQuery ininitializes a new RawStringQuery. 16 | // It is the same as RawStringQuery(q). 17 | func NewRawStringQuery(q string) RawStringQuery { 18 | return RawStringQuery(q) 19 | } 20 | 21 | // Source returns the JSON encoded body 22 | func (q RawStringQuery) Source() (interface{}, error) { 23 | var f interface{} 24 | err := json.Unmarshal([]byte(q), &f) 25 | return f, err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/search_queries_type.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TypeQuery filters documents matching the provided document / mapping type. 8 | // 9 | // For details, see: 10 | // https://www.elastic.co/guide/en/elasticsearch/reference/6.0/query-dsl-type-query.html 11 | type TypeQuery struct { 12 | typ string 13 | } 14 | 15 | func NewTypeQuery(typ string) *TypeQuery { 16 | return &TypeQuery{typ: typ} 17 | } 18 | 19 | // Source returns JSON for the query. 20 | func (q *TypeQuery) Source() (interface{}, error) { 21 | source := make(map[string]interface{}) 22 | params := make(map[string]interface{}) 23 | source["type"] = params 24 | params["value"] = q.typ 25 | return source, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/suggester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Represents the generic suggester interface. 8 | // A suggester's only purpose is to return the 9 | // source of the query as a JSON-serializable 10 | // object. Returning a map[string]interface{} 11 | // will do. 12 | type Suggester interface { 13 | Name() string 14 | Source(includeName bool) (interface{}, error) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/uritemplates/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Joshua Tacoma 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /vendor/github.com/olivere/elastic/uritemplates/utils.go: -------------------------------------------------------------------------------- 1 | package uritemplates 2 | 3 | func Expand(path string, expansions map[string]string) (string, error) { 4 | template, err := Parse(path) 5 | if err != nil { 6 | return "", err 7 | } 8 | values := make(map[string]interface{}) 9 | for k, v := range expansions { 10 | values[k] = v 11 | } 12 | return template.Expand(values) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: panjf2000 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Error messages/Trace logs** 24 | If applicable, add some logs to help explain your problem. 25 | 26 | **System info (please complete the following information):** 27 | - OS: [e.g. linux, macOS] 28 | - Go Version [e.g. 1.12] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: proposal 6 | assignees: panjf2000 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea 18 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.9.x" 5 | - "1.10.x" 6 | - "1.11.x" 7 | - "1.12.x" 8 | - "1.13.x" 9 | 10 | before_install: 11 | - go get -t -v ./... 12 | 13 | script: 14 | #- go test -cpu=16 -bench=. -benchmem=true -run=none ./... 15 | - go test -race -coverprofile=coverage.txt -covermode=atomic -v 16 | 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) 19 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## With issues: 4 | - Use the search tool before opening a new issue. 5 | - Please provide source code and commit sha if you found a bug. 6 | - Review existing issues and provide feedback or react to them. 7 | 8 | ## With pull requests: 9 | - Open your pull request against `master`. 10 | - Open one pull request for only one feature/proposal, if you have several those, please put them into different PRs, whereas you are allowed to open one pull request with several bug-fixs. 11 | - Your pull request should have no more than two commits, if not, you should squash them. 12 | - It should pass all tests in the available continuous integrations systems such as TravisCI. 13 | - You should add/modify tests to cover your proposed code changes. 14 | - If your pull request contains a new feature, please document it on the README. 15 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Andy Pan 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/panjf2000/ants/v2/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Andy Pan. All rights reserved. 2 | // Use of this source code is governed by an MIT-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Library ants implements a goroutine pool with fixed capacity, managing and recycling a massive number of goroutines, 7 | allowing developers to limit the number of goroutines in your concurrent programs. 8 | */ 9 | 10 | package ants 11 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/panjf2000/ants/v2 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/internal/spinlock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Andy Pan. All rights reserved. 2 | // Use of this source code is governed by an MIT-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "runtime" 9 | "sync" 10 | "sync/atomic" 11 | ) 12 | 13 | type spinLock uint32 14 | 15 | func (sl *spinLock) Lock() { 16 | for !atomic.CompareAndSwapUint32((*uint32)(sl), 0, 1) { 17 | runtime.Gosched() 18 | } 19 | } 20 | 21 | func (sl *spinLock) Unlock() { 22 | atomic.StoreUint32((*uint32)(sl), 0) 23 | } 24 | 25 | // NewSpinLock instantiates a spin-lock. 26 | func NewSpinLock() sync.Locker { 27 | return new(spinLock) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants/v2/worker_array.go: -------------------------------------------------------------------------------- 1 | package ants 2 | 3 | import ( 4 | "errors" 5 | "time" 6 | ) 7 | 8 | var ( 9 | // errQueueIsFull will be returned when the worker queue is full. 10 | errQueueIsFull = errors.New("the queue is full") 11 | 12 | // errQueueIsReleased will be returned when trying to insert item to a released worker queue. 13 | errQueueIsReleased = errors.New("the queue length is zero") 14 | ) 15 | 16 | type workerArray interface { 17 | len() int 18 | isEmpty() bool 19 | insert(worker *goWorker) error 20 | detach() *goWorker 21 | retrieveExpiry(duration time.Duration) []*goWorker 22 | reset() 23 | } 24 | 25 | type arrayType int 26 | 27 | const ( 28 | stackType arrayType = 1 << iota 29 | loopQueueType 30 | ) 31 | 32 | func newWorkerArray(aType arrayType, size int) workerArray { 33 | switch aType { 34 | case stackType: 35 | return newWorkerStack(size) 36 | case loopQueueType: 37 | return newWorkerLoopQueue(size) 38 | default: 39 | return newWorkerStack(size) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants@v1.3.0/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea 18 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants@v1.3.0/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.8.x" 5 | - "1.9.x" 6 | - "1.10.x" 7 | - "1.11.x" 8 | - "1.12.x" 9 | 10 | before_install: 11 | - go get -t -v ./... 12 | 13 | script: 14 | #- go test -cpu=16 -bench=. -benchmem=true -run=none ./... 15 | - go test -race -coverprofile=coverage.txt -covermode=atomic -v 16 | 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) 19 | -------------------------------------------------------------------------------- /vendor/github.com/panjf2000/ants@v1.3.0/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Andy Pan 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/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/Makefile: -------------------------------------------------------------------------------- 1 | PKGS := github.com/pkg/errors 2 | SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) 3 | GO := go 4 | 5 | check: test vet gofmt misspell unconvert staticcheck ineffassign unparam 6 | 7 | test: 8 | $(GO) test $(PKGS) 9 | 10 | vet: | test 11 | $(GO) vet $(PKGS) 12 | 13 | staticcheck: 14 | $(GO) get honnef.co/go/tools/cmd/staticcheck 15 | staticcheck -checks all $(PKGS) 16 | 17 | misspell: 18 | $(GO) get github.com/client9/misspell/cmd/misspell 19 | misspell \ 20 | -locale GB \ 21 | -error \ 22 | *.md *.go 23 | 24 | unconvert: 25 | $(GO) get github.com/mdempsky/unconvert 26 | unconvert -v $(PKGS) 27 | 28 | ineffassign: 29 | $(GO) get github.com/gordonklaus/ineffassign 30 | find $(SRCDIRS) -name '*.go' | xargs ineffassign 31 | 32 | pedantic: check errcheck 33 | 34 | unparam: 35 | $(GO) get mvdan.cc/unparam 36 | unparam ./... 37 | 38 | errcheck: 39 | $(GO) get github.com/kisielk/errcheck 40 | errcheck $(PKGS) 41 | 42 | gofmt: 43 | @echo Checking code is gofmted 44 | @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" 45 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/go113_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.13 2 | 3 | package errors 4 | 5 | import ( 6 | stdlib_errors "errors" 7 | "testing" 8 | ) 9 | 10 | func TestErrorChainCompat(t *testing.T) { 11 | err := stdlib_errors.New("error that gets wrapped") 12 | wrapped := Wrap(err, "wrapped up") 13 | if !stdlib_errors.Is(wrapped, err) { 14 | t.Errorf("Wrap does not support Go 1.13 error chains") 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/json_test.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import ( 4 | "encoding/json" 5 | "regexp" 6 | "testing" 7 | ) 8 | 9 | func TestFrameMarshalText(t *testing.T) { 10 | var tests = []struct { 11 | Frame 12 | want string 13 | }{{ 14 | initpc, 15 | `^github.com/pkg/errors\.init(\.ializers)? .+/github\.com/pkg/errors/stack_test.go:\d+$`, 16 | }, { 17 | 0, 18 | `^unknown$`, 19 | }} 20 | for i, tt := range tests { 21 | got, err := tt.Frame.MarshalText() 22 | if err != nil { 23 | t.Fatal(err) 24 | } 25 | if !regexp.MustCompile(tt.want).Match(got) { 26 | t.Errorf("test %d: MarshalJSON:\n got %q\n want %q", i+1, string(got), tt.want) 27 | } 28 | } 29 | } 30 | 31 | func TestFrameMarshalJSON(t *testing.T) { 32 | var tests = []struct { 33 | Frame 34 | want string 35 | }{{ 36 | initpc, 37 | `^"github\.com/pkg/errors\.init(\.ializers)? .+/github\.com/pkg/errors/stack_test.go:\d+"$`, 38 | }, { 39 | 0, 40 | `^"unknown"$`, 41 | }} 42 | for i, tt := range tests { 43 | got, err := json.Marshal(tt.Frame) 44 | if err != nil { 45 | t.Fatal(err) 46 | } 47 | if !regexp.MustCompile(tt.want).Match(got) { 48 | t.Errorf("test %d: MarshalJSON:\n got %q\n want %q", i+1, string(got), tt.want) 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | .idea 26 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 stacktitan 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/stacktitan/smb/README.md: -------------------------------------------------------------------------------- 1 | # SMB 2 | A Go package for communicating over SMB. Currently only minimal funcationality exists for client-side functions. 3 | 4 | Here is a sample client that establishes a session with a server: 5 | 6 | ```go 7 | package main 8 | 9 | import ( 10 | "log" 11 | 12 | "github.com/stacktitan/smb/smb" 13 | ) 14 | 15 | func main() { 16 | 17 | host := "172.16.248.192" 18 | options := smb.Options{ 19 | Host: host, 20 | Port: 445, 21 | User: "alice", 22 | Domain: "corp", 23 | Workstation: "", 24 | Password: "Password123!", 25 | } 26 | debug := false 27 | session, err := smb.NewSession(options, debug) 28 | if err != nil { 29 | log.Fatalln("[!]", err) 30 | } 31 | defer session.Close() 32 | 33 | if session.IsSigningRequired { 34 | log.Println("[-] Signing is required") 35 | } else { 36 | log.Println("[+] Signing is NOT required") 37 | } 38 | 39 | if session.IsAuthenticated { 40 | log.Println("[+] Login successful") 41 | } else { 42 | log.Println("[-] Login failed") 43 | } 44 | 45 | if err != nil { 46 | log.Fatalln("[!]", err) 47 | } 48 | } 49 | 50 | ``` 51 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/gss/oid.go: -------------------------------------------------------------------------------- 1 | package gss 2 | 3 | import ( 4 | "strconv" 5 | "strings" 6 | ) 7 | 8 | func ObjectIDStrToInt(oid string) ([]int, error) { 9 | ret := []int{} 10 | tokens := strings.Split(oid, ".") 11 | for _, token := range tokens { 12 | i, err := strconv.Atoi(token) 13 | if err != nil { 14 | return nil, err 15 | } 16 | ret = append(ret, i) 17 | } 18 | return ret, nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/ntlmssp/crypto.go: -------------------------------------------------------------------------------- 1 | package ntlmssp 2 | 3 | import ( 4 | "crypto/hmac" 5 | "crypto/md5" 6 | "strings" 7 | 8 | "github.com/stacktitan/smb/smb/encoder" 9 | "golang.org/x/crypto/md4" 10 | ) 11 | 12 | func Ntowfv1(pass string) []byte { 13 | hash := md4.New() 14 | hash.Write(encoder.ToUnicode(pass)) 15 | return hash.Sum(nil) 16 | } 17 | 18 | func Ntowfv2(pass, user, domain string) []byte { 19 | h := hmac.New(md5.New, Ntowfv1(pass)) 20 | h.Write(encoder.ToUnicode(strings.ToUpper(user) + domain)) 21 | return h.Sum(nil) 22 | } 23 | 24 | func Lmowfv2(pass, user, domain string) []byte { 25 | return Ntowfv2(pass, user, domain) 26 | } 27 | 28 | func ComputeResponseNTLMv2(nthash, lmhash, clientChallenge, serverChallenge, timestamp, serverName []byte) []byte { 29 | 30 | temp := []byte{1, 1} 31 | temp = append(temp, 0, 0, 0, 0, 0, 0) 32 | temp = append(temp, timestamp...) 33 | temp = append(temp, clientChallenge...) 34 | temp = append(temp, 0, 0, 0, 0) 35 | temp = append(temp, serverName...) 36 | temp = append(temp, 0, 0, 0, 0) 37 | 38 | h := hmac.New(md5.New, nthash) 39 | h.Write(append(serverChallenge, temp...)) 40 | ntproof := h.Sum(nil) 41 | return append(ntproof, temp...) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/ntlmssp/crypto_test.go: -------------------------------------------------------------------------------- 1 | package ntlmssp 2 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/ntlmssp/ntlmssp_test.go: -------------------------------------------------------------------------------- 1 | package ntlmssp 2 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/smb/encoder/encoder_test.go: -------------------------------------------------------------------------------- 1 | package encoder 2 | -------------------------------------------------------------------------------- /vendor/github.com/stacktitan/smb/smb/encoder/unicode.go: -------------------------------------------------------------------------------- 1 | package encoder 2 | 3 | import ( 4 | "bytes" 5 | "encoding/binary" 6 | "errors" 7 | "unicode/utf16" 8 | ) 9 | 10 | func FromUnicode(d []byte) (string, error) { 11 | // Credit to https://github.com/Azure/go-ntlmssp/blob/master/unicode.go for logic 12 | if len(d)%2 > 0 { 13 | return "", errors.New("Unicode (UTF 16 LE) specified, but uneven data length") 14 | } 15 | s := make([]uint16, len(d)/2) 16 | err := binary.Read(bytes.NewReader(d), binary.LittleEndian, &s) 17 | if err != nil { 18 | return "", err 19 | } 20 | return string(utf16.Decode(s)), nil 21 | } 22 | 23 | func ToUnicode(s string) []byte { 24 | // Credit to https://github.com/Azure/go-ntlmssp/blob/master/unicode.go for logic 25 | uints := utf16.Encode([]rune(s)) 26 | b := bytes.Buffer{} 27 | binary.Write(&b, binary.LittleEndian, &uints) 28 | return b.Bytes() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/README.md: -------------------------------------------------------------------------------- 1 | # Go Cryptography 2 | 3 | This repository holds supplementary Go cryptography libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You 8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit changes to 13 | this repository, see https://golang.org/doc/contribute.html. 14 | 15 | The main issue tracker for the crypto repository is located at 16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the 17 | subject line, so it is easy to find. 18 | 19 | Note that contributions to the cryptography package receive additional scrutiny 20 | due to their sensitive nature. Patches may take longer than normal to receive 21 | feedback. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/acme/autocert/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package autocert_test 6 | 7 | import ( 8 | "fmt" 9 | "log" 10 | "net/http" 11 | 12 | "golang.org/x/crypto/acme/autocert" 13 | ) 14 | 15 | func ExampleNewListener() { 16 | mux := http.NewServeMux() 17 | mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 18 | fmt.Fprintf(w, "Hello, TLS user! Your config: %+v", r.TLS) 19 | }) 20 | log.Fatal(http.Serve(autocert.NewListener("example.com"), mux)) 21 | } 22 | 23 | func ExampleManager() { 24 | m := &autocert.Manager{ 25 | Cache: autocert.DirCache("secret-dir"), 26 | Prompt: autocert.AcceptTOS, 27 | HostPolicy: autocert.HostWhitelist("example.org", "www.example.org"), 28 | } 29 | s := &http.Server{ 30 | Addr: ":https", 31 | TLSConfig: m.TLSConfig(), 32 | } 33 | s.ListenAndServeTLS("", "") 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/acme/version_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.12 6 | 7 | package acme 8 | 9 | import "runtime/debug" 10 | 11 | func init() { 12 | // Set packageVersion if the binary was built in modules mode and x/crypto 13 | // was not replaced with a different module. 14 | info, ok := debug.ReadBuildInfo() 15 | if !ok { 16 | return 17 | } 18 | for _, m := range info.Deps { 19 | if m.Path != "golang.org/x/crypto" { 20 | continue 21 | } 22 | if m.Replace == nil { 23 | packageVersion = m.Version 24 | } 25 | break 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/argon2/blamka_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package argon2 8 | 9 | func processBlock(out, in1, in2 *block) { 10 | processBlockGeneric(out, in1, in2, false) 11 | } 12 | 13 | func processBlockXOR(out, in1, in2 *block) { 14 | processBlockGeneric(out, in1, in2, true) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bcrypt/base64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useAVX2 = cpu.X86.HasAVX2 13 | useAVX = cpu.X86.HasAVX 14 | useSSE4 = cpu.X86.HasSSE41 15 | } 16 | 17 | //go:noescape 18 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 22 | 23 | //go:noescape 24 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 25 | 26 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 27 | switch { 28 | case useAVX2: 29 | hashBlocksAVX2(h, c, flag, blocks) 30 | case useAVX: 31 | hashBlocksAVX(h, c, flag, blocks) 32 | case useSSE4: 33 | hashBlocksSSE4(h, c, flag, blocks) 34 | default: 35 | hashBlocksGeneric(h, c, flag, blocks) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useSSE4 = cpu.X86.HasSSE41 13 | } 14 | 15 | //go:noescape 16 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 17 | 18 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 19 | if useSSE4 { 20 | hashBlocksSSE4(h, c, flag, blocks) 21 | } else { 22 | hashBlocksGeneric(h, c, flag, blocks) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package blake2b 8 | 9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 10 | hashBlocksGeneric(h, c, flag, blocks) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2b 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | newHash384 := func() hash.Hash { 20 | h, _ := New384(nil) 21 | return h 22 | } 23 | 24 | newHash512 := func() hash.Hash { 25 | h, _ := New512(nil) 26 | return h 27 | } 28 | 29 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) 30 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) 31 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var ( 12 | useSSE4 = false 13 | useSSSE3 = cpu.X86.HasSSSE3 14 | useSSE2 = cpu.X86.HasSSE2 15 | ) 16 | 17 | //go:noescape 18 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 22 | 23 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 24 | switch { 25 | case useSSSE3: 26 | hashBlocksSSSE3(h, c, flag, blocks) 27 | case useSSE2: 28 | hashBlocksSSE2(h, c, flag, blocks) 29 | default: 30 | hashBlocksGeneric(h, c, flag, blocks) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var ( 12 | useSSE4 = cpu.X86.HasSSE41 13 | useSSSE3 = cpu.X86.HasSSSE3 14 | useSSE2 = cpu.X86.HasSSE2 15 | ) 16 | 17 | //go:noescape 18 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 22 | 23 | //go:noescape 24 | func hashBlocksSSE4(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 25 | 26 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 27 | switch { 28 | case useSSE4: 29 | hashBlocksSSE4(h, c, flag, blocks) 30 | case useSSSE3: 31 | hashBlocksSSSE3(h, c, flag, blocks) 32 | case useSSE2: 33 | hashBlocksSSE2(h, c, flag, blocks) 34 | default: 35 | hashBlocksGeneric(h, c, flag, blocks) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/blake2s_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386 gccgo appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = false 11 | useSSSE3 = false 12 | useSSE2 = false 13 | ) 14 | 15 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 16 | hashBlocksGeneric(h, c, flag, blocks) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2s/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2s 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | 20 | crypto.RegisterHash(crypto.BLAKE2s_256, newHash256) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.11 6 | // +build !gccgo,!appengine 7 | 8 | package chacha20 9 | 10 | const bufSize = 256 11 | 12 | //go:noescape 13 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) 14 | 15 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 16 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !arm64,!s390x,!ppc64le arm64,!go1.11 gccgo appengine 6 | 7 | package chacha20 8 | 9 | const bufSize = blockSize 10 | 11 | func (s *Cipher) xorKeyStreamBlocks(dst, src []byte) { 12 | s.xorKeyStreamBlocksGeneric(dst, src) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo,!appengine 6 | 7 | package chacha20 8 | 9 | const bufSize = 256 10 | 11 | //go:noescape 12 | func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) 13 | 14 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 15 | chaCha20_ctr32_vsx(&dst[0], &src[0], len(src), &c.key, &c.counter) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo,!appengine 6 | 7 | package chacha20 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var haveAsm = cpu.S390X.HasVX 12 | 13 | const bufSize = 256 14 | 15 | // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only 16 | // be called when the vector facility is available. Implementation in asm_s390x.s. 17 | //go:noescape 18 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) 19 | 20 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 21 | if cpu.S390X.HasVX { 22 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) 23 | } else { 24 | c.xorKeyStreamBlocksGeneric(dst, src) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 !go1.7 gccgo appengine 6 | 7 | package chacha20poly1305 8 | 9 | func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 | return c.sealGeneric(dst, nonce, plaintext, additionalData) 11 | } 12 | 13 | func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { 14 | return c.openGeneric(dst, nonce, ciphertext, additionalData) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/curve25519_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 gccgo appengine purego 6 | 7 | package curve25519 8 | 9 | func scalarMult(out, in, base *[32]byte) { 10 | scalarMultGeneric(out, in, base) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ed25519/go113_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.13 6 | 7 | package ed25519_test 8 | 9 | import ( 10 | ed25519std "crypto/ed25519" 11 | "golang.org/x/crypto/ed25519" 12 | "testing" 13 | ) 14 | 15 | func TestTypeAlias(t *testing.T) { 16 | var zero zeroReader 17 | public, private, _ := ed25519std.GenerateKey(zero) 18 | 19 | message := []byte("test message") 20 | sig := ed25519.Sign(private, message) 21 | if !ed25519.Verify(public, message, sig) { 22 | t.Errorf("valid signature rejected") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/go.mod: -------------------------------------------------------------------------------- 1 | module golang.org/x/crypto 2 | 3 | go 1.11 4 | 5 | require ( 6 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 7 | golang.org/x/sys v0.0.0-20190412213103-97732733099d 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 2 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= 3 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 4 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 5 | golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= 6 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 7 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 8 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/internal/wycheproof/README.md: -------------------------------------------------------------------------------- 1 | This package runs a set of the Wycheproof tests provided by 2 | https://github.com/google/wycheproof. 3 | 4 | The JSON test files live in 5 | https://github.com/google/wycheproof/tree/master/testvectors 6 | and are being fetched and cached at a pinned version every time 7 | these tests are run. To change the version of the wycheproof 8 | repository that is being used for testing, update wycheproofModVer. 9 | 10 | The structs for these tests are generated from the 11 | schemas provided in https://github.com/google/wycheproof/tree/master/schemas 12 | using https://github.com/a-h/generate. -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/internal/wycheproof/internal/dsa/dsa.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package dsa provides an internal version of dsa.Verify 6 | // that is used for the Wycheproof tests. 7 | package dsa 8 | 9 | import ( 10 | "crypto/dsa" 11 | "math/big" 12 | 13 | "golang.org/x/crypto/cryptobyte" 14 | "golang.org/x/crypto/cryptobyte/asn1" 15 | ) 16 | 17 | // VerifyASN1 verifies the ASN1 encoded signature, sig, of hash using the 18 | // public key, pub. Its return value records whether the signature is valid. 19 | func VerifyASN1(pub *dsa.PublicKey, hash, sig []byte) bool { 20 | var ( 21 | r, s = &big.Int{}, &big.Int{} 22 | inner cryptobyte.String 23 | ) 24 | input := cryptobyte.String(sig) 25 | if !input.ReadASN1(&inner, asn1.SEQUENCE) || 26 | !input.Empty() || 27 | !inner.ReadASN1Integer(r) || 28 | !inner.ReadASN1Integer(s) || 29 | !inner.Empty() { 30 | return false 31 | } 32 | return dsa.Verify(pub, hash, r, s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/internal/wycheproof/internal/ecdsa/ecdsa.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package ecdsa provides an internal version of ecdsa.Verify 6 | // that is used for the Wycheproof tests. 7 | package ecdsa 8 | 9 | import ( 10 | "crypto/ecdsa" 11 | "math/big" 12 | 13 | "golang.org/x/crypto/cryptobyte" 14 | "golang.org/x/crypto/cryptobyte/asn1" 15 | ) 16 | 17 | // VerifyASN1 verifies the ASN1 encoded signature, sig, of hash using the 18 | // public key, pub. Its return value records whether the signature is valid. 19 | func VerifyASN1(pub *ecdsa.PublicKey, hash, sig []byte) bool { 20 | var ( 21 | r, s = &big.Int{}, &big.Int{} 22 | inner cryptobyte.String 23 | ) 24 | input := cryptobyte.String(sig) 25 | if !input.ReadASN1(&inner, asn1.SEQUENCE) || 26 | !input.Empty() || 27 | !inner.ReadASN1Integer(r) || 28 | !inner.ReadASN1Integer(s) || 29 | !inner.Empty() { 30 | return false 31 | } 32 | return ecdsa.Verify(pub, hash, r, s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/md4/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package md4_test 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | 11 | "golang.org/x/crypto/md4" 12 | ) 13 | 14 | func ExampleNew() { 15 | h := md4.New() 16 | data := "These pretzels are making me thirsty." 17 | io.WriteString(h, data) 18 | fmt.Printf("%x", h.Sum(nil)) 19 | // Output: 48c4e365090b30a32f084c4888deceaa 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/nacl/auth/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package auth_test 6 | 7 | import ( 8 | "encoding/hex" 9 | "fmt" 10 | 11 | "golang.org/x/crypto/nacl/auth" 12 | ) 13 | 14 | func Example() { 15 | // Load your secret key from a safe place and reuse it across multiple 16 | // Sum calls. (Obviously don't use this example key for anything 17 | // real.) If you want to convert a passphrase to a key, use a suitable 18 | // package like bcrypt or scrypt. 19 | secretKeyBytes, err := hex.DecodeString("6368616e676520746869732070617373776f726420746f206120736563726574") 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | var secretKey [32]byte 25 | copy(secretKey[:], secretKeyBytes) 26 | 27 | mac := auth.Sum([]byte("hello world"), &secretKey) 28 | fmt.Printf("%x\n", *mac) 29 | result := auth.Verify(mac[:], []byte("hello world"), &secretKey) 30 | fmt.Println(result) 31 | badResult := auth.Verify(mac[:], []byte("different message"), &secretKey) 32 | fmt.Println(badResult) 33 | // Output: eca5a521f3d77b63f567fb0cb6f5f2d200641bc8dada42f60c5f881260c30317 34 | // true 35 | // false 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/openpgp/packet/compressed_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package packet 6 | 7 | import ( 8 | "bytes" 9 | "encoding/hex" 10 | "io" 11 | "io/ioutil" 12 | "testing" 13 | ) 14 | 15 | func TestCompressed(t *testing.T) { 16 | packet, err := Read(readerFromHex(compressedHex)) 17 | if err != nil { 18 | t.Errorf("failed to read Compressed: %s", err) 19 | return 20 | } 21 | 22 | c, ok := packet.(*Compressed) 23 | if !ok { 24 | t.Error("didn't find Compressed packet") 25 | return 26 | } 27 | 28 | contents, err := ioutil.ReadAll(c.Body) 29 | if err != nil && err != io.EOF { 30 | t.Error(err) 31 | return 32 | } 33 | 34 | expected, _ := hex.DecodeString(compressedExpectedHex) 35 | if !bytes.Equal(expected, contents) { 36 | t.Errorf("got:%x want:%x", contents, expected) 37 | } 38 | } 39 | 40 | const compressedHex = "a3013b2d90c4e02b72e25f727e5e496a5e49b11e1700" 41 | const compressedExpectedHex = "cb1062004d14c8fe636f6e74656e74732e0a" 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrDecryption represents a failure to decrypt the input. 11 | ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding") 12 | 13 | // ErrIncorrectPassword is returned when an incorrect password is detected. 14 | // Usually, P12/PFX data is signed to be able to verify the password. 15 | ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect") 16 | ) 17 | 18 | // NotImplementedError indicates that the input is not currently supported. 19 | type NotImplementedError string 20 | 21 | func (e NotImplementedError) Error() string { 22 | return "pkcs12: " + string(e) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package rc2 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func BenchmarkEncrypt(b *testing.B) { 12 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 13 | b.ResetTimer() 14 | var src [8]byte 15 | for i := 0; i < b.N; i++ { 16 | r.Encrypt(src[:], src[:]) 17 | } 18 | } 19 | 20 | func BenchmarkDecrypt(b *testing.B) { 21 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 22 | b.ResetTimer() 23 | var src [8]byte 24 | for i := 0; i < b.N; i++ { 25 | r.Decrypt(src[:], src[:]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "crypto/hmac" 9 | "crypto/sha1" 10 | "crypto/x509/pkix" 11 | "encoding/asn1" 12 | ) 13 | 14 | type macData struct { 15 | Mac digestInfo 16 | MacSalt []byte 17 | Iterations int `asn1:"optional,default:1"` 18 | } 19 | 20 | // from PKCS#7: 21 | type digestInfo struct { 22 | Algorithm pkix.AlgorithmIdentifier 23 | Digest []byte 24 | } 25 | 26 | var ( 27 | oidSHA1 = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 28 | ) 29 | 30 | func verifyMac(macData *macData, message, password []byte) error { 31 | if !macData.Mac.Algorithm.Algorithm.Equal(oidSHA1) { 32 | return NotImplementedError("unknown digest algorithm: " + macData.Mac.Algorithm.Algorithm.String()) 33 | } 34 | 35 | key := pbkdf(sha1Sum, 20, 64, macData.MacSalt, password, macData.Iterations, 3, 20) 36 | 37 | mac := hmac.New(sha1.New, key) 38 | mac.Write(message) 39 | expectedMAC := mac.Sum(nil) 40 | 41 | if !hmac.Equal(macData.Mac.Digest, expectedMAC) { 42 | return ErrIncorrectPassword 43 | } 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/pkcs12/mac_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "encoding/asn1" 9 | "testing" 10 | ) 11 | 12 | func TestVerifyMac(t *testing.T) { 13 | td := macData{ 14 | Mac: digestInfo{ 15 | Digest: []byte{0x18, 0x20, 0x3d, 0xff, 0x1e, 0x16, 0xf4, 0x92, 0xf2, 0xaf, 0xc8, 0x91, 0xa9, 0xba, 0xd6, 0xca, 0x9d, 0xee, 0x51, 0x93}, 16 | }, 17 | MacSalt: []byte{1, 2, 3, 4, 5, 6, 7, 8}, 18 | Iterations: 2048, 19 | } 20 | 21 | message := []byte{11, 12, 13, 14, 15} 22 | password, _ := bmpString("") 23 | 24 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 2, 3}) 25 | err := verifyMac(&td, message, password) 26 | if _, ok := err.(NotImplementedError); !ok { 27 | t.Errorf("err: %v", err) 28 | } 29 | 30 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 31 | err = verifyMac(&td, message, password) 32 | if err != ErrIncorrectPassword { 33 | t.Errorf("Expected incorrect password, got err: %v", err) 34 | } 35 | 36 | password, _ = bmpString("Sesame open") 37 | err = verifyMac(&td, message, password) 38 | if err != nil { 39 | t.Errorf("err: %v", err) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/bits_compat.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.13 6 | 7 | package poly1305 8 | 9 | // Generic fallbacks for the math/bits intrinsics, copied from 10 | // src/math/bits/bits.go. They were added in Go 1.12, but Add64 and Sum64 had 11 | // variable time fallbacks until Go 1.13. 12 | 13 | func bitsAdd64(x, y, carry uint64) (sum, carryOut uint64) { 14 | sum = x + y + carry 15 | carryOut = ((x & y) | ((x | y) &^ sum)) >> 63 16 | return 17 | } 18 | 19 | func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { 20 | diff = x - y - borrow 21 | borrowOut = ((^x & y) | (^(x ^ y) & diff)) >> 63 22 | return 23 | } 24 | 25 | func bitsMul64(x, y uint64) (hi, lo uint64) { 26 | const mask32 = 1<<32 - 1 27 | x0 := x & mask32 28 | x1 := x >> 32 29 | y0 := y & mask32 30 | y1 := y >> 32 31 | w0 := x0 * y0 32 | t := x1*y0 + w0>>32 33 | w1 := t & mask32 34 | w2 := t >> 32 35 | w1 += x0 * y1 36 | hi = x1*y1 + w2 + w1>>32 37 | lo = x * y 38 | return 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/bits_go1.13.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.13 6 | 7 | package poly1305 8 | 9 | import "math/bits" 10 | 11 | func bitsAdd64(x, y, carry uint64) (sum, carryOut uint64) { 12 | return bits.Add64(x, y, carry) 13 | } 14 | 15 | func bitsSub64(x, y, borrow uint64) (diff, borrowOut uint64) { 16 | return bits.Sub64(x, y, borrow) 17 | } 18 | 19 | func bitsMul64(x, y uint64) (hi, lo uint64) { 20 | return bits.Mul64(x, y) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/mac_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!ppc64le gccgo appengine 6 | 7 | package poly1305 8 | 9 | type mac struct{ macGeneric } 10 | 11 | func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x,!go1.11 !amd64,!s390x,!ppc64le gccgo appengine nacl 6 | 7 | package poly1305 8 | 9 | func sum(out *[TagSize]byte, msg []byte, key *[32]byte) { 10 | h := newMAC(key) 11 | h.Write(msg) 12 | h.Sum(out) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x,go1.11,!gccgo,!appengine 6 | 7 | package poly1305 8 | 9 | import ( 10 | "golang.org/x/sys/cpu" 11 | ) 12 | 13 | // poly1305vx is an assembly implementation of Poly1305 that uses vector 14 | // instructions. It must only be called if the vector facility (vx) is 15 | // available. 16 | //go:noescape 17 | func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 18 | 19 | // poly1305vmsl is an assembly implementation of Poly1305 that uses vector 20 | // instructions, including VMSL. It must only be called if the vector facility (vx) is 21 | // available and if VMSL is supported. 22 | //go:noescape 23 | func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 24 | 25 | func sum(out *[16]byte, m []byte, key *[32]byte) { 26 | if cpu.S390X.HasVX { 27 | var mPtr *byte 28 | if len(m) > 0 { 29 | mPtr = &m[0] 30 | } 31 | if cpu.S390X.HasVXE && len(m) > 256 { 32 | poly1305vmsl(out, mPtr, uint64(len(m)), key) 33 | } else { 34 | poly1305vx(out, mPtr, uint64(len(m)), key) 35 | } 36 | } else { 37 | sumGeneric(out, m, key) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | //go:noescape 10 | 11 | // salsa2020XORKeyStream is implemented in salsa20_amd64.s. 12 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) 13 | 14 | // XORKeyStream crypts bytes from in to out using the given key and counters. 15 | // In and out must overlap entirely or not at all. Counter 16 | // contains the raw salsa20 counter bytes (both nonce and block counter). 17 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 18 | if len(in) == 0 { 19 | return 20 | } 21 | _ = out[len(in)-1] 22 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | import ( 10 | "bytes" 11 | "testing" 12 | ) 13 | 14 | func TestCounterOverflow(t *testing.T) { 15 | in := make([]byte, 4096) 16 | key := &[32]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 17 | 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2} 18 | for n, counter := range []*[16]byte{ 19 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0}, // zero counter 20 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff}, // counter about to overflow 32 bits 21 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 0xff, 0xff, 0xff, 0xff}, // counter above 32 bits 22 | } { 23 | out := make([]byte, 4096) 24 | XORKeyStream(out, in, counter, key) 25 | outGeneric := make([]byte, 4096) 26 | genericXORKeyStream(outGeneric, in, counter, key) 27 | if !bytes.Equal(out, outGeneric) { 28 | t.Errorf("%d: assembly and go implementations disagree", n) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package salsa 8 | 9 | // XORKeyStream crypts bytes from in to out using the given key and counters. 10 | // In and out must overlap entirely or not at all. Counter 11 | // contains the raw salsa20 counter bytes (both nonce and block counter). 12 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 13 | genericXORKeyStream(out, in, counter, key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/scrypt/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package scrypt_test 6 | 7 | import ( 8 | "encoding/base64" 9 | "fmt" 10 | "log" 11 | 12 | "golang.org/x/crypto/scrypt" 13 | ) 14 | 15 | func Example() { 16 | // DO NOT use this salt value; generate your own random salt. 8 bytes is 17 | // a good length. 18 | salt := []byte{0xc8, 0x28, 0xf2, 0x58, 0xa7, 0x6a, 0xad, 0x7b} 19 | 20 | dk, err := scrypt.Key([]byte("some password"), salt, 1<<15, 8, 1, 32) 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | fmt.Println(base64.StdEncoding.EncodeToString(dk)) 25 | // Output: lGnMz8io0AUkfzn6Pls1qX20Vs7PGN6sbYQ2TQgY12M= 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/hashes_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | import ( 10 | "hash" 11 | ) 12 | 13 | // new224Asm returns an assembly implementation of SHA3-224 if available, 14 | // otherwise it returns nil. 15 | func new224Asm() hash.Hash { return nil } 16 | 17 | // new256Asm returns an assembly implementation of SHA3-256 if available, 18 | // otherwise it returns nil. 19 | func new256Asm() hash.Hash { return nil } 20 | 21 | // new384Asm returns an assembly implementation of SHA3-384 if available, 22 | // otherwise it returns nil. 23 | func new384Asm() hash.Hash { return nil } 24 | 25 | // new512Asm returns an assembly implementation of SHA3-512 if available, 26 | // otherwise it returns nil. 27 | func new512Asm() hash.Hash { return nil } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/sha3_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo,!appengine 6 | 7 | #include "textflag.h" 8 | 9 | // func kimd(function code, chain *[200]byte, src []byte) 10 | TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40 11 | MOVD function+0(FP), R0 12 | MOVD chain+8(FP), R1 13 | LMG src+16(FP), R2, R3 // R2=base, R3=len 14 | 15 | continue: 16 | WORD $0xB93E0002 // KIMD --, R2 17 | BVS continue // continue if interrupted 18 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 19 | RET 20 | 21 | // func klmd(function code, chain *[200]byte, dst, src []byte) 22 | TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64 23 | // TODO: SHAKE support 24 | MOVD function+0(FP), R0 25 | MOVD chain+8(FP), R1 26 | LMG dst+16(FP), R2, R3 // R2=base, R3=len 27 | LMG src+40(FP), R4, R5 // R4=base, R5=len 28 | 29 | continue: 30 | WORD $0xB93F0024 // KLMD R2, R4 31 | BVS continue // continue if interrupted 32 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 33 | RET 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/shake_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | // newShake128Asm returns an assembly implementation of SHAKE-128 if available, 10 | // otherwise it returns nil. 11 | func newShake128Asm() ShakeHash { 12 | return nil 13 | } 14 | 15 | // newShake256Asm returns an assembly implementation of SHAKE-256 if available, 16 | // otherwise it returns nil. 17 | func newShake256Asm() ShakeHash { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | // A storageBuf is an aligned array of maxRate bytes. 10 | type storageBuf [maxRate]byte 11 | 12 | func (b *storageBuf) asBytes() *[maxRate]byte { 13 | return (*[maxRate]byte)(b) 14 | } 15 | 16 | var ( 17 | xorIn = xorInGeneric 18 | copyOut = copyOutGeneric 19 | xorInUnaligned = xorInGeneric 20 | copyOutUnaligned = copyOutGeneric 21 | ) 22 | 23 | const xorImplementationUnaligned = "generic" 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/agent/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package agent_test 6 | 7 | import ( 8 | "log" 9 | "net" 10 | "os" 11 | 12 | "golang.org/x/crypto/ssh" 13 | "golang.org/x/crypto/ssh/agent" 14 | ) 15 | 16 | func ExampleNewClient() { 17 | // ssh-agent(1) provides a UNIX socket at $SSH_AUTH_SOCK. 18 | socket := os.Getenv("SSH_AUTH_SOCK") 19 | conn, err := net.Dial("unix", socket) 20 | if err != nil { 21 | log.Fatalf("Failed to open SSH_AUTH_SOCK: %v", err) 22 | } 23 | 24 | agentClient := agent.NewClient(conn) 25 | config := &ssh.ClientConfig{ 26 | User: "gopher", 27 | Auth: []ssh.AuthMethod{ 28 | // Use a callback rather than PublicKeys so we only consult the 29 | // agent once the remote server wants it. 30 | ssh.PublicKeysCallback(agentClient.Signers), 31 | }, 32 | HostKeyCallback: ssh.InsecureIgnoreHostKey(), 33 | } 34 | 35 | sshc, err := ssh.Dial("tcp", "localhost:22", config) 36 | if err != nil { 37 | log.Fatal(err) 38 | } 39 | // Use sshc... 40 | sshc.Close() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | 18 | This package does not fall under the stability promise of the Go language itself, 19 | so its API may be changed when pressing needs arise. 20 | */ 21 | package ssh // import "golang.org/x/crypto/ssh" 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/tcpip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestAutoPortListenBroken(t *testing.T) { 12 | broken := "SSH-2.0-OpenSSH_5.9hh11" 13 | works := "SSH-2.0-OpenSSH_6.1" 14 | if !isBrokenOpenSSHVersion(broken) { 15 | t.Errorf("version %q not marked as broken", broken) 16 | } 17 | if isBrokenOpenSSHVersion(works) { 18 | t.Errorf("version %q marked as broken", works) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TCGETS 12 | const ioctlWriteTermios = unix.TCSETS 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/banner_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package test 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | func TestBannerCallbackAgainstOpenSSH(t *testing.T) { 14 | server := newServer(t) 15 | defer server.Shutdown() 16 | 17 | clientConf := clientConfig() 18 | 19 | var receivedBanner string 20 | clientConf.BannerCallback = func(message string) error { 21 | receivedBanner = message 22 | return nil 23 | } 24 | 25 | conn := server.Dial(clientConf) 26 | defer conn.Close() 27 | 28 | expected := "Server Banner" 29 | if receivedBanner != expected { 30 | t.Fatalf("got %v; want %v", receivedBanner, expected) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package test contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/testdata/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains test data shared between the various subpackages of 6 | // the golang.org/x/crypto/ssh package. Under no circumstance should 7 | // this data be used for production code. 8 | package testdata // import "golang.org/x/crypto/ssh/testdata" 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - tip 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [2.0.0] - 2015-09-02 6 | 7 | - Mailer has been removed. It has been replaced by Dialer and Sender. 8 | - `File` type and the `CreateFile` and `OpenFile` functions have been removed. 9 | - `Message.Attach` and `Message.Embed` have a new signature. 10 | - `Message.GetBodyWriter` has been removed. Use `Message.AddAlternativeWriter` 11 | instead. 12 | - `Message.Export` has been removed. `Message.WriteTo` can be used instead. 13 | - `Message.DelHeader` has been removed. 14 | - The `Bcc` header field is no longer sent. It is far more simpler and 15 | efficient: the same message is sent to all recipients instead of sending a 16 | different email to each Bcc address. 17 | - LoginAuth has been removed. `NewPlainDialer` now implements the LOGIN 18 | authentication mechanism when needed. 19 | - Go 1.2 is now required instead of Go 1.3. No external dependency are used when 20 | using Go 1.5. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thank you for contributing to Gomail! Here are a few guidelines: 2 | 3 | ## Bugs 4 | 5 | If you think you found a bug, create an issue and supply the minimum amount 6 | of code triggering the bug so it can be reproduced. 7 | 8 | 9 | ## Fixing a bug 10 | 11 | If you want to fix a bug, you can send a pull request. It should contains a 12 | new test or update an existing one to cover that bug. 13 | 14 | 15 | ## New feature proposal 16 | 17 | If you think Gomail lacks a feature, you can open an issue or send a pull 18 | request. I want to keep Gomail code and API as simple as possible so please 19 | describe your needs so we can discuss whether this feature should be added to 20 | Gomail or not. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alexandre Cesaro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/auth.go: -------------------------------------------------------------------------------- 1 | package gomail 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "fmt" 7 | "net/smtp" 8 | ) 9 | 10 | // loginAuth is an smtp.Auth that implements the LOGIN authentication mechanism. 11 | type loginAuth struct { 12 | username string 13 | password string 14 | host string 15 | } 16 | 17 | func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) { 18 | if !server.TLS { 19 | advertised := false 20 | for _, mechanism := range server.Auth { 21 | if mechanism == "LOGIN" { 22 | advertised = true 23 | break 24 | } 25 | } 26 | if !advertised { 27 | return "", nil, errors.New("gomail: unencrypted connection") 28 | } 29 | } 30 | if server.Name != a.host { 31 | return "", nil, errors.New("gomail: wrong host name") 32 | } 33 | return "LOGIN", nil, nil 34 | } 35 | 36 | func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) { 37 | if !more { 38 | return nil, nil 39 | } 40 | 41 | switch { 42 | case bytes.Equal(fromServer, []byte("Username:")): 43 | return []byte(a.username), nil 44 | case bytes.Equal(fromServer, []byte("Password:")): 45 | return []byte(a.password), nil 46 | default: 47 | return nil, fmt.Errorf("gomail: unexpected server challenge: %s", fromServer) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package gomail provides a simple interface to compose emails and to mail them 2 | // efficiently. 3 | // 4 | // More info on Github: https://github.com/go-gomail/gomail 5 | package gomail 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package gomail 4 | 5 | import ( 6 | "mime" 7 | "mime/quotedprintable" 8 | "strings" 9 | ) 10 | 11 | var newQPWriter = quotedprintable.NewWriter 12 | 13 | type mimeEncoder struct { 14 | mime.WordEncoder 15 | } 16 | 17 | var ( 18 | bEncoding = mimeEncoder{mime.BEncoding} 19 | qEncoding = mimeEncoder{mime.QEncoding} 20 | lastIndexByte = strings.LastIndexByte 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/gopkg.in/gomail.v2/mime_go14.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package gomail 4 | 5 | import "gopkg.in/alexcesaro/quotedprintable.v3" 6 | 7 | var newQPWriter = quotedprintable.NewWriter 8 | 9 | type mimeEncoder struct { 10 | quotedprintable.WordEncoder 11 | } 12 | 13 | var ( 14 | bEncoding = mimeEncoder{quotedprintable.BEncoding} 15 | qEncoding = mimeEncoder{quotedprintable.QEncoding} 16 | lastIndexByte = func(s string, c byte) int { 17 | for i := len(s) - 1; i >= 0; i-- { 18 | 19 | if s[i] == c { 20 | return i 21 | } 22 | } 23 | return -1 24 | } 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go_import_path: gopkg.in/mgo.v2 4 | 5 | addons: 6 | apt: 7 | packages: 8 | 9 | env: 10 | global: 11 | - BUCKET=https://niemeyer.s3.amazonaws.com 12 | matrix: 13 | - GO=1.4.1 MONGODB=x86_64-2.2.7 14 | - GO=1.4.1 MONGODB=x86_64-2.4.14 15 | - GO=1.4.1 MONGODB=x86_64-2.6.11 16 | - GO=1.4.1 MONGODB=x86_64-3.0.9 17 | - GO=1.4.1 MONGODB=x86_64-3.2.3-nojournal 18 | - GO=1.5.3 MONGODB=x86_64-3.0.9 19 | - GO=1.6 MONGODB=x86_64-3.0.9 20 | 21 | install: 22 | - eval "$(gimme $GO)" 23 | 24 | - wget $BUCKET/mongodb-linux-$MONGODB.tgz 25 | - tar xzvf mongodb-linux-$MONGODB.tgz 26 | - export PATH=$PWD/mongodb-linux-$MONGODB/bin:$PATH 27 | 28 | - wget $BUCKET/daemontools.tar.gz 29 | - tar xzvf daemontools.tar.gz 30 | - export PATH=$PWD/daemontools:$PATH 31 | 32 | - go get gopkg.in/check.v1 33 | - go get gopkg.in/yaml.v2 34 | - go get gopkg.in/tomb.v2 35 | 36 | before_script: 37 | - export NOIPV6=1 38 | - make startdb 39 | 40 | script: 41 | - (cd bson && go test -check.v) 42 | - go test -check.v -fast 43 | - (cd txn && go test -check.v) 44 | 45 | # vim:sw=4:ts=4:et 46 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @harness/setup.sh start 3 | 4 | stopdb: 5 | @harness/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/README.md: -------------------------------------------------------------------------------- 1 | The MongoDB driver for Go 2 | ------------------------- 3 | 4 | Please go to [http://labix.org/mgo](http://labix.org/mgo) for all project details. 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/bson/specdata/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ ! -d specifications ]; then 6 | git clone -b bson git@github.com:jyemin/specifications 7 | fi 8 | 9 | TESTFILE="../specdata_test.go" 10 | 11 | cat < $TESTFILE 12 | package bson_test 13 | 14 | var specTests = []string{ 15 | END 16 | 17 | for file in specifications/source/bson/tests/*.yml; do 18 | ( 19 | echo '`' 20 | cat $file 21 | echo -n '`,' 22 | ) >> $TESTFILE 23 | done 24 | 25 | echo '}' >> $TESTFILE 26 | 27 | gofmt -w $TESTFILE 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/dbtest/export_test.go: -------------------------------------------------------------------------------- 1 | package dbtest 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | func (dbs *DBServer) ProcessTest() *os.Process { 8 | if dbs.server == nil { 9 | return nil 10 | } 11 | return dbs.server.Process 12 | } 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/export_test.go: -------------------------------------------------------------------------------- 1 | package mgo 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | func HackPingDelay(newDelay time.Duration) (restore func()) { 8 | globalMutex.Lock() 9 | defer globalMutex.Unlock() 10 | 11 | oldDelay := pingDelay 12 | restore = func() { 13 | globalMutex.Lock() 14 | pingDelay = oldDelay 15 | globalMutex.Unlock() 16 | } 17 | pingDelay = newDelay 18 | return 19 | } 20 | 21 | func HackSyncSocketTimeout(newTimeout time.Duration) (restore func()) { 22 | globalMutex.Lock() 23 | defer globalMutex.Unlock() 24 | 25 | oldTimeout := syncSocketTimeout 26 | restore = func() { 27 | globalMutex.Lock() 28 | syncSocketTimeout = oldTimeout 29 | globalMutex.Unlock() 30 | } 31 | syncSocketTimeout = newTimeout 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/certs/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDLjCCAhYCAQcwDQYJKoZIhvcNAQELBQAwXDELMAkGA1UEBhMCR08xDDAKBgNV 3 | BAgMA01HTzEMMAoGA1UEBwwDTUdPMQwwCgYDVQQKDANNR08xDzANBgNVBAsMBlNl 4 | cnZlcjESMBAGA1UEAwwJbG9jYWxob3N0MCAXDTE1MDkyOTA4NDAzMFoYDzIxMTUw 5 | OTA1MDg0MDMwWjBcMQswCQYDVQQGEwJHTzEMMAoGA1UECAwDTUdPMQwwCgYDVQQH 6 | DANNR08xDDAKBgNVBAoMA01HTzEPMA0GA1UECwwGQ2xpZW50MRIwEAYDVQQDDAls 7 | b2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0UiQhmT+H 8 | 4IIqrn8SMESDzvcl3rwImwUoRIHlmXkovCIZCbvBCJ1nAu6X5zIN89EPPOjfNrgZ 9 | 616wPgVV/YEQXp+D7+jTAsE5s8JepRXFdecResmvh/+0i2DSuI4QFsuyVAPM1O0I 10 | AQ5EKgr0weZZmsX6lhPD4uYehV4DxDE0i/8aTAlDoNgRCAJrYFMharRTDdY7bQzd 11 | 7ZYab/pK/3DSmOKxl/AFJ8Enmcj9w1bsvy0fgAgoGEBnBru80PRFpFiqk72TJkXO 12 | Hx7zcYFpegtKPbAreTCModaCnjP//fskCp4XJrkfH5+01NeeX/r1OfEbjgE/wzzx 13 | l8NaWnPCmxNfAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFwYpje3dCLDOIHYjd+5 14 | CpFOEb+bJsS4ryqm/NblTjIhCLo58hNpMsBqdJHRbHAFRCOE8fvY8yiWtdHeFZcW 15 | DgVRAXfHONLtN7faZaZQnhy/YzOhLfC/8dUMB0gQA8KXhBCPZqQmexE28AfkEO47 16 | PwICAxIWINfjm5VnFMkA3b7bDNLHon/pev2m7HqVQ3pRUJQNK3XgFOdDgRrnuXpR 17 | OKAfHORHVGTh1gf1DVwc0oM+0gnkSiJ1VG0n5pE3zhZ24fmZxu6JQ6X515W7APQI 18 | /nKVH+f1Fo+ustyTNLt8Bwxi1XmwT7IXwnkVSE9Ff6VejppXRF01V0aaWsa3kU3r 19 | z3A= 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/certs/client.req: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICoTCCAYkCAQAwXDELMAkGA1UEBhMCR08xDDAKBgNVBAgMA01HTzEMMAoGA1UE 3 | BwwDTUdPMQwwCgYDVQQKDANNR08xDzANBgNVBAsMBkNsaWVudDESMBAGA1UEAwwJ 4 | bG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtFIkIZk/ 5 | h+CCKq5/EjBEg873Jd68CJsFKESB5Zl5KLwiGQm7wQidZwLul+cyDfPRDzzo3za4 6 | GetesD4FVf2BEF6fg+/o0wLBObPCXqUVxXXnEXrJr4f/tItg0riOEBbLslQDzNTt 7 | CAEORCoK9MHmWZrF+pYTw+LmHoVeA8QxNIv/GkwJQ6DYEQgCa2BTIWq0Uw3WO20M 8 | 3e2WGm/6Sv9w0pjisZfwBSfBJ5nI/cNW7L8tH4AIKBhAZwa7vND0RaRYqpO9kyZF 9 | zh8e83GBaXoLSj2wK3kwjKHWgp4z//37JAqeFya5Hx+ftNTXnl/69TnxG44BP8M8 10 | 8ZfDWlpzwpsTXwIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAKbOFblIscxlXalV 11 | sEGNm2oz380RN2QoLhN6nKtAiv0jWm6iKhdAhOIQIeaRPhUP3cyi8bcBvLdMeQ3d 12 | ZYIByB55/R0VSP1vs4qkXJCQegHcpMpyuIzsMV8p3Q4lxzGKyKtPA6Bb5c49p8Sk 13 | ncD+LL4ymrMEia4cBPsHL9hhFOm4gqDacbU8+ETLTpuoSvUZiw7OwngqhE2r+kMv 14 | KDweq5TOPeb+ftKzQKrrfB+XVdBoTKYw6CwARpogbc0/7mvottVcJ/0yAgC1fBbM 15 | vupkohkXwKfjxKl6nKNL3R2GkzHQOh91hglAx5zyybKQn2YMM328Vk4X6csBg+pg 16 | tb1s0MA= 17 | -----END CERTIFICATE REQUEST----- 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/db/mongod.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/db/mongod.lock -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg1/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONCOPTS \ 6 | --port 40101 \ 7 | --configsvr 8 | 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg2/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/cfg2/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg2/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONCOPTS \ 6 | --port 40102 \ 7 | --configsvr 8 | 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg3/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/cfg3/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg3/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/cfg3/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONCOPTS \ 6 | --port 40103 \ 7 | --configsvr \ 8 | --auth \ 9 | --keyFile=../../certs/keyfile 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db1/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/db1/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db1/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db1/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | if [ x$NOIPV6 = x1 ]; then 6 | BINDIP="127.0.0.1" 7 | else 8 | BINDIP="127.0.0.1,::1" 9 | fi 10 | 11 | exec mongod $COMMONDOPTSNOIP \ 12 | --shardsvr \ 13 | --bind_ip=$BINDIP \ 14 | --port 40001 \ 15 | --ipv6 16 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db2/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/db2/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db2/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --port 40002 \ 8 | --auth 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db3/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/db3/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db3/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/db3/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --port 40003 \ 8 | --auth \ 9 | --sslMode preferSSL \ 10 | --sslCAFile ../../certs/server.pem \ 11 | --sslPEMKeyFile ../../certs/server.pem 12 | 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1a/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs1a/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1a/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1a/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs1 \ 8 | --port 40011 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1b/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs1b/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1b/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1b/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs1 \ 8 | --port 40012 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1c/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs1c/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1c/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs1c/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs1 \ 8 | --port 40013 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2a/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs2a/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2a/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2a/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs2 \ 8 | --port 40021 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2b/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs2b/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2b/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2b/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs2 \ 8 | --port 40022 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2c/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs2c/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2c/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs2c/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs2 \ 8 | --port 40023 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3a/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs3a/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3a/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3a/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs3 \ 8 | --port 40031 \ 9 | --keyFile=../../certs/keyfile 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3b/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs3b/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3b/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3b/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs3 \ 8 | --port 40032 \ 9 | --keyFile=../../certs/keyfile 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3c/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs3c/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3c/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs3c/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs3 \ 8 | --port 40033 \ 9 | --keyFile=../../certs/keyfile 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs4a/db/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/harness/daemons/rs4a/db/.empty -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs4a/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/rs4a/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongod $COMMONDOPTS \ 6 | --shardsvr \ 7 | --replSet rs4 \ 8 | --port 40041 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s1/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s1/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongos $COMMONSOPTS \ 6 | --port 40201 \ 7 | --configdb 127.0.0.1:40101 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s2/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s2/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongos $COMMONSOPTS \ 6 | --port 40202 \ 7 | --configdb 127.0.0.1:40102 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s3/log/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec cat - > log.txt 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/harness/daemons/s3/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ../.env 4 | 5 | exec mongos $COMMONSOPTS \ 6 | --port 40203 \ 7 | --configdb 127.0.0.1:40103 \ 8 | --keyFile=../../certs/keyfile 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/json/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // tagOptions is the string following a comma in a struct field's "json" 12 | // tag, or the empty string. It does not include the leading comma. 13 | type tagOptions string 14 | 15 | // parseTag splits a struct field's json tag into its name and 16 | // comma-separated options. 17 | func parseTag(tag string) (string, tagOptions) { 18 | if idx := strings.Index(tag, ","); idx != -1 { 19 | return tag[:idx], tagOptions(tag[idx+1:]) 20 | } 21 | return tag, tagOptions("") 22 | } 23 | 24 | // Contains reports whether a comma-separated list of options 25 | // contains a particular substr flag. substr must be surrounded by a 26 | // string boundary or commas. 27 | func (o tagOptions) Contains(optionName string) bool { 28 | if len(o) == 0 { 29 | return false 30 | } 31 | s := string(o) 32 | for s != "" { 33 | var next string 34 | i := strings.Index(s, ",") 35 | if i >= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/json/tags_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestTagParsing(t *testing.T) { 12 | name, opts := parseTag("field,foobar,foo") 13 | if name != "field" { 14 | t.Fatalf("name = %q, want field", name) 15 | } 16 | for _, tt := range []struct { 17 | opt string 18 | want bool 19 | }{ 20 | {"foobar", true}, 21 | {"foo", true}, 22 | {"bar", false}, 23 | } { 24 | if opts.Contains(tt.opt) != tt.want { 25 | t.Errorf("Contains(%q) = %v", tt.opt, !tt.want) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/json/testdata/code.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/internal/json/testdata/code.json.gz -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sspi_windows.h" 4 | 5 | SECURITY_STATUS SEC_ENTRY sspi_acquire_credentials_handle(CredHandle* cred_handle, char* username, char* password, char* domain); 6 | int sspi_step(CredHandle* cred_handle, int has_context, CtxtHandle* context, PVOID buffer, ULONG buffer_length, PVOID* out_buffer, ULONG* out_buffer_length, char* target); 7 | int sspi_send_client_authz_id(CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* user_plus_realm); 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "gopkg.in/mgo.v2/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/syscall_test.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mgo_test 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | func stop(pid int) (err error) { 10 | return syscall.Kill(pid, syscall.SIGSTOP) 11 | } 12 | 13 | func cont(pid int) (err error) { 14 | return syscall.Kill(pid, syscall.SIGCONT) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/syscall_windows_test.go: -------------------------------------------------------------------------------- 1 | package mgo_test 2 | 3 | func stop(pid int) (err error) { 4 | panicOnWindows() // Always does. 5 | return nil 6 | } 7 | 8 | func cont(pid int) (err error) { 9 | panicOnWindows() // Always does. 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/txn/output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ATpiu/asset-scan/308c33c50ee0fe05185a2e9de97981d5d088c92c/vendor/gopkg.in/mgo.v2/txn/output.txt -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/txn/tarjan_test.go: -------------------------------------------------------------------------------- 1 | package txn 2 | 3 | import ( 4 | "fmt" 5 | . "gopkg.in/check.v1" 6 | "gopkg.in/mgo.v2/bson" 7 | ) 8 | 9 | type TarjanSuite struct{} 10 | 11 | var _ = Suite(TarjanSuite{}) 12 | 13 | func bid(n int) bson.ObjectId { 14 | return bson.ObjectId(fmt.Sprintf("%024d", n)) 15 | } 16 | 17 | func bids(ns ...int) (ids []bson.ObjectId) { 18 | for _, n := range ns { 19 | ids = append(ids, bid(n)) 20 | } 21 | return 22 | } 23 | 24 | func (TarjanSuite) TestExample(c *C) { 25 | successors := map[bson.ObjectId][]bson.ObjectId{ 26 | bid(1): bids(2, 3), 27 | bid(2): bids(1, 5), 28 | bid(3): bids(4), 29 | bid(4): bids(3, 5), 30 | bid(5): bids(6), 31 | bid(6): bids(7), 32 | bid(7): bids(8), 33 | bid(8): bids(6, 9), 34 | bid(9): bids(), 35 | } 36 | 37 | c.Assert(tarjanSort(successors), DeepEquals, [][]bson.ObjectId{ 38 | bids(9), 39 | bids(6, 7, 8), 40 | bids(5), 41 | bids(3, 4), 42 | bids(1, 2), 43 | }) 44 | } 45 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------