├── .gitignore ├── CheatSheet2.png ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.md ├── api ├── common_api.go ├── compare.go ├── data_evaluation.go ├── data_feeder.go ├── db_mongodbapi.go ├── db_redisapi.go ├── db_sqlapi.go ├── dispatch_api.go ├── funcs.go ├── funcs_test.go ├── http_api.go ├── http_api_test.go ├── http_payload.go ├── http_respfile.go ├── out_files.go ├── out_outputs.go ├── out_outputs_test.go ├── out_session.go ├── out_variables.go ├── respvalue.go └── types.go ├── assertion ├── assertion.go ├── assertion_mapping.go ├── assertion_mapping_test.go ├── assertion_test.go ├── validation.go └── validation_test.go ├── builtins ├── call.go ├── functions.go └── functions_test.go ├── cmd ├── config.go └── options.go ├── converter ├── har │ ├── har.go │ └── types.go └── swagger │ ├── swagger.go │ └── types.go ├── db ├── interface.go ├── mongodb │ └── gmongodb.go ├── redis │ └── gredis.go └── sqldb │ ├── db_mysql.go │ ├── db_pg.go │ ├── gsql.go │ └── utils.go ├── demo5.svg ├── doc ├── 1-CaseStructure.jpeg ├── 2-CasesRelationship.jpeg ├── 3-BigPicture.jpeg └── 4-html-report.png ├── excel └── gexcel.go ├── executor ├── dispatch.go ├── executor.go ├── extension │ ├── keyword.go │ ├── statechart.go │ └── testsuite.go ├── inputs.go ├── setup.go ├── teardown.go ├── testcases.go └── types.go ├── fuzz ├── fuzz.go ├── fuzz_test.go ├── fuzzrules.go └── fuzzrulesmapping.go ├── js ├── gjs.go └── types.go ├── lib ├── combination │ ├── combins.go │ └── combins_test.go ├── csv │ ├── gcsv.go │ └── gcsv_test.go ├── extension │ ├── keyword │ │ ├── keyword.go │ │ ├── parser.go │ │ ├── types.go │ │ └── validation.go │ ├── statechart │ │ ├── generation_keyword.go │ │ ├── parser.go │ │ ├── scxml.go │ │ ├── types.go │ │ └── xstate.go │ └── testsuite │ │ ├── parser.go │ │ ├── testsuite.go │ │ ├── ts_session.go │ │ └── types.go ├── g4json │ ├── g4json.go │ └── g4json_test.go ├── pairwise │ ├── pairwise.go │ ├── pairwise2.go │ └── pairwise_test.go ├── rands │ └── rands.go ├── session │ └── gsession.go ├── testcase │ ├── parser.go │ ├── reports.go │ ├── testcase.go │ ├── testcase_test.go │ └── types.go └── tree │ ├── tree.go │ └── treestats.go ├── main.go ├── mutation ├── m_headers.go ├── m_payload.go ├── m_queryString.go ├── m_rules.go ├── m_rules_mapping.go ├── m_rules_test.go └── mutation.go ├── protocal └── http │ └── http.go ├── reports ├── functionarea.go ├── graphic.go ├── groupby.go ├── logfile.go ├── orderby.go ├── reports.go ├── reportsconsole.go ├── resultsjs.go ├── resultslog.go ├── statsgaugejs.go ├── statsjs.go ├── statsmutationjs.go ├── testsuite.go └── types.go ├── samples ├── conversion │ ├── har_sample.json │ ├── har_sample.json.out.json │ ├── swagger_sample.json │ └── swagger_sample.json.out.json ├── fuzz │ ├── FuzzTeseCase.fuzz │ ├── FuzzTeseCase.json │ ├── FuzzTeseCase_fuzz_dt_invalid.csv │ └── FuzzTeseCase_fuzz_dt_valid.csv ├── mutation │ └── MutationTeseCase.json ├── scenarios │ ├── scenario1 │ │ ├── s1ChildChildChildTeseCase.json │ │ ├── s1ChildChildTeseCase.json │ │ ├── s1ChildTeseCase.json │ │ ├── s1ParentTeseCase.json │ │ └── temp │ │ │ ├── s1ChildTeseCase.json_inputs_cosolidated.csv │ │ │ ├── s1ParentTestCase_out.csv │ │ │ └── s1ParentTestCase_out2.csv │ └── scenario2 │ │ ├── s2ChildTeseCase.json │ │ ├── s2ParentTeseCase.json │ │ └── temp │ │ ├── s2parenttestcase_out.csv │ │ ├── s2parenttestcase_out2.csv │ │ ├── s2parenttestcase_out3.csv │ │ └── s2parenttestcase_out4.csv ├── testconfig │ └── config.json ├── testdata │ └── Demo │ │ ├── FirstTeseCase.json │ │ ├── FirstTeseCase_2_1.json │ │ ├── FirstTeseCase_2_2.json │ │ ├── FirstTeseCase_2_2_1.json │ │ ├── SecondTeseCase.json │ │ ├── SecondTeseCase_dt1.csv │ │ ├── SecondTeseCase_dt2.csv │ │ ├── Setup.json │ │ └── Teardown.json └── testresource │ └── swagger.json ├── texttmpl ├── template.go └── template_test.go ├── ui ├── details_html.go ├── fuzz_html.go ├── graphic_html.go ├── index_html.go ├── js │ ├── Chart.bundle.min.js.go │ ├── graphic.go │ ├── js.go │ ├── mutationstats.go │ ├── results.go │ └── stats.go ├── mindex_html.go ├── mutation_html.go ├── style │ ├── icon.go │ └── style.go └── template │ ├── body_template.go │ ├── footer_template.go │ └── header_template.go ├── utils ├── float64_conv.go └── utils.go └── vendor ├── github.com ├── ahmetb │ └── go-linq │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── aggregate.go │ │ ├── compare.go │ │ ├── concat.go │ │ ├── convert.go │ │ ├── distinct.go │ │ ├── doc.go │ │ ├── except.go │ │ ├── from.go │ │ ├── genericfunc.go │ │ ├── go.mod │ │ ├── groupby.go │ │ ├── groupjoin.go │ │ ├── index.go │ │ ├── intersect.go │ │ ├── join.go │ │ ├── orderby.go │ │ ├── result.go │ │ ├── reverse.go │ │ ├── select.go │ │ ├── selectmany.go │ │ ├── skip.go │ │ ├── take.go │ │ ├── union.go │ │ ├── where.go │ │ └── zip.go ├── dlclark │ └── regexp2 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── ATTRIB │ │ ├── LICENSE │ │ ├── README.md │ │ ├── match.go │ │ ├── regexp.go │ │ ├── replace.go │ │ ├── runner.go │ │ ├── syntax │ │ ├── charclass.go │ │ ├── code.go │ │ ├── escape.go │ │ ├── fuzz.go │ │ ├── parser.go │ │ ├── prefix.go │ │ ├── replacerdata.go │ │ ├── tree.go │ │ └── writer.go │ │ └── testoutput1 ├── dop251 │ └── goja │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── array.go │ │ ├── array_sparse.go │ │ ├── ast │ │ ├── README.markdown │ │ └── node.go │ │ ├── builtin_array.go │ │ ├── builtin_boolean.go │ │ ├── builtin_date.go │ │ ├── builtin_error.go │ │ ├── builtin_function.go │ │ ├── builtin_global.go │ │ ├── builtin_json.go │ │ ├── builtin_math.go │ │ ├── builtin_number.go │ │ ├── builtin_object.go │ │ ├── builtin_regexp.go │ │ ├── builtin_string.go │ │ ├── builtin_typedarrays.go │ │ ├── compiler.go │ │ ├── compiler_expr.go │ │ ├── compiler_stmt.go │ │ ├── date.go │ │ ├── date_parser.go │ │ ├── dtoa.go │ │ ├── file │ │ ├── README.markdown │ │ └── file.go │ │ ├── func.go │ │ ├── ipow.go │ │ ├── object.go │ │ ├── object_args.go │ │ ├── object_gomap.go │ │ ├── object_gomap_reflect.go │ │ ├── object_goreflect.go │ │ ├── object_goslice.go │ │ ├── object_goslice_reflect.go │ │ ├── object_lazy.go │ │ ├── parser │ │ ├── README.markdown │ │ ├── error.go │ │ ├── expression.go │ │ ├── lexer.go │ │ ├── parser.go │ │ ├── regexp.go │ │ ├── scope.go │ │ └── statement.go │ │ ├── regexp.go │ │ ├── runtime.go │ │ ├── srcfile.go │ │ ├── string.go │ │ ├── string_ascii.go │ │ ├── string_unicode.go │ │ ├── token │ │ ├── Makefile │ │ ├── README.markdown │ │ ├── token.go │ │ ├── token_const.go │ │ └── tokenfmt │ │ ├── value.go │ │ └── vm.go ├── go-sourcemap │ └── sourcemap │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── consumer.go │ │ ├── internal │ │ └── base64vlq │ │ │ └── base64vlq.go │ │ └── mappings.go ├── go-sql-driver │ └── mysql │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── auth.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_go18.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ ├── utils.go │ │ ├── utils_go17.go │ │ └── utils_go18.go ├── go-stack │ └── stack │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── go.mod │ │ └── stack.go ├── golang │ └── snappy │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ ├── go.mod │ │ └── snappy.go ├── gomodule │ └── redigo │ │ ├── LICENSE │ │ ├── internal │ │ └── commandinfo.go │ │ └── redis │ │ ├── conn.go │ │ ├── doc.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── go18.go │ │ ├── log.go │ │ ├── pool.go │ │ ├── pool17.go │ │ ├── pubsub.go │ │ ├── redis.go │ │ ├── reply.go │ │ ├── scan.go │ │ └── script.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 ├── tealeg │ └── xlsx │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS.txt │ │ ├── README.org │ │ ├── cell.go │ │ ├── col.go │ │ ├── date.go │ │ ├── doc.go │ │ ├── file.go │ │ ├── hsl.go │ │ ├── lib.go │ │ ├── read.go │ │ ├── reftable.go │ │ ├── row.go │ │ ├── sheet.go │ │ ├── style.go │ │ ├── templates.go │ │ ├── theme.go │ │ ├── write.go │ │ ├── xmlContentTypes.go │ │ ├── xmlSharedStrings.go │ │ ├── xmlStyle.go │ │ ├── xmlTheme.go │ │ ├── xmlWorkbook.go │ │ └── xmlWorksheet.go ├── tidwall │ ├── gjson │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SYNTAX.md │ │ ├── gjson.go │ │ ├── gjson_gae.go │ │ ├── gjson_ngae.go │ │ ├── go.mod │ │ ├── go.sum │ │ └── logo.png │ ├── match │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── match.go │ ├── pretty │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── pretty.go │ └── sjson │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── logo.png │ │ ├── sjson.go │ │ ├── sjson_gae.go │ │ └── sjson_ngae.go └── xdg │ ├── scram │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── client.go │ ├── client_conv.go │ ├── common.go │ ├── doc.go │ ├── parse.go │ ├── scram.go │ ├── server.go │ └── server_conv.go │ └── stringprep │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bidi.go │ ├── doc.go │ ├── error.go │ ├── map.go │ ├── profile.go │ ├── saslprep.go │ ├── set.go │ └── tables.go ├── go.mongodb.org └── mongo-driver │ ├── LICENSE │ ├── THIRD-PARTY-NOTICES │ ├── bson │ ├── bson.go │ ├── bson_1_8.go │ ├── bsoncodec │ │ ├── bsoncodec.go │ │ ├── default_value_decoders.go │ │ ├── default_value_encoders.go │ │ ├── doc.go │ │ ├── mode.go │ │ ├── pointer_codec.go │ │ ├── proxy.go │ │ ├── registry.go │ │ ├── struct_codec.go │ │ ├── struct_tag_parser.go │ │ └── types.go │ ├── bsonrw │ │ ├── copier.go │ │ ├── doc.go │ │ ├── extjson_parser.go │ │ ├── extjson_reader.go │ │ ├── extjson_tables.go │ │ ├── extjson_wrappers.go │ │ ├── extjson_writer.go │ │ ├── json_scanner.go │ │ ├── mode.go │ │ ├── reader.go │ │ ├── value_reader.go │ │ ├── value_writer.go │ │ └── writer.go │ ├── bsontype │ │ └── bsontype.go │ ├── decoder.go │ ├── doc.go │ ├── encoder.go │ ├── marshal.go │ ├── primitive │ │ ├── decimal.go │ │ ├── objectid.go │ │ └── primitive.go │ ├── primitive_codecs.go │ ├── raw.go │ ├── raw_element.go │ ├── raw_value.go │ ├── registry.go │ ├── types.go │ └── unmarshal.go │ ├── etc │ └── generate-notices.pl │ ├── event │ └── monitoring.go │ ├── internal │ ├── const.go │ ├── error.go │ └── semaphore.go │ ├── mongo │ ├── batch_cursor.go │ ├── bulk_write.go │ ├── bulk_write_models.go │ ├── change_stream.go │ ├── client.go │ ├── collection.go │ ├── cursor.go │ ├── database.go │ ├── doc.go │ ├── errors.go │ ├── index_options_builder.go │ ├── index_view.go │ ├── mongo.go │ ├── options │ │ ├── aggregateoptions.go │ │ ├── bulkwriteoptions.go │ │ ├── changestreamoptions.go │ │ ├── clientoptions.go │ │ ├── clientoptions_1_10.go │ │ ├── clientoptions_1_9.go │ │ ├── collectionoptions.go │ │ ├── countoptions.go │ │ ├── dboptions.go │ │ ├── deleteoptions.go │ │ ├── distinctoptions.go │ │ ├── estimatedcountoptions.go │ │ ├── findoptions.go │ │ ├── gridfsoptions.go │ │ ├── indexoptions.go │ │ ├── insertoptions.go │ │ ├── listcollectionsoptions.go │ │ ├── listdatabasesoptions.go │ │ ├── mongooptions.go │ │ ├── replaceoptions.go │ │ ├── runcmdoptions.go │ │ ├── sessionoptions.go │ │ ├── transactionoptions.go │ │ └── updateoptions.go │ ├── readconcern │ │ └── readconcern.go │ ├── readpref │ │ ├── mode.go │ │ ├── options.go │ │ └── readpref.go │ ├── results.go │ ├── session.go │ ├── single_result.go │ ├── util.go │ └── writeconcern │ │ └── writeconcern.go │ ├── tag │ └── tag.go │ ├── version │ └── version.go │ └── x │ ├── bsonx │ ├── array.go │ ├── bsoncore │ │ ├── bsoncore.go │ │ ├── document.go │ │ ├── document_sequence.go │ │ ├── element.go │ │ ├── tables.go │ │ └── value.go │ ├── constructor.go │ ├── document.go │ ├── element.go │ ├── mdocument.go │ ├── primitive_codecs.go │ ├── registry.go │ └── value.go │ └── mongo │ └── driver │ ├── DESIGN.md │ ├── address │ └── addr.go │ ├── auth │ ├── auth.go │ ├── cred.go │ ├── default.go │ ├── doc.go │ ├── gssapi.go │ ├── gssapi_not_enabled.go │ ├── gssapi_not_supported.go │ ├── internal │ │ └── gssapi │ │ │ ├── gss.go │ │ │ ├── gss_wrapper.c │ │ │ ├── gss_wrapper.h │ │ │ ├── sspi.go │ │ │ ├── sspi_wrapper.c │ │ │ └── sspi_wrapper.h │ ├── mongodbcr.go │ ├── plain.go │ ├── sasl.go │ ├── scram.go │ ├── util.go │ └── x509.go │ ├── batch_cursor.go │ ├── batches.go │ ├── connstring │ └── connstring.go │ ├── description │ ├── description.go │ ├── feature.go │ ├── server.go │ ├── server_kind.go │ ├── server_selector.go │ ├── topology.go │ ├── topology_kind.go │ ├── version.go │ └── version_range.go │ ├── dns │ └── dns.go │ ├── driver.go │ ├── errors.go │ ├── legacy.go │ ├── list_collections_batch_cursor.go │ ├── operation.go │ ├── operation │ ├── abort_transaction.go │ ├── abort_transaction.toml │ ├── aggregate.go │ ├── aggregate.toml │ ├── command.go │ ├── commit_transaction.go │ ├── commit_transaction.toml │ ├── count.go │ ├── count.toml │ ├── createIndexes.go │ ├── createIndexes.toml │ ├── delete.go │ ├── delete.toml │ ├── distinct.go │ ├── distinct.toml │ ├── drop_collection.go │ ├── drop_collection.toml │ ├── drop_database.go │ ├── drop_database.toml │ ├── drop_indexes.go │ ├── drop_indexes.toml │ ├── end_sessions.go │ ├── end_sessions.toml │ ├── find.go │ ├── find.toml │ ├── find_and_modify.go │ ├── find_and_modify.toml │ ├── insert.go │ ├── insert.toml │ ├── ismaster.go │ ├── listDatabases.go │ ├── listDatabases.toml │ ├── list_collections.go │ ├── list_collections.toml │ ├── list_indexes.go │ ├── list_indexes.toml │ ├── operation.go │ ├── update.go │ └── update.toml │ ├── operation_legacy.go │ ├── session │ ├── client_session.go │ ├── cluster_clock.go │ ├── options.go │ ├── server_session.go │ └── session_pool.go │ ├── topology │ ├── DESIGN.md │ ├── connection.go │ ├── connection_legacy.go │ ├── connection_legacy_command_metadata.go │ ├── connection_options.go │ ├── errors.go │ ├── fsm.go │ ├── pool.go │ ├── resource_pool.go │ ├── server.go │ ├── server_options.go │ ├── topology.go │ ├── topology_options.go │ ├── topology_options_1_10.go │ └── topology_options_1_9.go │ ├── uuid │ └── uuid.go │ └── wiremessage │ └── wiremessage.go ├── golang.org └── x │ ├── crypto │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── pbkdf2 │ │ └── pbkdf2.go │ ├── sync │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── semaphore │ │ └── semaphore.go │ └── text │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── cases │ ├── cases.go │ ├── context.go │ ├── fold.go │ ├── gen.go │ ├── gen_trieval.go │ ├── icu.go │ ├── info.go │ ├── map.go │ ├── tables10.0.0.go │ ├── tables11.0.0.go │ ├── tables9.0.0.go │ └── trieval.go │ ├── collate │ ├── build │ │ ├── builder.go │ │ ├── colelem.go │ │ ├── contract.go │ │ ├── order.go │ │ ├── table.go │ │ └── trie.go │ ├── collate.go │ ├── index.go │ ├── maketables.go │ ├── option.go │ ├── sort.go │ └── tables.go │ ├── internal │ ├── colltab │ │ ├── collelem.go │ │ ├── colltab.go │ │ ├── contract.go │ │ ├── iter.go │ │ ├── numeric.go │ │ ├── table.go │ │ ├── trie.go │ │ └── weighter.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── internal.go │ ├── language │ │ ├── common.go │ │ ├── compact.go │ │ ├── compact │ │ │ ├── compact.go │ │ │ ├── gen.go │ │ │ ├── gen_index.go │ │ │ ├── gen_parents.go │ │ │ ├── language.go │ │ │ ├── parents.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── compose.go │ │ ├── coverage.go │ │ ├── gen.go │ │ ├── gen_common.go │ │ ├── language.go │ │ ├── lookup.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go │ ├── match.go │ ├── tag │ │ └── tag.go │ ├── triegen │ │ ├── compact.go │ │ ├── print.go │ │ └── triegen.go │ └── ucd │ │ └── ucd.go │ ├── language │ ├── coverage.go │ ├── doc.go │ ├── gen.go │ ├── go1_1.go │ ├── go1_2.go │ ├── language.go │ ├── match.go │ ├── parse.go │ ├── tables.go │ └── tags.go │ ├── transform │ └── transform.go │ └── unicode │ ├── cldr │ ├── base.go │ ├── cldr.go │ ├── collate.go │ ├── decode.go │ ├── makexml.go │ ├── resolve.go │ ├── slice.go │ └── xml.go │ └── norm │ ├── composition.go │ ├── forminfo.go │ ├── input.go │ ├── iter.go │ ├── maketables.go │ ├── normalize.go │ ├── readwriter.go │ ├── tables10.0.0.go │ ├── tables11.0.0.go │ ├── tables9.0.0.go │ ├── transform.go │ ├── trie.go │ └── triegen.go └── google.golang.org └── appengine ├── LICENSE └── cloudsql ├── cloudsql.go ├── cloudsql_classic.go └── cloudsql_vm.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | .idea 8 | *.iml 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | 16 | */.DS_Store 17 | *.DS_Store 18 | 19 | .samples -------------------------------------------------------------------------------- /CheatSheet2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/CheatSheet2.png -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | 28 | [[constraint]] 29 | name = "github.com/ahmetb/go-linq" 30 | version = "3.1.0" 31 | 32 | [[constraint]] 33 | branch = "master" 34 | name = "github.com/dop251/goja" 35 | 36 | [[constraint]] 37 | name = "github.com/go-sql-driver/mysql" 38 | version = "1.4.1" 39 | 40 | [[constraint]] 41 | name = "github.com/gomodule/redigo" 42 | version = "2.0.0" 43 | 44 | [[constraint]] 45 | name = "github.com/tealeg/xlsx" 46 | version = "1.0.3" 47 | 48 | [[constraint]] 49 | name = "github.com/tidwall/gjson" 50 | version = "1.3.2" 51 | 52 | [[constraint]] 53 | name = "github.com/tidwall/sjson" 54 | version = "1.0.4" 55 | 56 | [prune] 57 | go-tests = true 58 | unused-packages = true 59 | 60 | [[constraint]] 61 | name = "go.mongodb.org/mongo-driver" 62 | version = "~1.1.0" 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Josh Baker 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. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION := 0.15.0 2 | 3 | all: build 4 | 5 | .PHONY: build 6 | build: 7 | go build 8 | 9 | .PHONY: format 10 | format: 11 | find . -name '*.go' -------------------------------------------------------------------------------- /api/db_mongodbapi.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package api 12 | 13 | import ( 14 | // "fmt" 15 | 16 | gmongodb "go4api/db/mongodb" 17 | ) 18 | 19 | func RunMongoDB (cmdStr string) (int, interface{}, string) { 20 | keysCount, cmdResults, redExecStatus := gmongodb.Run(cmdStr) 21 | 22 | return keysCount, cmdResults, redExecStatus 23 | } 24 | 25 | -------------------------------------------------------------------------------- /api/db_redisapi.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package api 12 | 13 | import ( 14 | // "fmt" 15 | 16 | gredis "go4api/db/redis" 17 | ) 18 | 19 | func RunRedis (cmdStr string, cmdKey string, cmdValue string) (int, interface{}, string) { 20 | keysCount, cmdResults, redExecStatus := gredis.Run(cmdStr, cmdKey, cmdValue) 21 | 22 | return keysCount, cmdResults, redExecStatus 23 | } -------------------------------------------------------------------------------- /api/db_sqlapi.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package api 12 | 13 | import ( 14 | // "fmt" 15 | 16 | gsql "go4api/db/sqldb" 17 | // gpg "go4api/db/postgres" 18 | ) 19 | 20 | // for mysql 21 | func RunSql (tgtDb string, stmt string) (int, []string, []map[string]interface{}, string) { 22 | // gsql.Run will return: , , 23 | // status: SqlSuccess, SqlFailed 24 | rowsCount, rowsHeaders, rowsData, sqlExecStatus := gsql.Run("mysql", tgtDb, stmt) 25 | 26 | return rowsCount, rowsHeaders, rowsData, sqlExecStatus 27 | } 28 | 29 | // for postgresql 30 | func RunPgSql (tgtDb string, stmt string) (int, []string, []map[string]interface{}, string) { 31 | // gsql.Run will return: , , 32 | // status: SqlSuccess, SqlFailed 33 | rowsCount, rowsHeaders, rowsData, sqlExecStatus := gsql.Run("postgres", tgtDb, stmt) 34 | 35 | return rowsCount, rowsHeaders, rowsData, sqlExecStatus 36 | } 37 | 38 | -------------------------------------------------------------------------------- /api/http_respfile.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package api 12 | 13 | import ( 14 | // "os" 15 | "io/ioutil" 16 | "net/http" 17 | "fmt" 18 | ) 19 | 20 | 21 | func SaveHttpRespFile (actualBody []byte, outputsFile string) { 22 | // filePath := cmd.Opt.Testresource 23 | 24 | ioutil.WriteFile(outputsFile, actualBody, 0644) 25 | 26 | // use the first 512 bytes for type 27 | buffer := make([]byte, 512) 28 | buffer = actualBody[0:512] 29 | 30 | contentType := http.DetectContentType(buffer) 31 | fmt.Println("contentType: ", contentType) 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /api/out_variables.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package api 12 | 13 | import ( 14 | // "fmt" 15 | 16 | gsession "go4api/lib/session" 17 | ) 18 | 19 | 20 | func (tcDataStore *TcDataStore) WriteOutGlobalVariables (expOutGlobalVariables map[string]interface{}) { 21 | if expOutGlobalVariables != nil { 22 | for k, v := range expOutGlobalVariables { 23 | var value interface{} 24 | 25 | switch v.(type) { 26 | case string: 27 | value = tcDataStore.GetResponseValue(v.(string)) 28 | case int, int64, float64: 29 | value = v 30 | } 31 | 32 | gsession.WriteGlobalVariables(k, value) 33 | } 34 | } 35 | } 36 | 37 | func (tcDataStore *TcDataStore) WriteOutTcLocalVariables (expOutLocalVariables map[string]interface{}) { 38 | if expOutLocalVariables != nil { 39 | for k, v := range expOutLocalVariables { 40 | var value interface{} 41 | 42 | switch v.(type) { 43 | case string: 44 | value = tcDataStore.GetResponseValue(v.(string)) 45 | case int, int64, float64: 46 | value = v 47 | } 48 | 49 | tcDataStore.TcLocalVariables[k] = value 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /assertion/assertion_mapping_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package assertion 12 | 13 | import ( 14 | "fmt" 15 | "testing" 16 | // "encoding/csv" 17 | ) 18 | 19 | func Test_init(t *testing.T) { 20 | for _, value := range assertionMapping { 21 | fmt.Println("AssertionMapping: ", value) 22 | } 23 | 24 | if len(assertionMapping) != 14 { 25 | t.Fatalf("init failed") 26 | } else { 27 | t.Log("init test passed") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /builtins/functions_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package builtins 12 | 13 | import ( 14 | "fmt" 15 | "testing" 16 | // "encoding/csv" 17 | ) 18 | 19 | func Test_CurrentTimeStampString (t *testing.T) { 20 | res := CurrentTimeStampString("milli") 21 | 22 | fmt.Println("res: ", res) 23 | // if res != 4 { 24 | // t.Fatalf("getMaxLenVector test failed") 25 | // } else { 26 | // t.Log("getMaxLenVector test passed") 27 | // } 28 | } 29 | 30 | func Test_CurrentTimeStampUnix (t *testing.T) { 31 | res := CurrentTimeStampUnix("milli") 32 | 33 | fmt.Println("res: ", res) 34 | // if res != 4 { 35 | // t.Fatalf("getMaxLenVector test failed") 36 | // } else { 37 | // t.Log("getMaxLenVector test passed") 38 | // } 39 | } 40 | 41 | func Test_DayStart (t *testing.T) { 42 | res := DayStart(CurrentTimeStampUnix("milli")) 43 | 44 | fmt.Println("res: ", res) 45 | } 46 | 47 | func Test_DayEnd (t *testing.T) { 48 | res := DayEnd(CurrentTimeStampUnix("milli")) 49 | 50 | fmt.Println("res: ", res) 51 | } 52 | 53 | func Test_TimeStampUnixOffset (t *testing.T) { 54 | var oset = []interface{}{1543593599000 , "-1", "day"} 55 | 56 | res := TimeStampUnixOffset(oset) 57 | 58 | fmt.Println("res: ", res) 59 | } 60 | 61 | -------------------------------------------------------------------------------- /converter/har/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package har 12 | 13 | import ( 14 | ) 15 | 16 | // har type 17 | type Har map[string]HarLog 18 | 19 | type HarLog struct { 20 | Version string 21 | Creator map[string]string 22 | Pages []map[string]interface{} 23 | Entries []Entry 24 | } 25 | 26 | type Entries []Entry 27 | 28 | type Entry struct { 29 | startedDateTime string 30 | time float32 31 | Request Request 32 | Response Response 33 | } 34 | 35 | type Request struct { 36 | Method string 37 | Url string 38 | HttpVersion string 39 | Headers []map[string]interface{} 40 | QueryString []map[string]interface{} 41 | Cookies []map[string]interface{} 42 | HeadersSize int 43 | BodySize int 44 | PostData map[string]interface{} 45 | } 46 | 47 | 48 | type Response struct { 49 | Status int 50 | StatusText string 51 | HttpVersion string 52 | Headers map[string]interface{} 53 | Cookies []map[string]interface{} 54 | content map[string]interface{} 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /converter/swagger/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package swagger 12 | 13 | import ( 14 | ) 15 | 16 | // swagger type 17 | type Swagger2 struct { 18 | Swagger string 19 | Info map[string]interface{} 20 | BasePath string 21 | Tags map[string]interface{} 22 | Schemes []string 23 | Paths map[string]Path 24 | SecurityDefinitions map[string]interface{} 25 | Definitions map[string]interface{} 26 | ExternalDocs map[string]interface{} 27 | } 28 | 29 | type Path map[string]PathDetails 30 | 31 | type PathDetails struct { 32 | Method string 33 | Consumes []string // content-type? 34 | Produces []string // content-type? 35 | Parameters []Parameter 36 | Responses []string 37 | Security []map[string]interface{} 38 | } 39 | 40 | type Parameter struct { 41 | Name string 42 | In string 43 | Description string 44 | Required bool 45 | Type string 46 | Format string 47 | Items map[string]interface{} 48 | CollectionFormat string 49 | Schema map[string]interface{} // {"$ref": "#/definitions/Order"} 50 | } 51 | 52 | type Definitions map[string]interface{} 53 | 54 | type Definition struct { 55 | Type string 56 | Required []string 57 | Properties map[string]interface{} 58 | Xml map[string]interface{} 59 | } 60 | 61 | 62 | -------------------------------------------------------------------------------- /db/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package db 12 | 13 | import ( 14 | 15 | ) 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /db/sqldb/db_mysql.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package gsql 12 | 13 | import ( 14 | "fmt" 15 | "strings" 16 | "database/sql" 17 | 18 | "go4api/cmd" 19 | "go4api/utils" 20 | 21 | _ "github.com/go-sql-driver/mysql" 22 | ) 23 | 24 | func InitMySqlConnection () map[string]*sql.DB { 25 | sqlCons := make(map[string]*sql.DB) 26 | 27 | dbs := cmd.GetDbConfig() 28 | 29 | for k, v := range dbs { 30 | envMap := utils.GetOsEnviron() 31 | 32 | ip := renderValue(v.Ip, envMap) 33 | port := renderValue(fmt.Sprint(v.Port), envMap) 34 | user := renderValue(v.UserName, envMap) 35 | password := renderValue(v.Password, envMap) 36 | // dbname := renderValue(v.Dbname, envMap) 37 | 38 | defaultSchema := "" 39 | 40 | conInfo := user + ":" + password + "@tcp(" + ip + ":" + port + ")/" + defaultSchema 41 | db, _ := sql.Open("mysql", conInfo) 42 | db.SetMaxOpenConns(2000) 43 | db.SetMaxIdleConns(1000) 44 | 45 | err := db.Ping() 46 | if err != nil { 47 | fmt.Println(err) 48 | panic(err) 49 | } 50 | 51 | dbIndicator := strings.ToLower(k) 52 | sqlCons[dbIndicator] = db 53 | } 54 | 55 | return sqlCons 56 | } 57 | 58 | -------------------------------------------------------------------------------- /db/sqldb/utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package gsql 12 | 13 | import ( 14 | "strings" 15 | ) 16 | 17 | 18 | // 19 | func renderValue (jsonStr string, feeder map[string]string) string { 20 | s := jsonStr 21 | 22 | for key, value := range feeder { 23 | k := "${" + key + "}" 24 | if k == s { 25 | s = strings.Replace(s, k, value, -1) 26 | } 27 | } 28 | 29 | return s 30 | } 31 | 32 | -------------------------------------------------------------------------------- /doc/1-CaseStructure.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/doc/1-CaseStructure.jpeg -------------------------------------------------------------------------------- /doc/2-CasesRelationship.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/doc/2-CasesRelationship.jpeg -------------------------------------------------------------------------------- /doc/3-BigPicture.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/doc/3-BigPicture.jpeg -------------------------------------------------------------------------------- /doc/4-html-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/doc/4-html-report.png -------------------------------------------------------------------------------- /excel/gexcel.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package gexcel 12 | 13 | import ( 14 | "fmt" 15 | "os" 16 | "strings" 17 | 18 | "go4api/cmd" 19 | 20 | xlsx "github.com/tealeg/xlsx" 21 | ) 22 | 23 | func Run() { 24 | var file *xlsx.File 25 | var sheet *xlsx.Sheet 26 | var row *xlsx.Row 27 | var cell *xlsx.Cell 28 | var err error 29 | 30 | file = xlsx.NewFile() 31 | sheet, err = file.AddSheet("Sheet1") 32 | if err != nil { 33 | fmt.Printf(err.Error()) 34 | } 35 | row = sheet.AddRow() 36 | cell = row.AddCell() 37 | cell.Value = "I am a cell!" 38 | err = file.Save("MyXLSXFile.xlsx") 39 | if err != nil { 40 | fmt.Printf(err.Error()) 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /executor/extension/keyword.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019.07 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package extension 12 | 13 | import ( 14 | // "fmt" 15 | "strings" 16 | 17 | "go4api/cmd" 18 | "go4api/lib/testcase" 19 | "go4api/lib/extension/keyword" 20 | ) 21 | 22 | func GetKwFilePaths () []string { 23 | filePathSlice := strings.Split(cmd.Opt.KeyWord, ",") 24 | 25 | return filePathSlice 26 | } 27 | 28 | func InitFullKwTcSlice (filePaths []string) ([]*testcase.TestCaseDataInfo, []string) { 29 | // filePathSlice := GetTsFilePaths() 30 | 31 | fullKwTcSlice, fullKwJsSlice := keyword.InitFullKwTcSlice(filePaths) 32 | 33 | return fullKwTcSlice, fullKwJsSlice 34 | } 35 | -------------------------------------------------------------------------------- /executor/extension/statechart.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019.07 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package extension 12 | 13 | import ( 14 | // "fmt" 15 | "strings" 16 | 17 | "go4api/cmd" 18 | "go4api/lib/testcase" 19 | "go4api/lib/extension/statechart" 20 | ) 21 | 22 | func GetScFilePaths () []string { 23 | filePathSlice := strings.Split(cmd.Opt.StateChart, ",") 24 | 25 | return filePathSlice 26 | } 27 | 28 | func InitFullScTcSlice (filePaths []string) ([]*testcase.TestCaseDataInfo) { 29 | // filePathSlice := GetTsFilePaths() 30 | 31 | fullKwTcSlice := statechart.InitFullScTcSlice(filePaths) 32 | 33 | return fullKwTcSlice 34 | } -------------------------------------------------------------------------------- /executor/extension/testsuite.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package extension 12 | 13 | import ( 14 | // "fmt" 15 | "strings" 16 | 17 | "go4api/cmd" 18 | "go4api/lib/testcase" 19 | "go4api/lib/extension/testsuite" 20 | ) 21 | 22 | func GetTsFilePaths () []string { 23 | filePathSlice := strings.Split(cmd.Opt.Testsuite, ",") 24 | 25 | return filePathSlice 26 | } 27 | 28 | func InitFullTsTcSlice (filePaths []string) []*testcase.TestCaseDataInfo { 29 | // filePathSlice := GetTsFilePaths() 30 | 31 | fullTsTcSlice := testsuite.InitFullTsTcSlice(filePaths) 32 | 33 | return fullTsTcSlice 34 | } -------------------------------------------------------------------------------- /executor/setup.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package executor 12 | 13 | import ( 14 | "go4api/lib/testcase" 15 | ) 16 | 17 | func InitGlobalSetUpTcSlice (fullTcSlice []*testcase.TestCaseDataInfo) []*testcase.TestCaseDataInfo { 18 | var tcSlice []*testcase.TestCaseDataInfo 19 | for i, _ := range fullTcSlice { 20 | if fullTcSlice[i].TestCase.IfGlobalSetUpTestCase() == true { 21 | tcSlice = append(tcSlice, fullTcSlice[i]) 22 | } 23 | } 24 | 25 | return tcSlice 26 | } 27 | -------------------------------------------------------------------------------- /executor/teardown.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package executor 12 | 13 | import ( 14 | "go4api/lib/testcase" 15 | ) 16 | 17 | func InitGlobalTeardownTcSlice (fullTcSlice []*testcase.TestCaseDataInfo) []*testcase.TestCaseDataInfo { 18 | var tcSlice []*testcase.TestCaseDataInfo 19 | for i, _ := range fullTcSlice { 20 | if fullTcSlice[i].TestCase.IfGlobalTearDownTestCase() == true { 21 | tcSlice = append(tcSlice, fullTcSlice[i]) 22 | } 23 | } 24 | 25 | return tcSlice 26 | } 27 | -------------------------------------------------------------------------------- /fuzz/fuzz_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package fuzz 12 | 13 | import ( 14 | "fmt" 15 | "testing" 16 | // "encoding/csv" 17 | ) 18 | 19 | func Test_getMaxLenVector(t *testing.T) { 20 | data := [][]interface{}{{1, 2, 3, 4}, {5, 6, 7}} 21 | 22 | res := getMaxLenVector(data) 23 | 24 | if res != 4 { 25 | t.Fatalf("getMaxLenVector test failed") 26 | } else { 27 | t.Log("getMaxLenVector test passed") 28 | } 29 | } 30 | 31 | func Test_GetCombinationInvalid(t *testing.T) { 32 | validVectors := [][]interface{}{{1, 2, 3, 4}, {5, 6, 7}} 33 | invalidVectors := [][]interface{}{{"a", "b", "c", "d"}, {"e", "f", "g"}} 34 | 35 | res := GetCombinationInvalid(validVectors, invalidVectors, 2) 36 | 37 | fmt.Println("validVectors: ", validVectors) 38 | fmt.Println("invalidVectors: ", invalidVectors) 39 | fmt.Println("res: ", res) 40 | 41 | if len(res) != 4 * 7 || len(res[0]) != 2 { 42 | t.Fatalf("getMaxLenVector test failed") 43 | } else { 44 | t.Log("getMaxLenVector test passed") 45 | } 46 | } -------------------------------------------------------------------------------- /fuzz/fuzzrulesmapping.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package fuzz 12 | 13 | import ( 14 | 15 | ) 16 | 17 | 18 | func FuzzRulesMapping(key string) []interface{} { 19 | // 20 | RulesMapping := map[string][]interface{} { 21 | "FCharValid": []interface{} { 22 | FCharValidR1, 23 | FCharValidR2, 24 | FCharValidR3, 25 | }, 26 | "FCharInvalid": []interface{} { 27 | FCharValidR1, 28 | FCharValidR2, 29 | FCharValidR3, 30 | }, 31 | "FCharNumericValid": []interface{} { 32 | FCharValidR1, 33 | FCharValidR2, 34 | FCharValidR3, 35 | }, 36 | "FCharAlphaValid": []interface{} { 37 | FCharValidR1, 38 | FCharValidR2, 39 | FCharValidR3, 40 | }, 41 | 42 | } 43 | 44 | return RulesMapping[key] 45 | } -------------------------------------------------------------------------------- /js/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package gjs 12 | 13 | import ( 14 | // "fmt" 15 | // "os" 16 | // "strings" 17 | 18 | // "go4api/cmd" 19 | 20 | goja "github.com/dop251/goja" 21 | ) 22 | 23 | 24 | // mvp, one js file has only one function 25 | type GJsBasics struct { 26 | JsSourceFilePath string 27 | JsSourceFileName string 28 | JsFunctionName string 29 | JsFunctionInParams interface{} 30 | JsFunctionOut interface{} 31 | JsProgram *goja.Program 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/extension/keyword/validation.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package keyword 12 | 13 | import ( 14 | // "fmt" 15 | // "time" 16 | // "os" 17 | // "sort" 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /lib/extension/statechart/generation_keyword.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package statechart 12 | 13 | import ( 14 | // "fmt" 15 | "os" 16 | // "sync" 17 | // "strings" 18 | // "bufio" 19 | // "io" 20 | // "path/filepath" 21 | ) 22 | 23 | 24 | func GenerateKeywordFile (strVar string, filePath string) { 25 | outFile, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) 26 | if err != nil { 27 | panic(err) 28 | } 29 | defer outFile.Close() 30 | 31 | outFile.WriteString(strVar) 32 | } 33 | 34 | func KWSettingsStr () { 35 | 36 | } 37 | 38 | func KWTestCasesStr () { 39 | 40 | } -------------------------------------------------------------------------------- /lib/extension/statechart/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package statechart 12 | 13 | import ( 14 | 15 | ) 16 | 17 | type State struct { 18 | Id string `json:"id"` 19 | Type string `json:"type"` // optional: atomic, compound. mandatory: parallel, final, history 20 | Initial string `json:"initial"` 21 | Entry []string `json:"entry"` // entry actions 22 | Exit []string `json:"exit"` // exit actions 23 | On map[string]map[string]*TargetAttr `json:"on"` // map[event]map[targetName]attr 24 | States States `json:"states"` // map["states"]... 25 | Activities []string `json:"activities"` 26 | // Invoke interface{} // External Communications: send, cancel, invoke, finalize 27 | } 28 | 29 | // 30 | type States map[string]*State // map[stateName]state 31 | 32 | type TargetAttr struct { 33 | Cond string `json:"cond"` 34 | Actions []string `json:"actions"` // Executable Content 35 | } 36 | 37 | type Transition struct { 38 | FromState string 39 | Event string 40 | ToState string 41 | Cond string 42 | Actions []string 43 | } 44 | 45 | 46 | // type Target map[string]*TargetAttr // map[targetName]attr 47 | -------------------------------------------------------------------------------- /lib/extension/testsuite/testsuite.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package testsuite 12 | 13 | import ( 14 | // "fmt" 15 | // "time" 16 | // "os" 17 | // "sort" 18 | 19 | "go4api/lib/testcase" 20 | ) 21 | 22 | // test suite type - get 23 | func (ts *TestSuite) TsName() string { 24 | var tsName string 25 | for key, _ := range *ts { 26 | tsName = key 27 | break 28 | } 29 | return tsName 30 | } 31 | 32 | func (ts *TestSuite) TestSuiteBasics() *TestSuiteBasics { 33 | return (*ts)[ts.TsName()] 34 | } 35 | 36 | func (ts *TestSuite) Priority() string { 37 | return (*ts)[ts.TsName()].Priority 38 | } 39 | 40 | func (ts *TestSuite) TestCasePaths() []string { 41 | return (*ts)[ts.TsName()].TestCasePaths 42 | } 43 | 44 | func (ts *TestSuite) OriginalTestCases() []string { 45 | return (*ts)[ts.TsName()].OriginalTestCases 46 | } 47 | 48 | func (ts *TestSuite) Parameters() map[string]interface{} { 49 | return (*ts)[ts.TsName()].Parameters 50 | } 51 | 52 | // 53 | // set AnalyzedTestCases 54 | func (ts *TestSuite) SetAnalyzedTestCases (tcSlice []*testcase.TestCaseDataInfo) { 55 | (*ts)[ts.TsName()].AnalyzedTestCases = tcSlice 56 | } 57 | 58 | -------------------------------------------------------------------------------- /lib/extension/testsuite/ts_session.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019.07 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package testsuite 12 | 13 | import ( 14 | // "fmt" 15 | 16 | gsession "go4api/lib/session" 17 | ) 18 | 19 | // set the session info for test suite 20 | func (ts *TestSuite) WriteSession () { 21 | gsession.WriteTcSession(ts.TsName(), (*ts)[ts.TsName()].Parameters) 22 | } 23 | -------------------------------------------------------------------------------- /lib/pairwise/pairwise_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package pairwise 12 | 13 | import ( 14 | "fmt" 15 | "testing" 16 | ) 17 | 18 | func Test_GetPairWise(t *testing.T) { 19 | fmt.Println("\n--> test started") 20 | 21 | combins := [][]interface{} { 22 | {"Brand X", "Brand Y", "Brand Z", "Brand ZZ"}, 23 | {"98", "NT", "2000", "XP"}, 24 | {"Internal", "Modem", "Modem2", "Modem3"}, 25 | {"Salaried", "Hourly", "Part-Time", "Contr."}, 26 | } 27 | 28 | c := make(chan []interface{}) 29 | 30 | go func(c chan []interface{}) { 31 | defer close(c) 32 | GetPairWise(c, combins, 3) 33 | }(c) 34 | 35 | 36 | for tcData := range c { 37 | fmt.Println(tcData) 38 | } 39 | 40 | fmt.Println("\n--> test finished") 41 | } 42 | -------------------------------------------------------------------------------- /lib/session/gsession.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package gsession 12 | 13 | import ( 14 | "sync" 15 | ) 16 | 17 | var GlobalVariables sync.Map 18 | var Session sync.Map 19 | 20 | func LookupTcSession (tcName string) map[string]interface{} { 21 | tcSession := make(map[string]interface{}) 22 | 23 | result, ok := Session.Load(tcName) 24 | if ok { 25 | tcSession = result.(map[string]interface{}) 26 | } 27 | 28 | return tcSession 29 | } 30 | 31 | func WriteTcSession (tcName string, tcSession map[string]interface{}) { 32 | Session.Store(tcName, tcSession) 33 | } 34 | 35 | // global 36 | func LoopGlobalVariables () map[string]interface{} { 37 | var resMap = make(map[string]interface{}) 38 | 39 | GlobalVariables.Range(func(key, value interface{}) bool { 40 | resMap[key.(string)] = value 41 | return true 42 | }) 43 | 44 | return resMap 45 | } 46 | 47 | func LookupGlobalVariables (key string) interface{} { 48 | var value interface{} 49 | 50 | result, ok := GlobalVariables.Load(key) 51 | if ok { 52 | value = result 53 | } 54 | 55 | return value 56 | } 57 | 58 | func WriteGlobalVariables (key string, value interface{}) { 59 | GlobalVariables.Store(key, value) 60 | } 61 | 62 | -------------------------------------------------------------------------------- /reports/functionarea.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package reports 12 | 13 | import ( 14 | // "fmt" 15 | 16 | "go4api/lib/testcase" 17 | 18 | . "github.com/ahmetb/go-linq" 19 | ) 20 | 21 | 22 | 23 | func (tcReportSlice TcReportSlice) GroupByFunctionArea () []Group { 24 | type ReportsStuct struct { 25 | FunctionArea string 26 | } 27 | 28 | var query []Group 29 | 30 | From(tcReportSlice).GroupByT( 31 | func(item *testcase.TcReportResults) ReportsStuct { 32 | return ReportsStuct{item.FunctionAreas[0]} 33 | }, 34 | func(item *testcase.TcReportResults) int64 { return 1 }, 35 | ).ToSlice(&query) 36 | 37 | return query 38 | } 39 | -------------------------------------------------------------------------------- /reports/resultslog.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package reports 12 | 13 | import ( 14 | "os" 15 | ) 16 | 17 | 18 | func OpenExecutionResultsLogFile(logFile string) *os.File { 19 | file, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) 20 | if err != nil { 21 | panic(err) 22 | } 23 | // defer file.Close() 24 | 25 | return file 26 | } 27 | 28 | func WriteExecutionResults(resultString string, file *os.File) { 29 | file.WriteString(resultString + "\n") 30 | } 31 | 32 | 33 | 34 | func CloseExecutionResultsLogFile(file *os.File) { 35 | // Note: potential bug, as maybe to much write happens at a time 36 | // defer file.Close() 37 | 38 | file.Close() 39 | } 40 | -------------------------------------------------------------------------------- /reports/testsuite.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2019 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package reports 12 | 13 | import ( 14 | // "fmt" 15 | "encoding/json" 16 | 17 | "go4api/lib/testcase" 18 | 19 | . "github.com/ahmetb/go-linq" 20 | ) 21 | 22 | 23 | 24 | func (tcReportSlice TcReportSlice) GroupByTestSuite () []Group { 25 | type ReportsStuct struct { 26 | TestSuite string 27 | } 28 | 29 | var query []Group 30 | 31 | From(tcReportSlice).GroupByT( 32 | func(item *testcase.TcReportResults) ReportsStuct { 33 | return ReportsStuct{item.TestSuite} 34 | }, 35 | func(item *testcase.TcReportResults) int64 { return 1 }, 36 | ).ToSlice(&query) 37 | 38 | return query 39 | } 40 | 41 | func (tcReportSlice TcReportSlice) GetOverallTestSuiteStatusStatsJson () string { 42 | query := tcReportSlice.GroupByTestSuite() 43 | 44 | reportsOverallStatusSlice := PrintStatsGroup(query) 45 | 46 | reJson, _ := json.MarshalIndent(reportsOverallStatusSlice, "", "\t") 47 | 48 | return string(reJson) 49 | } -------------------------------------------------------------------------------- /reports/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package reports 12 | 13 | import ( 14 | // "encoding/json" 15 | 16 | "go4api/lib/testcase" 17 | ) 18 | 19 | type TcReportSlice []*testcase.TcReportResults 20 | 21 | func (tcReportSlice TcReportSlice) ClassifyResults () (TcReportSlice, TcReportSlice, TcReportSlice) { 22 | var setUpResultSlice TcReportSlice 23 | var normalResultSlice TcReportSlice 24 | var tearDownResultSlice TcReportSlice 25 | 26 | for i, _ := range tcReportSlice { 27 | switch tcReportSlice[i].IfGlobalSetUpTearDown { 28 | case "SetUp": 29 | setUpResultSlice = append(setUpResultSlice, tcReportSlice[i]) 30 | case "TearDown": 31 | tearDownResultSlice = append(tearDownResultSlice, tcReportSlice[i]) 32 | default: 33 | normalResultSlice = append(normalResultSlice, tcReportSlice[i]) 34 | } 35 | } 36 | 37 | return setUpResultSlice, normalResultSlice, tearDownResultSlice 38 | } 39 | 40 | -------------------------------------------------------------------------------- /samples/conversion/har_sample.json.out.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Har-GET-1292052-0": { 4 | "priority": "1", 5 | "parentTestCase": "root", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", 12 | "Accept-Encoding": "gzip, deflate, br", 13 | "Accept-Language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7", 14 | "Cache-Control": "max-age=0", 15 | "Connection": "keep-alive", 16 | "Cookie": "gr_user_id=8808592b-b4b4-4466-9be4-ffe95a8c138a; _vwo_uuid_v2=3BDFA287302DBBA4951D9F706F77A070|4f5038fee2b5f71ca515273336962dee; __utmz=30149280.1527295172.115.49.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmc=30149280; viewed=\"11577300_27016236_26907929_10558892_26859123_25911182_27044219_6424904_25723064_26765979\"; ll=\"118318\"; bid=-SUmtVGK4ug; _pk_id.100001.7f16=dac84c44aeae4cfc.1533516112.1.1533516112.1533516112.; __utma=30149280.1362087807.1501474065.1534509991.1535409345.122", 17 | "Host": "api.douban.com", 18 | "Upgrade-Insecure-Requests": "1", 19 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 20 | }, 21 | "queryString": {}, 22 | "payload": {} 23 | }, 24 | "response": { 25 | "status": { 26 | "Equals": 200 27 | }, 28 | "headers": null, 29 | "body": null 30 | }, 31 | "outputs": [] 32 | } 33 | } 34 | ] -------------------------------------------------------------------------------- /samples/fuzz/FuzzTeseCase.fuzz: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FieldName": "title", 4 | "FieldType": "Char", 5 | "FieldSubType": "", 6 | "FieldMin": 0, 7 | "FieldMax": 20, 8 | "ArrayRaw": "", 9 | "Default": "abc" 10 | }, 11 | { 12 | "FieldName": "title0", 13 | "FieldType": "Char", 14 | "FieldSubType": "Numeric", 15 | "FieldMin": 0, 16 | "FieldMax": 20, 17 | "ArrayRaw": "", 18 | "Default": "abc" 19 | }, 20 | { 21 | "FieldName": "title1", 22 | "FieldType": "Char", 23 | "FieldSubType": "Numeric", 24 | "FieldMin": 0, 25 | "FieldMax": 20, 26 | "ArrayRaw": "", 27 | "Default": "abc" 28 | } 29 | ] -------------------------------------------------------------------------------- /samples/fuzz/FuzzTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FuzzTestCase-${tcid}": { 4 | "priority": "1", 5 | "parentTestCase": "root", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "$.title": { 29 | "Contains": "${title}" 30 | } 31 | } 32 | } 33 | } 34 | } 35 | ] -------------------------------------------------------------------------------- /samples/fuzz/FuzzTeseCase_fuzz_dt_invalid.csv: -------------------------------------------------------------------------------- 1 | tcid,title,title0,title1 2 | invalid1,,, 3 | invalid2,,C,v 4 | invalid3,,leibVjvFeDFCOEMGlgTj,IUoxAJrqQKXTzBxGVDkg 5 | invalid4,y,, 6 | invalid5,y,C,v 7 | invalid6,y,leibVjvFeDFCOEMGlgTj,IUoxAJrqQKXTzBxGVDkg 8 | invalid7,UqwNqHMKiCmDpPFNZBrb,, 9 | invalid8,UqwNqHMKiCmDpPFNZBrb,C,v 10 | invalid9,UqwNqHMKiCmDpPFNZBrb,leibVjvFeDFCOEMGlgTj,IUoxAJrqQKXTzBxGVDkg 11 | -------------------------------------------------------------------------------- /samples/fuzz/FuzzTeseCase_fuzz_dt_valid.csv: -------------------------------------------------------------------------------- 1 | tcid,title,title0,title1 2 | valid1,,, 3 | valid2,R,C, 4 | valid3,avbwkHdimJOajERsmvJi,leibVjvFeDFCOEMGlgTj, 5 | valid4,avbwkHdimJOajERsmvJi,C,v 6 | valid5,R,,v 7 | valid6,,leibVjvFeDFCOEMGlgTj,v 8 | valid7,,C,IUoxAJrqQKXTzBxGVDkg 9 | valid8,R,leibVjvFeDFCOEMGlgTj,IUoxAJrqQKXTzBxGVDkg 10 | valid9,avbwkHdimJOajERsmvJi,,IUoxAJrqQKXTzBxGVDkg 11 | -------------------------------------------------------------------------------- /samples/mutation/MutationTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "MutationTestCase-001": { 4 | "priority": "9", 5 | "parentTestCase": "root", 6 | "inputs": "", 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/top250", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "start": { 29 | "GreaterOrEquals": 0 30 | }, 31 | "$.count": { 32 | "Equals": 20 33 | }, 34 | "$.total": { 35 | "Equals": false 36 | }, 37 | "$.title": { 38 | "Contains": "豆瓣电影Top250" 39 | } 40 | } 41 | }, 42 | "outputs": [], 43 | "outGlobalVariables": [{"kaaaa": "vaaaa"}] 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /samples/scenarios/scenario1/s1ChildChildChildTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "s1ChildChildChildTestCase-001": { 4 | "priority": "1", 5 | "parentTestCase": "s1ChildChildTestCase-001", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "$.title": { 29 | "Contains": "${title}" 30 | } 31 | } 32 | }, 33 | "outputs": [{"title": "childchildchild"}] 34 | } 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /samples/scenarios/scenario1/s1ChildChildTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "s1ChildChildTestCase-001": { 4 | "priority": "1", 5 | "parentTestCase": "s1ChildTestCase-001", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "$(body).title": { 29 | "Contains": "${title}" 30 | } 31 | } 32 | }, 33 | "outputs": [{"title": "childchild"}] 34 | } 35 | } 36 | ] -------------------------------------------------------------------------------- /samples/scenarios/scenario1/s1ChildTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "s1ChildTestCase-001": { 4 | "priority": "1", 5 | "parentTestCase": "s1ParentTestCase-001", 6 | "inputs": ["s1ParentTestCase_out.csv", "join", "s1ParentTestCase_out2.csv"], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "$.title": { 29 | "Contains": "${title}" 30 | } 31 | } 32 | } 33 | } 34 | } 35 | ] -------------------------------------------------------------------------------- /samples/scenarios/scenario1/temp/s1ChildTeseCase.json_inputs_cosolidated.csv: -------------------------------------------------------------------------------- 1 | count1,count2,title,title2,title2_2,count1_2,count2_2,title_2 2 | 20,20,肖申克的救赎,肖申克的救赎霸王别姬,肖申克的救赎霸王别姬,20,20,肖申克的救赎 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario1/temp/s1ParentTestCase_out.csv: -------------------------------------------------------------------------------- 1 | count1,count2,title,title2 2 | 20,20,肖申克的救赎,肖申克的救赎霸王别姬 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario1/temp/s1ParentTestCase_out2.csv: -------------------------------------------------------------------------------- 1 | title2_2,count1_2,count2_2,title_2 2 | 肖申克的救赎霸王别姬,20,20,肖申克的救赎 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario2/s2ChildTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "s2ChildTestCase-001": { 4 | "priority": "1", 5 | "parentTestCase": "s2ParentTestCase-001", 6 | "inputs": ["s2ParentTestCase_out.csv"], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": { 19 | "status": { 20 | "Equals": 200 21 | }, 22 | "headers": { 23 | "Content-Type": { 24 | "Contains": "application/json" 25 | } 26 | }, 27 | "body": { 28 | "$(body).title": { 29 | "Contains": "${title}" 30 | } 31 | } 32 | } 33 | } 34 | } 35 | ] -------------------------------------------------------------------------------- /samples/scenarios/scenario2/temp/s2parenttestcase_out.csv: -------------------------------------------------------------------------------- 1 | title,title2,count1,count2 2 | 肖申克的救赎,肖申克的救赎霸王别姬,20,20 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario2/temp/s2parenttestcase_out2.csv: -------------------------------------------------------------------------------- 1 | count8_2,title_2,title2_2,count3_2,count5_2,count6_2,count7_2,count1_2,count2_2,count4_2 2 | [],"[""肖申克的救赎"",""霸王别姬"",""这个杀手不太冷"",""阿甘正传"",""美丽人生"",""泰坦尼克号"",""千与千寻"",""辛德勒的名单"",""盗梦空间"",""机器人总动员"",""忠犬八公的故事"",""三傻大闹宝莱坞"",""海上钢琴师"",""放牛班的春天"",""大话西游之大圣娶亲"",""楚门的世界"",""教父"",""龙猫"",""星际穿越"",""熔炉""]",+肖申克的救赎--霸王别姬,"[""20"",""30""]",3040,4050,20,20,"[""20"",""35""]" 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario2/temp/s2parenttestcase_out3.csv: -------------------------------------------------------------------------------- 1 | count1,count2,title,title2 2 | 20,20,肖申克的救赎,肖申克的救赎霸王别姬 3 | -------------------------------------------------------------------------------- /samples/scenarios/scenario2/temp/s2parenttestcase_out4.csv: -------------------------------------------------------------------------------- 1 | title,title2,count1,count2 2 | 肖申克的救赎,肖申克的救赎霸王别姬,20,20 3 | -------------------------------------------------------------------------------- /samples/testconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "DEV": { 3 | "baseUrl": "https://api.douban.com" 4 | }, 5 | "QA": { 6 | "baseUrl": "https://api.douban.com" 7 | }, 8 | "UAT": { 9 | "baseUrl": "https://api.douban.com" 10 | } 11 | } -------------------------------------------------------------------------------- /samples/testdata/Demo/FirstTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FirstTestCase-001": { 4 | "priority": "1", 5 | "parentTestCase": "root", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "setupkey": "${setupvalue}", 12 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 13 | }, 14 | "queryString": { 15 | "pageIndex": "1", 16 | "pageSize": "12" 17 | } 18 | }, 19 | "response": [ 20 | { 21 | "$(status).statusCode": { 22 | "Equals": 200 23 | } 24 | }, 25 | { 26 | "$(headers).Content-Type": { 27 | "Contains": "application/json;charset=UTF-8" 28 | } 29 | }, 30 | { 31 | "$(body).title": { 32 | "Equals": "肖申克的救赎" 33 | } 34 | } 35 | ], 36 | "outputs": [] 37 | } 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /samples/testdata/Demo/FirstTeseCase_2_1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FirstTestCase-001-2-1": { 4 | "priority": "1", 5 | "parentTestCase": "FirstTestCase-001", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": [ 19 | { 20 | "$(status).statusCode": { 21 | "Equals": 200 22 | } 23 | }, 24 | { 25 | "$(headers).Content-Type": { 26 | "Contains": "application/json;charset=UTF-8" 27 | } 28 | }, 29 | { 30 | "$(body).title": { 31 | "Equals": "肖申克的救赎" 32 | } 33 | } 34 | ], 35 | "outputs": [] 36 | } 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /samples/testdata/Demo/FirstTeseCase_2_2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FirstTestCase-001-2-2": { 4 | "priority": "2", 5 | "parentTestCase": "FirstTestCase-001", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": [ 19 | { 20 | "$(status).statusCode": { 21 | "Equals": 200 22 | } 23 | }, 24 | { 25 | "$(headers).Content-Type": { 26 | "Contains": "application/json;charset=UTF-8" 27 | } 28 | }, 29 | { 30 | "$(body).title": { 31 | "Equals": "The Shawshank Redemption" 32 | } 33 | }, 34 | { 35 | "$(body).original_title": { 36 | "Equals": "肖申克的救赎" 37 | } 38 | }, 39 | { 40 | "$(body).notexistkeyfortest": { 41 | "Equals": "_null_key_" 42 | } 43 | }, 44 | { 45 | "$(body).seasons_count": { 46 | "Equals": "_null_value_" 47 | } 48 | }, 49 | { 50 | "$(body).id": { 51 | "Equals": "_null_value_" 52 | } 53 | } 54 | ], 55 | "outputs": [] 56 | } 57 | } 58 | ] 59 | -------------------------------------------------------------------------------- /samples/testdata/Demo/FirstTeseCase_2_2_1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "FirstTestCase-001-2-2-1": { 4 | "priority": "3", 5 | "parentTestCase": "FirstTestCase-001-2-2", 6 | "inputs": [], 7 | "request": { 8 | "method": "GET", 9 | "path": "https://api.douban.com/v2/movie/subject/1292052", 10 | "headers": { 11 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 12 | }, 13 | "queryString": { 14 | "pageIndex": "1", 15 | "pageSize": "12" 16 | } 17 | }, 18 | "response": [ 19 | { 20 | "$(status).statusCode": { 21 | "Equals": 200 22 | } 23 | }, 24 | { 25 | "$(headers).Content-Type": { 26 | "Contains": "application/json;charset=UTF-8" 27 | } 28 | }, 29 | { 30 | "$(body).title": { 31 | "Equals": "肖申克的救赎" 32 | } 33 | } 34 | ], 35 | "outputs": [] 36 | } 37 | } 38 | ] 39 | -------------------------------------------------------------------------------- /samples/testdata/Demo/SecondTeseCase.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "SecondTestCase-${tc}": { 4 | "priority": "${priority}", 5 | "parentTestCase": "root", 6 | "request": { 7 | "method": "GET", 8 | "path": "https://api.douban.com/v2/movie/subject/1292052", 9 | "headers": { 10 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 11 | }, 12 | "queryString": { 13 | "pageIndex": "1", 14 | "pageSize": "12" 15 | } 16 | }, 17 | "response": [ 18 | { 19 | "$(status).statusCode": { 20 | "Equals": {"Fn::ToInt": "${statuscode}"} 21 | } 22 | }, 23 | { 24 | "$(headers).Content-Type": { 25 | "Contains": "application/json;charset=UTF-8" 26 | } 27 | } 28 | ] 29 | } 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /samples/testdata/Demo/SecondTeseCase_dt1.csv: -------------------------------------------------------------------------------- 1 | tc,priority,statuscode 2 | dt1-1,2,200 3 | dt1-2,2,200 4 | dt1-3,2,200 5 | dt1-4,2,200 -------------------------------------------------------------------------------- /samples/testdata/Demo/SecondTeseCase_dt2.csv: -------------------------------------------------------------------------------- 1 | tc,priority,statuscode 2 | dt2-1,3,500 3 | dt2-2,4,200 4 | dt2-3,3,500 5 | dt2-4,4,200 -------------------------------------------------------------------------------- /samples/testdata/Demo/Setup.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Setup-001": { 4 | "priority": "1", 5 | "parentTestCase": "root", 6 | "IfGlobalSetUpTestCase": true, 7 | "inputs": [], 8 | "request": { 9 | "method": "GET", 10 | "path": "https://api.douban.com/v2/movie/subject/1292052", 11 | "headers": { 12 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 13 | }, 14 | "queryString": { 15 | "pageIndex": "1", 16 | "pageSize": "12" 17 | } 18 | }, 19 | "response": [ 20 | { 21 | "$(status).statusCode": { 22 | "Equals": 200 23 | } 24 | }, 25 | { 26 | "$(headers).Content-Type": { 27 | "Contains": "application/json;charset=UTF-8" 28 | } 29 | }, 30 | { 31 | "$(body).title": { 32 | "Equals": "肖申克的救赎" 33 | } 34 | } 35 | ], 36 | "outputs": [], 37 | "outGlobalVariables": {"setupkey": "setupvalue"} 38 | } 39 | } 40 | ] 41 | -------------------------------------------------------------------------------- /samples/testdata/Demo/Teardown.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Teardown-001": { 4 | "priority": "1", 5 | "parentTestCase": "root", 6 | "IfGlobalTearDownTestCase": true, 7 | "inputs": [], 8 | "request": { 9 | "method": "GET", 10 | "path": "https://api.douban.com/v2/movie/subject/1292052", 11 | "headers": { 12 | "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" 13 | }, 14 | "queryString": { 15 | "pageIndex": "1", 16 | "pageSize": "12" 17 | } 18 | }, 19 | "response": [ 20 | { 21 | "$(status).statusCode": { 22 | "Equals": 200 23 | } 24 | }, 25 | { 26 | "$(headers).Content-Type": { 27 | "Contains": "application/json;charset=UTF-8" 28 | } 29 | }, 30 | { 31 | "$(body).title": { 32 | "Equals": "肖申克的救赎" 33 | } 34 | } 35 | ], 36 | "outputs": [] 37 | } 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /ui/js/graphic.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package js 12 | 13 | var Graphic = ` 14 | 15 | var circles = {{.Circles}}; 16 | 17 | var priorityLines = {{.PriorityLines}}; 18 | 19 | var parentChildrenlines = {{.ParentChildrenLines}}; 20 | ` -------------------------------------------------------------------------------- /ui/js/js.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package js 12 | 13 | var Js = ` 14 | function mergeTcResults(setUpTcResults, normalTcResults, tearDownTcResults) { 15 | var c = setUpTcResults.concat(normalTcResults); 16 | var dest = c.concat(tearDownTcResults); 17 | 18 | return dest 19 | } 20 | ` -------------------------------------------------------------------------------- /ui/js/mutationstats.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package js 12 | 13 | var MutationStats = ` 14 | var mutationStats1 = {{.StatsStr_1}} 15 | 16 | var mutationStats2 = {{.StatsStr_2}} 17 | 18 | var mutationStats3 = {{.StatsStr_3}} 19 | ` -------------------------------------------------------------------------------- /ui/js/results.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package js 12 | 13 | var Results = ` 14 | var setUpStartUnixNano = {{.SetUpStartUnixNano}}; 15 | var setUpStart = {{.SetUpStart}}; 16 | var setUpEndUnixNano = {{.SetUpEndUnixNano}}; 17 | var setUpEnd = {{.SetUpEnd}}; 18 | 19 | var normalStartUnixNano = {{.NormalStartUnixNano}}; 20 | var normalStart = {{.NormalStart}}; 21 | var normalEndUnixNano = {{.NormalEndUnixNano}}; 22 | var normalEnd = {{.NormalEnd}}; 23 | 24 | var tearDownStartUnixNano = {{.TearDownStartUnixNano}}; 25 | var tearDownStart = {{.TearDownStart}}; 26 | var tearDownEndUnixNano = {{.TearDownEndUnixNano}}; 27 | var tearDownEnd = {{.TearDownEnd}}; 28 | 29 | var gStartUnixNano = {{.GStartUnixNano}}; 30 | var gStart = {{.GStart}}; 31 | var gEndUnixNano = {{.GEndUnixNano}}; 32 | var gEnd = {{.GEnd}}; 33 | 34 | var tcResults = {{.TcResults}} 35 | ` -------------------------------------------------------------------------------- /ui/js/stats.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package js 12 | 13 | var Stats = ` 14 | var stats1 = {{.StatsStr_1}}; 15 | 16 | var stats2 = {{.StatsStr_2}}; 17 | 18 | var stats2_success = {{.StatsStr_Success}}; 19 | 20 | var stats2_fail = {{.StatsStr_Fail}}; 21 | 22 | var stats3_status = {{.StatsStr_Status}}; 23 | ` -------------------------------------------------------------------------------- /ui/template/body_template.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package ui -------------------------------------------------------------------------------- /ui/template/footer_template.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package ui -------------------------------------------------------------------------------- /ui/template/header_template.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package ui -------------------------------------------------------------------------------- /utils/float64_conv.go: -------------------------------------------------------------------------------- 1 | /* 2 | * go4api - an api testing tool written in Go 3 | * Created by: Ping Zhu 2018 4 | * 5 | * This program is distributed in the hope that it will be useful, 6 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | * 9 | */ 10 | 11 | package utils 12 | 13 | import ( 14 | "fmt" 15 | "math" 16 | "strconv" 17 | 18 | ) 19 | 20 | func FloatToString(input_num float64) string { 21 | // to convert a float number to a string 22 | return strconv.FormatFloat(input_num, 'f', -1, 64) 23 | } 24 | 25 | func CheckFloat64SubType(f float64) { 26 | // get current dir, 27 | fmt.Println(int64(f)) 28 | a, b := math.Modf(f) 29 | 30 | fmt.Println(a, b) 31 | fmt.Println(f) 32 | fmt.Println(fmt.Sprint(f)) 33 | fmt.Println(FloatToString(f)) 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/.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 | 26 | ### Code ### 27 | # Visual Studio Code - https://code.visualstudio.com/ 28 | .settings/ 29 | .vscode/ -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | go: 5 | - 1.11 6 | - tip 7 | 8 | install: true 9 | env: 10 | - GO111MODULE=on 11 | 12 | script: 13 | - go vet -x ./... 14 | - test -z "$(golint ./...)" 15 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 16 | - go test -v ./... 17 | - go test -covermode=count -coverprofile=profile.cov 18 | - test -z "$(apicompat -before ${TRAVIS_COMMIT_RANGE%...*} -after ${TRAVIS_COMMIT_RANGE#*...} ./... | tee /dev/stderr)" 19 | 20 | after_script: 21 | - goveralls -coverprofile=profile.cov -service=travis-ci 22 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/doc.go: -------------------------------------------------------------------------------- 1 | // Package linq provides methods for querying and manipulating slices, arrays, 2 | // maps, strings, channels and collections. 3 | // 4 | // Authors: Alexander Kalankhodzhaev (kalan), Ahmet Alp Balkan, Cleiton Marques 5 | // Souza. 6 | package linq 7 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ahmetb/go-linq/v3 2 | 3 | go 1.11 4 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/index.go: -------------------------------------------------------------------------------- 1 | package linq 2 | 3 | // IndexOf searches for an element that matches the conditions defined by a specified predicate 4 | // and returns the zero-based index of the first occurrence within the collection. This method 5 | // returns -1 if an item that matches the conditions is not found. 6 | func (q Query) IndexOf(predicate func(interface{}) bool) int { 7 | index := 0 8 | next := q.Iterate() 9 | 10 | for item, ok := next(); ok; item, ok = next() { 11 | if predicate(item) { 12 | return index 13 | } 14 | index++ 15 | } 16 | 17 | return -1 18 | } 19 | 20 | // IndexOfT is the typed version of IndexOf. 21 | // 22 | // - predicateFn is of type "func(int,TSource)bool" 23 | // 24 | // NOTE: IndexOf has better performance than IndexOfT. 25 | func (q Query) IndexOfT(predicateFn interface{}) int { 26 | 27 | predicateGenericFunc, err := newGenericFunc( 28 | "IndexOfT", "predicateFn", predicateFn, 29 | simpleParamValidator(newElemTypeSlice(new(genericType)), newElemTypeSlice(new(bool))), 30 | ) 31 | if err != nil { 32 | panic(err) 33 | } 34 | 35 | predicateFunc := func(item interface{}) bool { 36 | return predicateGenericFunc.Call(item).(bool) 37 | } 38 | 39 | return q.IndexOf(predicateFunc) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/reverse.go: -------------------------------------------------------------------------------- 1 | package linq 2 | 3 | // Reverse inverts the order of the elements in a collection. 4 | // 5 | // Unlike OrderBy, this sorting method does not consider the actual values 6 | // themselves in determining the order. Rather, it just returns the elements in 7 | // the reverse order from which they are produced by the underlying source. 8 | func (q Query) Reverse() Query { 9 | return Query{ 10 | Iterate: func() Iterator { 11 | next := q.Iterate() 12 | 13 | items := []interface{}{} 14 | for item, ok := next(); ok; item, ok = next() { 15 | items = append(items, item) 16 | } 17 | 18 | index := len(items) - 1 19 | return func() (item interface{}, ok bool) { 20 | if index < 0 { 21 | return 22 | } 23 | 24 | item, ok = items[index], true 25 | index-- 26 | return 27 | } 28 | }, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/ahmetb/go-linq/union.go: -------------------------------------------------------------------------------- 1 | package linq 2 | 3 | // Union produces the set union of two collections. 4 | // 5 | // This method excludes duplicates from the return set. This is different 6 | // behavior to the Concat method, which returns all the elements in the input 7 | // collection including duplicates. 8 | func (q Query) Union(q2 Query) Query { 9 | return Query{ 10 | Iterate: func() Iterator { 11 | next := q.Iterate() 12 | next2 := q2.Iterate() 13 | 14 | set := make(map[interface{}]bool) 15 | use1 := true 16 | 17 | return func() (item interface{}, ok bool) { 18 | if use1 { 19 | for item, ok = next(); ok; item, ok = next() { 20 | if _, has := set[item]; !has { 21 | set[item] = true 22 | return 23 | } 24 | } 25 | 26 | use1 = false 27 | } 28 | 29 | for item, ok = next2(); ok; item, ok = next2() { 30 | if _, has := set[item]; !has { 31 | set[item] = true 32 | return 33 | } 34 | } 35 | 36 | return 37 | } 38 | }, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/dlclark/regexp2/.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 | *.out 26 | 27 | .DS_Store 28 | -------------------------------------------------------------------------------- /vendor/github.com/dlclark/regexp2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.5 5 | - tip -------------------------------------------------------------------------------- /vendor/github.com/dlclark/regexp2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Doug Clark 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/dlclark/regexp2/syntax/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package syntax 4 | 5 | // Fuzz is the input point for go-fuzz 6 | func Fuzz(data []byte) int { 7 | sdata := string(data) 8 | tree, err := Parse(sdata, RegexOptions(0)) 9 | if err != nil { 10 | return 0 11 | } 12 | 13 | // translate it to code 14 | _, err = Write(tree) 15 | if err != nil { 16 | panic(err) 17 | } 18 | 19 | return 1 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/dop251/goja/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | testdata/test262 4 | -------------------------------------------------------------------------------- /vendor/github.com/dop251/goja/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.x 4 | 5 | env: 6 | - GIMME_OS=linux GIMME_ARCH=amd64 RACE="-race" 7 | - GIMME_OS=linux GIMME_ARCH=386 8 | 9 | before_install: 10 | # use local source tree when testing forks 11 | - mkdir -p $GOPATH/src/github.com/dop251/ 12 | - ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/dop251/ || true 13 | 14 | script: 15 | - diff -u <(echo -n) <(gofmt -d .) 16 | - go vet . 17 | - go test -short $RACE ./... 18 | -------------------------------------------------------------------------------- /vendor/github.com/dop251/goja/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Dmitry Panov 2 | 3 | Copyright (c) 2012 Robert Krimen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 6 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 13 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 15 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/dop251/goja/parser/scope.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "github.com/dop251/goja/ast" 5 | ) 6 | 7 | type _scope struct { 8 | outer *_scope 9 | allowIn bool 10 | inIteration bool 11 | inSwitch bool 12 | inFunction bool 13 | declarationList []ast.Declaration 14 | 15 | labels []string 16 | } 17 | 18 | func (self *_parser) openScope() { 19 | self.scope = &_scope{ 20 | outer: self.scope, 21 | allowIn: true, 22 | } 23 | } 24 | 25 | func (self *_parser) closeScope() { 26 | self.scope = self.scope.outer 27 | } 28 | 29 | func (self *_scope) declare(declaration ast.Declaration) { 30 | self.declarationList = append(self.declarationList, declaration) 31 | } 32 | 33 | func (self *_scope) hasLabel(name string) bool { 34 | for _, label := range self.labels { 35 | if label == name { 36 | return true 37 | } 38 | } 39 | if self.outer != nil && !self.inFunction { 40 | // Crossing a function boundary to look for a label is verboten 41 | return self.outer.hasLabel(name) 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/dop251/goja/token/Makefile: -------------------------------------------------------------------------------- 1 | token_const.go: tokenfmt 2 | ./$^ | gofmt > $@ 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-sourcemap/sourcemap/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - 1.7.x 6 | - 1.8.x 7 | - 1.9.x 8 | - tip 9 | 10 | matrix: 11 | allow_failures: 12 | - go: tip 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-sourcemap/sourcemap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 The github.com/go-sourcemap/sourcemap Contributors. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-sourcemap/sourcemap/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go test ./... 3 | go test ./... -short -race 4 | go vet 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-sourcemap/sourcemap/README.md: -------------------------------------------------------------------------------- 1 | # Source maps consumer for Golang 2 | 3 | [![Build Status](https://travis-ci.org/go-sourcemap/sourcemap.svg)](https://travis-ci.org/go-sourcemap/sourcemap) 4 | 5 | API docs: https://godoc.org/github.com/go-sourcemap/sourcemap. 6 | Examples: https://godoc.org/github.com/go-sourcemap/sourcemap#pkg-examples. 7 | Spec: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit. 8 | 9 | ## Installation 10 | 11 | Install: 12 | 13 | ```shell 14 | go get -u github.com/go-sourcemap/sourcemap 15 | ``` 16 | 17 | ## Quickstart 18 | 19 | ```go 20 | func ExampleParse() { 21 | mapURL := "http://code.jquery.com/jquery-2.0.3.min.map" 22 | resp, err := http.Get(mapURL) 23 | if err != nil { 24 | panic(err) 25 | } 26 | defer resp.Body.Close() 27 | 28 | b, err := ioutil.ReadAll(resp.Body) 29 | if err != nil { 30 | panic(err) 31 | } 32 | 33 | smap, err := sourcemap.Parse(mapURL, b) 34 | if err != nil { 35 | panic(err) 36 | } 37 | 38 | line, column := 5, 6789 39 | file, fn, line, col, ok := smap.Source(line, column) 40 | fmt.Println(file, fn, line, col, ok) 41 | // Output: http://code.jquery.com/jquery-2.0.3.js apply 4360 27 true 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /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/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/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/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/go-sql-driver/mysql/utils_go18.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build go1.8 10 | 11 | package mysql 12 | 13 | import ( 14 | "crypto/tls" 15 | "database/sql" 16 | "database/sql/driver" 17 | "errors" 18 | "fmt" 19 | ) 20 | 21 | func cloneTLSConfig(c *tls.Config) *tls.Config { 22 | return c.Clone() 23 | } 24 | 25 | func namedValueToValue(named []driver.NamedValue) ([]driver.Value, error) { 26 | dargs := make([]driver.Value, len(named)) 27 | for n, param := range named { 28 | if len(param.Name) > 0 { 29 | // TODO: support the use of Named Parameters #561 30 | return nil, errors.New("mysql: driver does not support the use of Named Parameters") 31 | } 32 | dargs[n] = param.Value 33 | } 34 | return dargs, nil 35 | } 36 | 37 | func mapIsolationLevel(level driver.IsolationLevel) (string, error) { 38 | switch sql.IsolationLevel(level) { 39 | case sql.LevelRepeatableRead: 40 | return "REPEATABLE READ", nil 41 | case sql.LevelReadCommitted: 42 | return "READ COMMITTED", nil 43 | case sql.LevelReadUncommitted: 44 | return "READ UNCOMMITTED", nil 45 | case sql.LevelSerializable: 46 | return "SERIALIZABLE", nil 47 | default: 48 | return "", fmt.Errorf("mysql: unsupported isolation level: %v", level) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.7.x 5 | - 1.8.x 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | before_install: 12 | - go get github.com/mattn/goveralls 13 | 14 | script: 15 | - goveralls -service=travis-ci 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Chris Hines 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/go-stack/stack 2 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Klaus Post 15 | Rodolfo Carvalho 16 | Sebastien Binet 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/golang/snappy 2 | -------------------------------------------------------------------------------- /vendor/github.com/gomodule/redigo/redis/go16.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gomodule/redigo/redis/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7,!go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | DynamicRecordSizingDisabled: cfg.DynamicRecordSizingDisabled, 27 | Renegotiation: cfg.Renegotiation, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/gomodule/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/gomodule/redigo/redis/pool17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Gary Burd 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | // +build go1.7 16 | 17 | package redis 18 | 19 | import "context" 20 | 21 | // GetContext gets a connection using the provided context. 22 | // 23 | // The provided Context must be non-nil. If the context expires before the 24 | // connection is complete, an error is returned. Any expiration on the context 25 | // will not affect the returned connection. 26 | // 27 | // If the function completes without error, then the application must close the 28 | // returned connection. 29 | func (p *Pool) GetContext(ctx context.Context) (Conn, error) { 30 | pc, err := p.get(ctx) 31 | if err != nil { 32 | return errorConn{err}, err 33 | } 34 | return &activeConn{p: p, pc: pc}, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/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/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to pq 2 | 3 | `pq` has a backlog of pull requests, but contributions are still very 4 | much welcome. You can help with patch review, submitting bug reports, 5 | or adding new functionality. There is no formal style guide, but 6 | please conform to the style of existing code and general Go formatting 7 | conventions when submitting patches. 8 | 9 | ### Patch review 10 | 11 | Help review existing open pull requests by commenting on the code or 12 | proposed functionality. 13 | 14 | ### Bug reports 15 | 16 | We appreciate any bug reports, but especially ones with self-contained 17 | (doesn't depend on code outside of pq), minimal (can't be simplified 18 | further) test cases. It's especially helpful if you can submit a pull 19 | request with just the failing test case (you'll probably want to 20 | pattern it after the tests in 21 | [conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). 22 | 23 | ### New functionality 24 | 25 | There are a number of pending patches for new functionality, so 26 | additional feature patches will take a while to merge. Still, patches 27 | are generally reviewed based on usefulness and complexity in addition 28 | to time-in-queue, so if you have a knockout idea, take a shot. Feel 29 | free to open an issue discussion your proposed patch beforehand. 30 | -------------------------------------------------------------------------------- /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/certs/root.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEAzCCAuugAwIBAgIJANmheROCdW1NMA0GCSqGSIb3DQEBBQUAMF4xCzAJBgNV 3 | BAYTAlVTMQ8wDQYDVQQIEwZOZXZhZGExEjAQBgNVBAcTCUxhcyBWZWdhczEaMBgG 4 | A1UEChMRZ2l0aHViLmNvbS9saWIvcHExDjAMBgNVBAMTBXBxIENBMB4XDTE0MTAx 5 | MTE1MDQyOVoXDTI0MTAwODE1MDQyOVowXjELMAkGA1UEBhMCVVMxDzANBgNVBAgT 6 | Bk5ldmFkYTESMBAGA1UEBxMJTGFzIFZlZ2FzMRowGAYDVQQKExFnaXRodWIuY29t 7 | L2xpYi9wcTEOMAwGA1UEAxMFcHEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 8 | ggEKAoIBAQCV4PxP7ShzWBzUCThcKk3qZtOLtHmszQVtbqhvgTpm1kTRtKBdVMu0 9 | pLAHQ3JgJCnAYgH0iZxVGoMP16T3irdgsdC48+nNTFM2T0cCdkfDURGIhSFN47cb 10 | Pgy306BcDUD2q7ucW33+dlFSRuGVewocoh4BWM/vMtMvvWzdi4Ag/L/jhb+5wZxZ 11 | sWymsadOVSDePEMKOvlCa3EdVwVFV40TVyDb+iWBUivDAYsS2a3KajuJrO6MbZiE 12 | Sp2RCIkZS2zFmzWxVRi9ZhzIZhh7EVF9JAaNC3T52jhGUdlRq3YpBTMnd89iOh74 13 | 6jWXG7wSuPj3haFzyNhmJ0ZUh+2Ynoh1AgMBAAGjgcMwgcAwHQYDVR0OBBYEFFKT 14 | 7R52Cp9lT94ZZsHVIkA1y6ByMIGQBgNVHSMEgYgwgYWAFFKT7R52Cp9lT94ZZsHV 15 | IkA1y6ByoWKkYDBeMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGTmV2YWRhMRIwEAYD 16 | VQQHEwlMYXMgVmVnYXMxGjAYBgNVBAoTEWdpdGh1Yi5jb20vbGliL3BxMQ4wDAYD 17 | VQQDEwVwcSBDQYIJANmheROCdW1NMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF 18 | BQADggEBAAEhCLWkqJNMI8b4gkbmj5fqQ/4+oO83bZ3w2Oqf6eZ8I8BC4f2NOyE6 19 | tRUlq5+aU7eqC1cOAvGjO+YHN/bF/DFpwLlzvUSXt+JP/pYcUjL7v+pIvwqec9hD 20 | ndvM4iIbkD/H/OYQ3L+N3W+G1x7AcFIX+bGCb3PzYVQAjxreV6//wgKBosMGFbZo 21 | HPxT9RPMun61SViF04H5TNs0derVn1+5eiiYENeAhJzQNyZoOOUuX1X/Inx9bEPh 22 | C5vFBtSMgIytPgieRJVWAiMLYsfpIAStrHztRAbBs2DU01LmMgRvHdxgFEKinC/d 23 | UHZZQDP+6pT+zADrGhQGXe4eThaO6f0= 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /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 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/tealeg/xlsx/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .DS_Store 3 | xlsx.test 4 | *.swp 5 | coverage.txt 6 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | install: 4 | - go get -d -t -v ./... && go build -v ./... 5 | 6 | go: 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - 1.8 11 | - tip 12 | 13 | script: 14 | - go vet ./... 15 | - go test -v -coverprofile=coverage.txt -covermode=atomic 16 | 17 | after_success: 18 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/col.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | // Default column width in excel 4 | const ColWidth = 9.5 5 | 6 | type Col struct { 7 | Min int 8 | Max int 9 | Hidden bool 10 | Width float64 11 | Collapsed bool 12 | OutlineLevel uint8 13 | numFmt string 14 | style *Style 15 | } 16 | 17 | func (c *Col) SetType(cellType CellType) { 18 | switch cellType { 19 | case CellTypeString: 20 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_STRING] 21 | case CellTypeBool: 22 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] //TEMP 23 | case CellTypeNumeric: 24 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_INT] 25 | case CellTypeDate: 26 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_DATE] 27 | case CellTypeFormula: 28 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] 29 | case CellTypeError: 30 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] //TEMP 31 | case CellTypeGeneral: 32 | c.numFmt = builtInNumFmt[builtInNumFmtIndex_GENERAL] 33 | } 34 | } 35 | 36 | // GetStyle returns the Style associated with a Col 37 | func (c *Col) GetStyle() *Style { 38 | return c.style 39 | } 40 | 41 | // SetStyle sets the style of a Col 42 | func (c *Col) SetStyle(style *Style) { 43 | c.style = style 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/doc.go: -------------------------------------------------------------------------------- 1 | // xslx is a package designed to help with reading data from 2 | // spreadsheets stored in the XLSX format used in recent versions of 3 | // Microsoft's Excel spreadsheet. 4 | // 5 | // Additionally, xlsx has started to grow some XLSX authoring 6 | // capabilities too. 7 | // 8 | // For a concise example of how to use this library why not check out 9 | // the source for xlsx2csv here: https://github.com/tealeg/xlsx2csv 10 | 11 | package xlsx 12 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/row.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | type Row struct { 4 | Cells []*Cell 5 | Hidden bool 6 | Sheet *Sheet 7 | Height float64 8 | OutlineLevel uint8 9 | isCustom bool 10 | } 11 | 12 | func (r *Row) SetHeight(ht float64) { 13 | r.Height = ht 14 | r.isCustom = true 15 | } 16 | 17 | func (r *Row) SetHeightCM(ht float64) { 18 | r.Height = ht * 28.3464567 // Convert CM to postscript points 19 | r.isCustom = true 20 | } 21 | 22 | func (r *Row) AddCell() *Cell { 23 | cell := NewCell(r) 24 | r.Cells = append(r.Cells, cell) 25 | r.Sheet.maybeAddCol(len(r.Cells)) 26 | return cell 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/theme.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | type theme struct { 9 | colors []string 10 | } 11 | 12 | func newTheme(themeXml xlsxTheme) *theme { 13 | clrMap := map[string]string{} 14 | clrSchemes := themeXml.ThemeElements.ClrScheme.Children 15 | for _, scheme := range clrSchemes { 16 | var rgbColor string 17 | if scheme.SysClr != nil { 18 | rgbColor = scheme.SysClr.LastClr 19 | } else { 20 | rgbColor = scheme.SrgbClr.Val 21 | } 22 | clrMap[scheme.XMLName.Local] = rgbColor 23 | } 24 | colors := []string{clrMap["lt1"], clrMap["dk1"], clrMap["lt2"], clrMap["dk2"], clrMap["accent1"], 25 | clrMap["accent2"], clrMap["accent3"], clrMap["accent4"], clrMap["accent5"], 26 | clrMap["accent6"], clrMap["hlink"], clrMap["folHlink"]} 27 | return &theme{colors} 28 | } 29 | 30 | func (t *theme) themeColor(index int64, tint float64) string { 31 | baseColor := t.colors[index] 32 | if tint == 0 { 33 | return "FF" + baseColor 34 | } else { 35 | r, _ := strconv.ParseInt(baseColor[0:2], 16, 64) 36 | g, _ := strconv.ParseInt(baseColor[2:4], 16, 64) 37 | b, _ := strconv.ParseInt(baseColor[4:6], 16, 64) 38 | h, s, l := RGBToHSL(uint8(r), uint8(g), uint8(b)) 39 | if tint < 0 { 40 | l *= (1 + tint) 41 | } else { 42 | l = l*(1-tint) + (1 - (1 - tint)) 43 | } 44 | br, bg, bb := HSLToRGB(h, s, l) 45 | return fmt.Sprintf("FF%02X%02X%02X", br, bg, bb) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/tealeg/xlsx/xmlSharedStrings.go: -------------------------------------------------------------------------------- 1 | package xlsx 2 | 3 | import ( 4 | "encoding/xml" 5 | ) 6 | 7 | // xlsxSST directly maps the sst element from the namespace 8 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main currently 9 | // I have not checked this for completeness - it does as much as I need. 10 | type xlsxSST struct { 11 | XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"` 12 | Count int `xml:"count,attr"` 13 | UniqueCount int `xml:"uniqueCount,attr"` 14 | SI []xlsxSI `xml:"si"` 15 | } 16 | 17 | // xlsxSI directly maps the si element from the namespace 18 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main - 19 | // currently I have not checked this for completeness - it does as 20 | // much as I need. 21 | type xlsxSI struct { 22 | T string `xml:"t"` 23 | R []xlsxR `xml:"r"` 24 | } 25 | 26 | // xlsxR directly maps the r element from the namespace 27 | // http://schemas.openxmlformats.org/spreadsheetml/2006/main - 28 | // currently I have not checked this for completeness - it does as 29 | // much as I need. 30 | type xlsxR struct { 31 | T string `xml:"t"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Josh Baker 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/tidwall/gjson/gjson_gae.go: -------------------------------------------------------------------------------- 1 | //+build appengine js 2 | 3 | package gjson 4 | 5 | func getBytes(json []byte, path string) Result { 6 | return Get(string(json), path) 7 | } 8 | func fillIndex(json string, c *parseContext) { 9 | // noop. Use zero for the Index value. 10 | } 11 | 12 | func stringBytes(s string) []byte { 13 | return []byte(s) 14 | } 15 | 16 | func bytesString(b []byte) string { 17 | return string(b) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/tidwall/gjson 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/tidwall/match v1.0.1 7 | github.com/tidwall/pretty v1.0.0 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/go.sum: -------------------------------------------------------------------------------- 1 | github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= 2 | github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= 3 | github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= 4 | github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= 5 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/gjson/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/vendor/github.com/tidwall/gjson/logo.png -------------------------------------------------------------------------------- /vendor/github.com/tidwall/match/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/match/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Josh Baker 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/tidwall/match/README.md: -------------------------------------------------------------------------------- 1 | Match 2 | ===== 3 | Build Status 4 | GoDoc 5 | 6 | Match is a very simple pattern matcher where '*' matches on any 7 | number characters and '?' matches on any one character. 8 | 9 | Installing 10 | ---------- 11 | 12 | ``` 13 | go get -u github.com/tidwall/match 14 | ``` 15 | 16 | Example 17 | ------- 18 | 19 | ```go 20 | match.Match("hello", "*llo") 21 | match.Match("jello", "?ello") 22 | match.Match("hello", "h*o") 23 | ``` 24 | 25 | 26 | Contact 27 | ------- 28 | Josh Baker [@tidwall](http://twitter.com/tidwall) 29 | 30 | License 31 | ------- 32 | Redcon source code is available under the MIT [License](/LICENSE). 33 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/pretty/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/pretty/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Josh Baker 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/tidwall/sjson/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/sjson/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Josh Baker 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 | 22 | -------------------------------------------------------------------------------- /vendor/github.com/tidwall/sjson/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/vendor/github.com/tidwall/sjson/logo.png -------------------------------------------------------------------------------- /vendor/github.com/xdg/scram/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/vendor/github.com/xdg/scram/.gitignore -------------------------------------------------------------------------------- /vendor/github.com/xdg/scram/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - "1.7" 5 | - "1.8" 6 | - "1.9" 7 | - "1.10" 8 | - master 9 | matrix: 10 | allow_failures: 11 | - go: master 12 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/scram/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by David A. Golden. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // Package scram provides client and server implementations of the Salted 8 | // Challenge Response Authentication Mechanism (SCRAM) described in RFC-5802 9 | // and RFC-7677. 10 | // 11 | // Usage 12 | // 13 | // The scram package provides two variables, `SHA1` and `SHA256`, that are 14 | // used to construct Client or Server objects. 15 | // 16 | // clientSHA1, err := scram.SHA1.NewClient(username, password, authID) 17 | // clientSHA256, err := scram.SHA256.NewClient(username, password, authID) 18 | // 19 | // serverSHA1, err := scram.SHA1.NewServer(credentialLookupFcn) 20 | // serverSHA256, err := scram.SHA256.NewServer(credentialLookupFcn) 21 | // 22 | // These objects are used to construct ClientConversation or 23 | // ServerConversation objects that are used to carry out authentication. 24 | package scram 25 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zpsean/go4api/4a878a609d184d335a7879b1603a99f4d0dbfbd0/vendor/github.com/xdg/stringprep/.gitignore -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - "1.7" 5 | - "1.8" 6 | - "1.9" 7 | - "1.10" 8 | - master 9 | matrix: 10 | allow_failures: 11 | - go: master 12 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/xdg/stringprep?status.svg)](https://godoc.org/github.com/xdg/stringprep) 2 | [![Build Status](https://travis-ci.org/xdg/stringprep.svg?branch=master)](https://travis-ci.org/xdg/stringprep) 3 | 4 | # stringprep – Go implementation of RFC-3454 stringprep and RFC-4013 SASLprep 5 | 6 | ## Synopsis 7 | 8 | ``` 9 | import "github.com/xdg/stringprep" 10 | 11 | prepped := stringprep.SASLprep.Prepare("TrustNô1") 12 | 13 | ``` 14 | 15 | ## Description 16 | 17 | This library provides an implementation of the stringprep algorithm 18 | (RFC-3454) in Go, including all data tables. 19 | 20 | A pre-built SASLprep (RFC-4013) profile is provided as well. 21 | 22 | ## Copyright and License 23 | 24 | Copyright 2018 by David A. Golden. All rights reserved. 25 | 26 | Licensed under the Apache License, Version 2.0 (the "License"). You may 27 | obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 28 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by David A. Golden. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // Package stringprep provides data tables and algorithms for RFC-3454, 8 | // including errata (as of 2018-02). It also provides a profile for 9 | // SASLprep as defined in RFC-4013. 10 | package stringprep 11 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/error.go: -------------------------------------------------------------------------------- 1 | package stringprep 2 | 3 | import "fmt" 4 | 5 | // Error describes problems encountered during stringprep, including what rune 6 | // was problematic. 7 | type Error struct { 8 | Msg string 9 | Rune rune 10 | } 11 | 12 | func (e Error) Error() string { 13 | return fmt.Sprintf("%s (rune: '\\u%04x')", e.Msg, e.Rune) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/map.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by David A. Golden. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package stringprep 8 | 9 | // Mapping represents a stringprep mapping, from a single rune to zero or more 10 | // runes. 11 | type Mapping map[rune][]rune 12 | 13 | // Map maps a rune to a (possibly empty) rune slice via a stringprep Mapping. 14 | // The ok return value is false if the rune was not found. 15 | func (m Mapping) Map(r rune) (replacement []rune, ok bool) { 16 | rs, ok := m[r] 17 | if !ok { 18 | return nil, false 19 | } 20 | return rs, true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/saslprep.go: -------------------------------------------------------------------------------- 1 | package stringprep 2 | 3 | var mapNonASCIISpaceToASCIISpace = Mapping{ 4 | 0x00A0: []rune{0x0020}, 5 | 0x1680: []rune{0x0020}, 6 | 0x2000: []rune{0x0020}, 7 | 0x2001: []rune{0x0020}, 8 | 0x2002: []rune{0x0020}, 9 | 0x2003: []rune{0x0020}, 10 | 0x2004: []rune{0x0020}, 11 | 0x2005: []rune{0x0020}, 12 | 0x2006: []rune{0x0020}, 13 | 0x2007: []rune{0x0020}, 14 | 0x2008: []rune{0x0020}, 15 | 0x2009: []rune{0x0020}, 16 | 0x200A: []rune{0x0020}, 17 | 0x200B: []rune{0x0020}, 18 | 0x202F: []rune{0x0020}, 19 | 0x205F: []rune{0x0020}, 20 | 0x3000: []rune{0x0020}, 21 | } 22 | 23 | // SASLprep is a pre-defined stringprep profile for user names and passwords 24 | // as described in RFC-4013. 25 | // 26 | // Because the stringprep distinction between query and stored strings was 27 | // intended for compatibility across profile versions, but SASLprep was never 28 | // updated and is now deprecated, this profile only operates in stored 29 | // strings mode, prohibiting unassigned code points. 30 | var SASLprep Profile = saslprep 31 | 32 | var saslprep = Profile{ 33 | Mappings: []Mapping{ 34 | TableB1, 35 | mapNonASCIISpaceToASCIISpace, 36 | }, 37 | Normalize: true, 38 | Prohibits: []Set{ 39 | TableA1, 40 | TableC1_2, 41 | TableC2_1, 42 | TableC2_2, 43 | TableC3, 44 | TableC4, 45 | TableC5, 46 | TableC6, 47 | TableC7, 48 | TableC8, 49 | TableC9, 50 | }, 51 | CheckBiDi: true, 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/xdg/stringprep/set.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 by David A. Golden. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package stringprep 8 | 9 | import "sort" 10 | 11 | // RuneRange represents a close-ended range of runes: [N,M]. For a range 12 | // consisting of a single rune, N and M will be equal. 13 | type RuneRange [2]rune 14 | 15 | // Contains returns true if a rune is within the bounds of the RuneRange. 16 | func (rr RuneRange) Contains(r rune) bool { 17 | return rr[0] <= r && r <= rr[1] 18 | } 19 | 20 | func (rr RuneRange) isAbove(r rune) bool { 21 | return r <= rr[0] 22 | } 23 | 24 | // Set represents a stringprep data table used to identify runes of a 25 | // particular type. 26 | type Set []RuneRange 27 | 28 | // Contains returns true if a rune is within any of the RuneRanges in the 29 | // Set. 30 | func (s Set) Contains(r rune) bool { 31 | i := sort.Search(len(s), func(i int) bool { return s[i].Contains(r) || s[i].isAbove(r) }) 32 | if i < len(s) && s[i].Contains(r) { 33 | return true 34 | } 35 | return false 36 | } 37 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package bsoncodec 8 | 9 | // Proxy is an interface implemented by types that cannot themselves be directly encoded. Types 10 | // that implement this interface with have ProxyBSON called during the encoding process and that 11 | // value will be encoded in place for the implementer. 12 | type Proxy interface { 13 | ProxyBSON() (interface{}, error) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // Package bsonrw contains abstractions for reading and writing 8 | // BSON and BSON like types from sources. 9 | package bsonrw // import "go.mongodb.org/mongo-driver/bson/bsonrw" 10 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/bson/registry.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package bson 8 | 9 | import "go.mongodb.org/mongo-driver/bson/bsoncodec" 10 | 11 | // DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the 12 | // primitive codecs. 13 | var DefaultRegistry = NewRegistryBuilder().Build() 14 | 15 | // NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and 16 | // deocders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the 17 | // PrimitiveCodecs type in this package. 18 | func NewRegistryBuilder() *bsoncodec.RegistryBuilder { 19 | rb := bsoncodec.NewRegistryBuilder() 20 | bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb) 21 | bsoncodec.DefaultValueDecoders{}.RegisterDefaultDecoders(rb) 22 | primitiveCodecs.RegisterPrimitiveCodecs(rb) 23 | return rb 24 | } 25 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/internal/const.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package internal // import "go.mongodb.org/mongo-driver/internal" 8 | 9 | // Version is the current version of the driver. 10 | var Version = "local build" 11 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/internal/semaphore.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package internal 8 | 9 | import ( 10 | "context" 11 | "errors" 12 | ) 13 | 14 | // NewSemaphore creates a new semaphore. 15 | func NewSemaphore(slots uint64) *Semaphore { 16 | ch := make(chan struct{}, slots) 17 | for i := uint64(0); i < slots; i++ { 18 | ch <- struct{}{} 19 | } 20 | 21 | return &Semaphore{ 22 | permits: ch, 23 | } 24 | } 25 | 26 | // Semaphore is a synchronization primitive that controls access 27 | // to a common resource. 28 | type Semaphore struct { 29 | permits chan struct{} 30 | } 31 | 32 | // Len gets the number of permits available. 33 | func (s *Semaphore) Len() uint64 { 34 | return uint64(len(s.permits)) 35 | } 36 | 37 | // Wait waits until a resource is available or until the context 38 | // is done. 39 | func (s *Semaphore) Wait(ctx context.Context) error { 40 | select { 41 | case <-s.permits: 42 | return nil 43 | case <-ctx.Done(): 44 | return ctx.Err() 45 | } 46 | } 47 | 48 | // Release releases a resource back into the pool. 49 | func (s *Semaphore) Release() error { 50 | select { 51 | case s.permits <- struct{}{}: 52 | default: 53 | return errors.New("internal.Semaphore.Release: attempt to release more resources than are available") 54 | } 55 | 56 | return nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/batch_cursor.go: -------------------------------------------------------------------------------- 1 | package mongo 2 | 3 | import ( 4 | "context" 5 | 6 | "go.mongodb.org/mongo-driver/x/bsonx/bsoncore" 7 | "go.mongodb.org/mongo-driver/x/mongo/driver" 8 | ) 9 | 10 | // batchCursor is the interface implemented by types that can provide batches of document results. 11 | // The Cursor type is built on top of this type. 12 | type batchCursor interface { 13 | // ID returns the ID of the cursor. 14 | ID() int64 15 | 16 | // Next returns true if there is a batch available. 17 | Next(context.Context) bool 18 | 19 | // Batch will return a DocumentSequence for the current batch of documents. The returned 20 | // DocumentSequence is only valid until the next call to Next or Close. 21 | Batch() *bsoncore.DocumentSequence 22 | 23 | // Server returns a pointer to the cursor's server. 24 | Server() driver.Server 25 | 26 | // Err returns the last error encountered. 27 | Err() error 28 | 29 | // Close closes the cursor. 30 | Close(context.Context) error 31 | } 32 | 33 | // changeStreamCursor is the interface implemented by batch cursors that also provide the functionality for retrieving 34 | // a postBatchResumeToken from commands and allows for the cursor to be killed rather than closed 35 | type changeStreamCursor interface { 36 | batchCursor 37 | // PostBatchResumeToken returns the latest seen post batch resume token. 38 | PostBatchResumeToken() bsoncore.Document 39 | 40 | // KillCursor kills cursor on server without closing batch cursor 41 | KillCursor(context.Context) error 42 | } 43 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions_1_10.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package options 4 | 5 | import "crypto/x509" 6 | 7 | func x509CertSubject(cert *x509.Certificate) string { 8 | return cert.Subject.String() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions_1_9.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package options 4 | 5 | import ( 6 | "crypto/x509" 7 | ) 8 | 9 | // We don't support version less then 1.10, but Evergreen needs to be able to compile the driver 10 | // using version 1.8. 11 | func x509CertSubject(cert *x509.Certificate) string { 12 | return "" 13 | } 14 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/deleteoptions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package options 8 | 9 | // DeleteOptions represents all possible options to the DeleteOne() and DeleteMany() functions. 10 | type DeleteOptions struct { 11 | Collation *Collation // Specifies a collation 12 | } 13 | 14 | // Delete returns a pointer to a new DeleteOptions 15 | func Delete() *DeleteOptions { 16 | return &DeleteOptions{} 17 | } 18 | 19 | // SetCollation specifies a collation 20 | // Valid for servers >= 3.4. 21 | func (do *DeleteOptions) SetCollation(c *Collation) *DeleteOptions { 22 | do.Collation = c 23 | return do 24 | } 25 | 26 | // MergeDeleteOptions combines the argued DeleteOptions into a single DeleteOptions in a last-one-wins fashion 27 | func MergeDeleteOptions(opts ...*DeleteOptions) *DeleteOptions { 28 | dOpts := Delete() 29 | for _, do := range opts { 30 | if do == nil { 31 | continue 32 | } 33 | if do.Collation != nil { 34 | dOpts.Collation = do.Collation 35 | } 36 | } 37 | 38 | return dOpts 39 | } 40 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/listcollectionsoptions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package options 8 | 9 | // ListCollectionsOptions represents all possible options for a listCollections command. 10 | type ListCollectionsOptions struct { 11 | NameOnly *bool // If true, only the collection names will be returned. 12 | } 13 | 14 | // ListCollections creates a new *ListCollectionsOptions 15 | func ListCollections() *ListCollectionsOptions { 16 | return &ListCollectionsOptions{} 17 | } 18 | 19 | // SetNameOnly specifies whether to return only the collection names. 20 | func (lc *ListCollectionsOptions) SetNameOnly(b bool) *ListCollectionsOptions { 21 | lc.NameOnly = &b 22 | return lc 23 | } 24 | 25 | // MergeListCollectionsOptions combines the given *ListCollectionsOptions into a single *ListCollectionsOptions in a 26 | // last one wins fashion. 27 | func MergeListCollectionsOptions(opts ...*ListCollectionsOptions) *ListCollectionsOptions { 28 | lc := ListCollections() 29 | for _, opt := range opts { 30 | if opt == nil { 31 | continue 32 | } 33 | if opt.NameOnly != nil { 34 | lc.NameOnly = opt.NameOnly 35 | } 36 | } 37 | 38 | return lc 39 | } 40 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/listdatabasesoptions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package options 8 | 9 | // ListDatabasesOptions represents all possible options for a listDatabases command. 10 | type ListDatabasesOptions struct { 11 | NameOnly *bool // If true, only the database names will be returned. 12 | } 13 | 14 | // ListDatabases creates a new *ListDatabasesOptions 15 | func ListDatabases() *ListDatabasesOptions { 16 | return &ListDatabasesOptions{} 17 | } 18 | 19 | // SetNameOnly specifies whether to return only the database names. 20 | func (ld *ListDatabasesOptions) SetNameOnly(b bool) *ListDatabasesOptions { 21 | ld.NameOnly = &b 22 | return ld 23 | } 24 | 25 | // MergeListDatabasesOptions combines the given *ListDatabasesOptions into a single *ListDatabasesOptions in a last one 26 | // wins fashion. 27 | func MergeListDatabasesOptions(opts ...*ListDatabasesOptions) *ListDatabasesOptions { 28 | ld := ListDatabases() 29 | for _, opt := range opts { 30 | if opts == nil { 31 | continue 32 | } 33 | if opt.NameOnly != nil { 34 | ld.NameOnly = opt.NameOnly 35 | } 36 | } 37 | 38 | return ld 39 | } 40 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/options/runcmdoptions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package options 8 | 9 | import "go.mongodb.org/mongo-driver/mongo/readpref" 10 | 11 | // RunCmdOptions represents all possible options for a runCommand operation. 12 | type RunCmdOptions struct { 13 | ReadPreference *readpref.ReadPref // The read preference for the operation. 14 | } 15 | 16 | // RunCmd creates a new *RunCmdOptions 17 | func RunCmd() *RunCmdOptions { 18 | return &RunCmdOptions{} 19 | } 20 | 21 | // SetReadPreference sets the read preference for the operation. 22 | func (rc *RunCmdOptions) SetReadPreference(rp *readpref.ReadPref) *RunCmdOptions { 23 | rc.ReadPreference = rp 24 | return rc 25 | } 26 | 27 | // MergeRunCmdOptions combines the given *RunCmdOptions into one *RunCmdOptions in a last one wins fashion. 28 | func MergeRunCmdOptions(opts ...*RunCmdOptions) *RunCmdOptions { 29 | rc := RunCmd() 30 | for _, opt := range opts { 31 | if opt == nil { 32 | continue 33 | } 34 | if opt.ReadPreference != nil { 35 | rc.ReadPreference = opt.ReadPreference 36 | } 37 | } 38 | 39 | return rc 40 | } 41 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/mongo/util.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package mongo 8 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/version/version.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package version // import "go.mongodb.org/mongo-driver/version" 8 | 9 | // Driver is the current version of the driver. 10 | var Driver = "v1.1.1" 11 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/bsonx/registry.go: -------------------------------------------------------------------------------- 1 | package bsonx 2 | 3 | import ( 4 | "go.mongodb.org/mongo-driver/bson" 5 | "go.mongodb.org/mongo-driver/bson/bsoncodec" 6 | ) 7 | 8 | // DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the 9 | // primitive codecs. 10 | var DefaultRegistry = NewRegistryBuilder().Build() 11 | 12 | // NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and 13 | // deocders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the 14 | // PrimitiveCodecs type in this package. 15 | func NewRegistryBuilder() *bsoncodec.RegistryBuilder { 16 | rb := bsoncodec.NewRegistryBuilder() 17 | bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb) 18 | bsoncodec.DefaultValueDecoders{}.RegisterDefaultDecoders(rb) 19 | bson.PrimitiveCodecs{}.RegisterPrimitiveCodecs(rb) 20 | primitiveCodecs.RegisterPrimitiveCodecs(rb) 21 | return rb 22 | } 23 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/DESIGN.md: -------------------------------------------------------------------------------- 1 | # Driver Library Design 2 | This document outlines the design for this package. 3 | 4 | ## Deployment, Server, and Connection 5 | Acquiring a `Connection` from a `Server` selected from a `Deployment` enables sending and receiving 6 | wire messages. A `Deployment` represents an set of MongoDB servers and a `Server` represents a 7 | member of that set. These three types form the operation execution stack. 8 | 9 | ### Compression 10 | Compression is handled by Connection type while uncompression is handled automatically by the 11 | Operation type. This is done because the compressor to use for compressing a wire message is 12 | chosen by the connection during handshake, while uncompression can be performed without this 13 | information. This does make the design of compression non-symmetric, but it makes the design simpler 14 | to implement and more consistent. 15 | 16 | ## Operation 17 | The `Operation` type handles executing a series of commands using a `Deployment`. For most uses 18 | `Operation` will only execute a single command, but the main use case for a series of commands is 19 | batch split write commands, such as insert. The type itself is heavily documented, so reading the 20 | code and comments together should provide an understanding of how the type works. 21 | 22 | This type is not meant to be used directly by callers. Instead an wrapping type should be defined 23 | using the IDL and an implementation generated using `operationgen`. 24 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/address/addr.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package address // import "go.mongodb.org/mongo-driver/x/mongo/driver/address" 8 | 9 | import ( 10 | "net" 11 | "strings" 12 | ) 13 | 14 | const defaultPort = "27017" 15 | 16 | // Address is a network address. It can either be an IP address or a DNS name. 17 | type Address string 18 | 19 | // Network is the network protocol for this address. In most cases this will be 20 | // "tcp" or "unix". 21 | func (a Address) Network() string { 22 | if strings.HasSuffix(string(a), "sock") { 23 | return "unix" 24 | } 25 | return "tcp" 26 | } 27 | 28 | // String is the canonical version of this address, e.g. localhost:27017, 29 | // 1.2.3.4:27017, example.com:27017. 30 | func (a Address) String() string { 31 | // TODO: unicode case folding? 32 | s := strings.ToLower(string(a)) 33 | if len(s) == 0 { 34 | return "" 35 | } 36 | if a.Network() != "unix" { 37 | _, _, err := net.SplitHostPort(s) 38 | if err != nil && strings.Contains(err.Error(), "missing port in address") { 39 | s += ":" + defaultPort 40 | } 41 | } 42 | 43 | return s 44 | } 45 | 46 | // Canonicalize creates a canonicalized address. 47 | func (a Address) Canonicalize() Address { 48 | return Address(a.String()) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/cred.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package auth 8 | 9 | // Cred is a user's credential. 10 | type Cred struct { 11 | Source string 12 | Username string 13 | Password string 14 | PasswordSet bool 15 | Props map[string]string 16 | } 17 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | // Package auth is not for public use. 8 | // 9 | // The API for packages in the 'private' directory have no stability 10 | // guarantee. 11 | // 12 | // The packages within the 'private' directory would normally be put into an 13 | // 'internal' directory to prohibit their use outside the 'mongo' directory. 14 | // However, some MongoDB tools require very low-level access to the building 15 | // blocks of a driver, so we have placed them under 'private' to allow these 16 | // packages to be imported by projects that need them. 17 | // 18 | // These package APIs may be modified in backwards-incompatible ways at any 19 | // time. 20 | // 21 | // You are strongly discouraged from directly using any packages 22 | // under 'private'. 23 | package auth 24 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/gssapi_not_enabled.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | //+build !gssapi 8 | 9 | package auth 10 | 11 | // GSSAPI is the mechanism name for GSSAPI. 12 | const GSSAPI = "GSSAPI" 13 | 14 | func newGSSAPIAuthenticator(cred *Cred) (Authenticator, error) { 15 | return nil, newAuthError("GSSAPI support not enabled during build (-tags gssapi)", nil) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/gssapi_not_supported.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | //+build gssapi,!windows,!linux,!darwin 8 | 9 | package auth 10 | 11 | import ( 12 | "fmt" 13 | "runtime" 14 | ) 15 | 16 | // GSSAPI is the mechanism name for GSSAPI. 17 | const GSSAPI = "GSSAPI" 18 | 19 | func newGSSAPIAuthenticator(cred *Cred) (Authenticator, error) { 20 | return nil, newAuthError(fmt.Sprintf("GSSAPI is not supported on %s", runtime.GOOS), nil) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/gssapi/gss_wrapper.h: -------------------------------------------------------------------------------- 1 | //+build gssapi 2 | //+build linux darwin 3 | #ifndef GSS_WRAPPER_H 4 | #define GSS_WRAPPER_H 5 | 6 | #include 7 | #ifdef GOOS_linux 8 | #include 9 | #include 10 | #endif 11 | #ifdef GOOS_darwin 12 | #include 13 | #endif 14 | 15 | #define GSSAPI_OK 0 16 | #define GSSAPI_CONTINUE 1 17 | #define GSSAPI_ERROR 2 18 | 19 | typedef struct { 20 | gss_name_t spn; 21 | gss_cred_id_t cred; 22 | gss_ctx_id_t ctx; 23 | 24 | OM_uint32 maj_stat; 25 | OM_uint32 min_stat; 26 | } gssapi_client_state; 27 | 28 | int gssapi_error_desc( 29 | OM_uint32 maj_stat, 30 | OM_uint32 min_stat, 31 | char **desc 32 | ); 33 | 34 | int gssapi_client_init( 35 | gssapi_client_state *client, 36 | char* spn, 37 | char* username, 38 | char* password 39 | ); 40 | 41 | int gssapi_client_username( 42 | gssapi_client_state *client, 43 | char** username 44 | ); 45 | 46 | int gssapi_client_negotiate( 47 | gssapi_client_state *client, 48 | void* input, 49 | size_t input_length, 50 | void** output, 51 | size_t* output_length 52 | ); 53 | 54 | int gssapi_client_wrap_msg( 55 | gssapi_client_state *client, 56 | void* input, 57 | size_t input_length, 58 | void** output, 59 | size_t* output_length 60 | ); 61 | 62 | int gssapi_client_destroy( 63 | gssapi_client_state *client 64 | ); 65 | 66 | #endif -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/gssapi/sspi_wrapper.h: -------------------------------------------------------------------------------- 1 | //+build gssapi,windows 2 | 3 | #ifndef SSPI_WRAPPER_H 4 | #define SSPI_WRAPPER_H 5 | 6 | #define SECURITY_WIN32 1 /* Required for SSPI */ 7 | 8 | #include 9 | #include 10 | 11 | #define SSPI_OK 0 12 | #define SSPI_CONTINUE 1 13 | #define SSPI_ERROR 2 14 | 15 | typedef struct { 16 | CredHandle cred; 17 | CtxtHandle ctx; 18 | 19 | int has_ctx; 20 | 21 | SECURITY_STATUS status; 22 | } sspi_client_state; 23 | 24 | int sspi_init(); 25 | 26 | int sspi_client_init( 27 | sspi_client_state *client, 28 | char* username, 29 | char* password 30 | ); 31 | 32 | int sspi_client_username( 33 | sspi_client_state *client, 34 | char** username 35 | ); 36 | 37 | int sspi_client_negotiate( 38 | sspi_client_state *client, 39 | char* spn, 40 | PVOID input, 41 | ULONG input_length, 42 | PVOID* output, 43 | ULONG* output_length 44 | ); 45 | 46 | int sspi_client_wrap_msg( 47 | sspi_client_state *client, 48 | PVOID input, 49 | ULONG input_length, 50 | PVOID* output, 51 | ULONG* output_length 52 | ); 53 | 54 | int sspi_client_destroy( 55 | sspi_client_state *client 56 | ); 57 | 58 | #endif -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/util.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package auth 8 | 9 | import ( 10 | "crypto/md5" 11 | "fmt" 12 | "io" 13 | ) 14 | 15 | const defaultAuthDB = "admin" 16 | 17 | func mongoPasswordDigest(username, password string) string { 18 | h := md5.New() 19 | _, _ = io.WriteString(h, username) 20 | _, _ = io.WriteString(h, ":mongo:") 21 | _, _ = io.WriteString(h, password) 22 | return fmt.Sprintf("%x", h.Sum(nil)) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/description.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description // import "go.mongodb.org/mongo-driver/x/mongo/driver/description" 8 | 9 | // Unknown is an unknown server or topology kind. 10 | const Unknown = 0 11 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/feature.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description 8 | 9 | import ( 10 | "fmt" 11 | ) 12 | 13 | // MaxStalenessSupported returns an error if the given server version 14 | // does not support max staleness. 15 | func MaxStalenessSupported(wireVersion *VersionRange) error { 16 | if wireVersion != nil && wireVersion.Max < 5 { 17 | return fmt.Errorf("max staleness is only supported for servers 3.4 or newer") 18 | } 19 | 20 | return nil 21 | } 22 | 23 | // ScramSHA1Supported returns an error if the given server version 24 | // does not support scram-sha-1. 25 | func ScramSHA1Supported(wireVersion *VersionRange) error { 26 | if wireVersion != nil && wireVersion.Max < 3 { 27 | return fmt.Errorf("SCRAM-SHA-1 is only supported for servers 3.0 or newer") 28 | } 29 | 30 | return nil 31 | } 32 | 33 | // SessionsSupported returns true of the given server version indicates that it supports sessions. 34 | func SessionsSupported(wireVersion *VersionRange) bool { 35 | return wireVersion != nil && wireVersion.Max >= 6 36 | } 37 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/server_kind.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description 8 | 9 | // ServerKind represents the type of a server. 10 | type ServerKind uint32 11 | 12 | // These constants are the possible types of servers. 13 | const ( 14 | Standalone ServerKind = 1 15 | RSMember ServerKind = 2 16 | RSPrimary ServerKind = 4 + RSMember 17 | RSSecondary ServerKind = 8 + RSMember 18 | RSArbiter ServerKind = 16 + RSMember 19 | RSGhost ServerKind = 32 + RSMember 20 | Mongos ServerKind = 256 21 | ) 22 | 23 | // String implements the fmt.Stringer interface. 24 | func (kind ServerKind) String() string { 25 | switch kind { 26 | case Standalone: 27 | return "Standalone" 28 | case RSMember: 29 | return "RSOther" 30 | case RSPrimary: 31 | return "RSPrimary" 32 | case RSSecondary: 33 | return "RSSecondary" 34 | case RSArbiter: 35 | return "RSArbiter" 36 | case RSGhost: 37 | return "RSGhost" 38 | case Mongos: 39 | return "Mongos" 40 | } 41 | 42 | return "Unknown" 43 | } 44 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/topology_kind.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description 8 | 9 | // TopologyKind represents a specific topology configuration. 10 | type TopologyKind uint32 11 | 12 | // These constants are the available topology configurations. 13 | const ( 14 | Single TopologyKind = 1 15 | ReplicaSet TopologyKind = 2 16 | ReplicaSetNoPrimary TopologyKind = 4 + ReplicaSet 17 | ReplicaSetWithPrimary TopologyKind = 8 + ReplicaSet 18 | Sharded TopologyKind = 256 19 | ) 20 | 21 | // String implements the fmt.Stringer interface. 22 | func (kind TopologyKind) String() string { 23 | switch kind { 24 | case Single: 25 | return "Single" 26 | case ReplicaSet: 27 | return "ReplicaSet" 28 | case ReplicaSetNoPrimary: 29 | return "ReplicaSetNoPrimary" 30 | case ReplicaSetWithPrimary: 31 | return "ReplicaSetWithPrimary" 32 | case Sharded: 33 | return "Sharded" 34 | } 35 | 36 | return "Unknown" 37 | } 38 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/version.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description 8 | 9 | import "strconv" 10 | 11 | // Version represents a software version. 12 | type Version struct { 13 | Desc string 14 | Parts []uint8 15 | } 16 | 17 | // AtLeast ensures that the version is at least as large as the "other" version. 18 | func (v Version) AtLeast(other ...uint8) bool { 19 | for i := range other { 20 | if i == len(v.Parts) { 21 | return false 22 | } 23 | if v.Parts[i] < other[i] { 24 | return false 25 | } 26 | } 27 | return true 28 | } 29 | 30 | // String provides the string represtation of the Version. 31 | func (v Version) String() string { 32 | if v.Desc == "" { 33 | var s string 34 | for i, p := range v.Parts { 35 | if i != 0 { 36 | s += "." 37 | } 38 | s += strconv.Itoa(int(p)) 39 | } 40 | return s 41 | } 42 | 43 | return v.Desc 44 | } 45 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/description/version_range.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package description 8 | 9 | import "fmt" 10 | 11 | // VersionRange represents a range of versions. 12 | type VersionRange struct { 13 | Min int32 14 | Max int32 15 | } 16 | 17 | // NewVersionRange creates a new VersionRange given a min and a max. 18 | func NewVersionRange(min, max int32) VersionRange { 19 | return VersionRange{Min: min, Max: max} 20 | } 21 | 22 | // Includes returns a bool indicating whether the supplied integer is included 23 | // in the range. 24 | func (vr VersionRange) Includes(v int32) bool { 25 | return v >= vr.Min && v <= vr.Max 26 | } 27 | 28 | // String implements the fmt.Stringer interface. 29 | func (vr VersionRange) String() string { 30 | return fmt.Sprintf("[%d, %d]", vr.Min, vr.Max) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/legacy.go: -------------------------------------------------------------------------------- 1 | package driver 2 | 3 | // LegacyOperationKind indicates if an operation is a legacy find, getMore, or killCursors. This is used 4 | // in Operation.Execute, which will create legacy OP_QUERY, OP_GET_MORE, or OP_KILL_CURSORS instead 5 | // of sending them as a command. 6 | type LegacyOperationKind uint 7 | 8 | // These constants represent the three different kinds of legacy operations. 9 | const ( 10 | LegacyNone LegacyOperationKind = iota 11 | LegacyFind 12 | LegacyGetMore 13 | LegacyKillCursors 14 | LegacyListCollections 15 | LegacyListIndexes 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/abort_transaction.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "AbortTransaction" 3 | documentation = "AbortTransaction performs an abortTransaction operation." 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | retryable = {mode = "once per command", type = "writes"} 8 | 9 | [command] 10 | name = "abortTransaction" 11 | parameter = "database" 12 | 13 | [request.recoveryToken] 14 | type = "document" 15 | documentation = """ 16 | RecoveryToken sets the recovery token to use when committing or aborting a sharded transaction.\ 17 | """ 18 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/commit_transaction.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "CommitTransaction" 3 | documentation = "CommitTransaction attempts to commit a transaction." 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | disabled = ["collection"] 8 | retryable = {mode = "once per command", type = "writes"} 9 | 10 | [command] 11 | name = "commitTransaction" 12 | parameter = "database" 13 | 14 | [request.recoveryToken] 15 | type = "document" 16 | documentation = """ 17 | RecoveryToken sets the recovery token to use when committing or aborting a sharded transaction.\ 18 | """ 19 | 20 | [request.maxTimeMS] 21 | type = "int64" 22 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 23 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/count.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "Count" 3 | documentation = "Performs a count operation" 4 | 5 | [properties] 6 | enabled = ["read concern", "read preference"] 7 | retryable = {mode = "once per command", type = "reads"} 8 | 9 | [command] 10 | name = "count" 11 | parameter = "collection" 12 | 13 | [request.maxTimeMS] 14 | type = "int64" 15 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 16 | 17 | [request.query] 18 | type = "document" 19 | documentation = "Query determines what results are returned from find." 20 | 21 | [response] 22 | name = "CountResult" 23 | 24 | [response.field.n] 25 | type = "int64" 26 | documentation = "The number of documents found" 27 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/createIndexes.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "CreateIndexes" 3 | documentation = "CreateIndexes performs a createIndexes operation." 4 | 5 | [command] 6 | name = "createIndexes" 7 | parameter = "collection" 8 | 9 | [request.indexes] 10 | type = "array" 11 | constructor = true 12 | documentation = "An array containing index specification documents for the indexes being created." 13 | 14 | [request.maxTimeMS] 15 | type = "int64" 16 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 17 | 18 | [response] 19 | name = "CreateIndexesResult" 20 | 21 | [response.field.createdCollectionAutomatically] 22 | type = "boolean" 23 | documentation = "If the collection was created automatically." 24 | 25 | [response.field.indexesBefore] 26 | type = "int32" 27 | documentation = "The number of indexes existing before this command." 28 | 29 | [response.field.indexesAfter] 30 | type = "int32" 31 | documentation = "The number of indexes existing after this command." 32 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/delete.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "Delete" 3 | documentation = "Delete performs a delete operation" 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | retryable = {mode = "once per command", type = "writes"} 8 | batches = "deletes" 9 | 10 | [command] 11 | name = "delete" 12 | parameter = "collection" 13 | 14 | [request.deletes] 15 | type = "document" 16 | slice = true 17 | constructor = true 18 | variadic = true 19 | required = true 20 | documentation = """ 21 | Deletes adds documents to this operation that will be used to determine what documents to delete when this operation 22 | is executed. These documents should have the form {q: , limit: , collation: }. The 23 | collation field is optional. If limit is 0, there will be no limit on the number of documents deleted.\ 24 | """ 25 | 26 | [request.ordered] 27 | type = "boolean" 28 | documentation = """ 29 | Ordered sets ordered. If true, when a write fails, the operation will return the error, when 30 | false write failures do not stop execution of the operation.\ 31 | """ 32 | 33 | [response] 34 | name = "DeleteResult" 35 | 36 | [response.field.n] 37 | type = "int32" 38 | documentation = "Number of documents successfully deleted." 39 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/distinct.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "Distinct" 3 | documentation = "Distinct performs a distinct operation." 4 | 5 | [properties] 6 | enabled = ["read concern", "read preference"] 7 | retryable = {mode = "once per command", type = "reads"} 8 | 9 | [command] 10 | name = "distinct" 11 | parameter = "collection" 12 | 13 | [request.key] 14 | type = "string" 15 | constructor = true 16 | documentation = "Key specifies which field to return distinct values for." 17 | 18 | [request.query] 19 | type = "document" 20 | constructor = true 21 | documentation = "Query specifies which documents to return distinct values from." 22 | 23 | [request.maxTimeMS] 24 | type = "int64" 25 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 26 | 27 | [request.collation] 28 | type = "document" 29 | minWireVersionRequired = 5 30 | documentation = "Collation specifies a collation to be used." 31 | 32 | [response] 33 | name = "DistinctResult" 34 | 35 | [response.field.values] 36 | type = "value" 37 | documentation = "The distinct values for the field." -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_collection.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "DropCollection" 3 | documentation = "DropCollection performs a drop operation." 4 | 5 | [command] 6 | name = "drop" 7 | parameter = "collection" 8 | 9 | [properties] 10 | enabled = ["write concern"] 11 | 12 | [response] 13 | name = "DropCollectionResult" 14 | 15 | [response.field.ns] 16 | type = "string" 17 | documentation = "The namespace of the dropped collection." 18 | 19 | [response.field.nIndexesWas] 20 | type = "int32" 21 | documentation = "The number of indexes in the dropped collection." 22 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_database.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "DropDatabase" 3 | documentation = "DropDatabase performs a dropDatabase operation" 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | disabled = ["collection"] 8 | 9 | [command] 10 | name = "dropDatabase" 11 | parameter = "database" 12 | 13 | [response] 14 | name = "DropDatabaseResult" 15 | 16 | [response.field.dropped] 17 | type = "string" 18 | documentation = "The dropped database." -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/drop_indexes.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "DropIndexes" 3 | documentation = "DropIndexes performs an dropIndexes operation." 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | 8 | [command] 9 | name = "dropIndexes" 10 | parameter = "collection" 11 | 12 | [request.index] 13 | type = "string" 14 | constructor = true 15 | documentation = """ 16 | Index specifies the name of the index to drop. If '*' is specified, all indexes will be dropped. 17 | """ 18 | 19 | [request.maxTimeMS] 20 | type = "int64" 21 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 22 | 23 | [response] 24 | name = "DropIndexesResult" 25 | 26 | [response.field.nIndexesWas] 27 | type = "int32" 28 | documentation = "Number of indexes that existed before the drop was executed." 29 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/end_sessions.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "EndSessions" 3 | documentation = "EndSessions performs an endSessions operation." 4 | 5 | [properties] 6 | disabled = ["collection"] 7 | 8 | [command] 9 | name = "endSessions" 10 | parameter = "sessionIDs" 11 | 12 | [request.sessionIDs] 13 | type = "array" 14 | documentation = "sessionIDs specify the sessions to be expired." 15 | skip = true 16 | constructor = true 17 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/insert.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "Insert" 3 | documentation = "Insert performs an insert operation." 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | retryable = {mode = "once per command", type = "writes"} 8 | batches = "documents" 9 | 10 | [command] 11 | name = "insert" 12 | parameter = "collection" 13 | 14 | [request.documents] 15 | type = "document" 16 | slice = true 17 | constructor = true 18 | variadic = true 19 | required = true 20 | documentation = """ 21 | Documents adds documents to this operation that will be inserted when this operation is 22 | executed.\ 23 | """ 24 | 25 | [request.ordered] 26 | type = "boolean" 27 | documentation = """ 28 | Ordered sets ordered. If true, when a write fails, the operation will return the error, when 29 | false write failures do not stop execution of the operation.\ 30 | """ 31 | 32 | [request.bypassDocumentValidation] 33 | type = "boolean" 34 | minWireVersion = 4 35 | documentation = """ 36 | BypassDocumentValidation allows the operation to opt-out of document level validation. Valid 37 | for server versions >= 3.2. For servers < 3.2, this setting is ignored.\ 38 | """ 39 | 40 | [response] 41 | name = "InsertResult" 42 | 43 | [response.field.n] 44 | type = "int32" 45 | documentation = "Number of documents successfully inserted." 46 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/listDatabases.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "ListDatabases" 3 | documentation = "ListDatabases performs a listDatabases operation." 4 | 5 | [properties] 6 | enabled = ["read preference"] 7 | retryable = {mode = "once per command", type = "reads"} 8 | disabled = ["collection"] 9 | 10 | [command] 11 | name = "listDatabases" 12 | parameter = "database" 13 | 14 | [request.filter] 15 | type = "document" 16 | constructor = true 17 | documentation = "Filter determines what results are returned from listDatabases." 18 | 19 | 20 | [request.nameOnly] 21 | type = "boolean" 22 | documentation = "NameOnly specifies whether to only return database names." 23 | 24 | [response] 25 | name = "ListDatabasesResult" 26 | 27 | [response.field.totalSize] 28 | type = "int64" 29 | documentation = "The sum of the size of all the database files on disk in bytes." 30 | 31 | [response.field.databases] 32 | type = "value" 33 | documentation = "An array of documents, one document for each database" -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/list_collections.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "ListCollections" 3 | documentation = "ListCollections performs a listCollections operation." 4 | response.type = "list collections batch cursor" 5 | 6 | [properties] 7 | enabled = ["read preference"] 8 | disabled = ["collection"] 9 | retryable = {mode = "once per command", type = "reads"} 10 | legacy = "listCollections" 11 | 12 | [command] 13 | name = "listCollections" 14 | parameter = "database" 15 | 16 | [request.filter] 17 | type = "document" 18 | constructor = true 19 | documentation = "Filter determines what results are returned from listCollections." 20 | 21 | [request.nameOnly] 22 | type = "boolean" 23 | documentation = "NameOnly specifies whether to only return collection names." 24 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/list_indexes.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "ListIndexes" 3 | documentation = "ListIndexes performs a listIndexes operation." 4 | response.type = "batch cursor" 5 | 6 | [properties] 7 | legacy = "listIndexes" 8 | retryable = {mode = "once per command", type = "reads"} 9 | 10 | [command] 11 | name = "listIndexes" 12 | parameter = "collection" 13 | 14 | [request.batchSize] 15 | type = "int32" 16 | documentation = "BatchSize specifies the number of documents to return in every batch." 17 | 18 | [request.maxTimeMS] 19 | type = "int64" 20 | documentation = "MaxTimeMS specifies the maximum amount of time to allow the query to run." 21 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/operation.go: -------------------------------------------------------------------------------- 1 | package operation 2 | 3 | //go:generate operationgen insert.toml operation insert.go 4 | //go:generate operationgen find.toml operation find.go 5 | //go:generate operationgen list_collections.toml operation list_collections.go 6 | //go:generate operationgen createIndexes.toml operation createIndexes.go 7 | //go:generate operationgen drop_collection.toml operation drop_collection.go 8 | //go:generate operationgen distinct.toml operation distinct.go 9 | //go:generate operationgen delete.toml operation delete.go 10 | //go:generate operationgen drop_indexes.toml operation drop_indexes.go 11 | //go:generate operationgen drop_database.toml operation drop_database.go 12 | //go:generate operationgen commit_transaction.toml operation commit_transaction.go 13 | //go:generate operationgen abort_transaction.toml operation abort_transaction.go 14 | //go:generate operationgen count.toml operation count.go 15 | //go:generate operationgen end_sessions.toml operation end_sessions.go 16 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/operation/update.toml: -------------------------------------------------------------------------------- 1 | version = 0 2 | name = "Update" 3 | documentation = "Update performs an update operation." 4 | 5 | [properties] 6 | enabled = ["write concern"] 7 | retryable = {mode = "once per command", type = "writes"} 8 | batches = "updates" 9 | 10 | [command] 11 | name = "update" 12 | parameter = "collection" 13 | 14 | [request.updates] 15 | type = "document" 16 | slice = true 17 | constructor = true 18 | variadic = true 19 | required = true 20 | documentation = """ 21 | Updates specifies an array of update statements to perform when this operation is executed. 22 | Each update document must have the following structure: {q: , u: , multi: , collation: Optional, arrayFitlers: Optional}.\ 23 | """ 24 | 25 | [request.ordered] 26 | type = "boolean" 27 | documentation = """ 28 | Ordered sets ordered. If true, when a write fails, the operation will return the error, when 29 | false write failures do not stop execution of the operation.\ 30 | """ 31 | 32 | [request.bypassDocumentValidation] 33 | type = "boolean" 34 | minWireVersion = 4 35 | documentation = """ 36 | BypassDocumentValidation allows the operation to opt-out of document level validation. Valid 37 | for server versions >= 3.2. For servers < 3.2, this setting is ignored.\ 38 | """ 39 | 40 | [response] 41 | name = "UpdateResult" 42 | 43 | [response.field.n] 44 | type = "int32" 45 | documentation = "Number of documents matched." 46 | 47 | [response.field.nModified] 48 | type = "int32" 49 | documentation = "Number of documents modified." 50 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/session/cluster_clock.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package session 8 | 9 | import ( 10 | "sync" 11 | 12 | "go.mongodb.org/mongo-driver/bson" 13 | ) 14 | 15 | // ClusterClock represents a logical clock for keeping track of cluster time. 16 | type ClusterClock struct { 17 | clusterTime bson.Raw 18 | lock sync.Mutex 19 | } 20 | 21 | // GetClusterTime returns the cluster's current time. 22 | func (cc *ClusterClock) GetClusterTime() bson.Raw { 23 | var ct bson.Raw 24 | cc.lock.Lock() 25 | ct = cc.clusterTime 26 | cc.lock.Unlock() 27 | 28 | return ct 29 | } 30 | 31 | // AdvanceClusterTime updates the cluster's current time. 32 | func (cc *ClusterClock) AdvanceClusterTime(clusterTime bson.Raw) { 33 | cc.lock.Lock() 34 | cc.clusterTime = MaxClusterTime(cc.clusterTime, clusterTime) 35 | cc.lock.Unlock() 36 | } 37 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection_legacy.go: -------------------------------------------------------------------------------- 1 | package topology 2 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/connection_legacy_command_metadata.go: -------------------------------------------------------------------------------- 1 | package topology 2 | 3 | import "time" 4 | 5 | // commandMetadata contains metadata about a command sent to the server. 6 | type commandMetadata struct { 7 | Name string 8 | Time time.Time 9 | Legacy bool 10 | FullCollectionName string 11 | } 12 | 13 | // createMetadata creates metadata for a command. 14 | func createMetadata(name string, legacy bool, fullCollName string) *commandMetadata { 15 | return &commandMetadata{ 16 | Name: name, 17 | Time: time.Now(), 18 | Legacy: legacy, 19 | FullCollectionName: fullCollName, 20 | } 21 | } 22 | 23 | // TimeDifference returns the difference between now and the time a command was sent in nanoseconds. 24 | func (cm *commandMetadata) TimeDifference() int64 { 25 | t := time.Now() 26 | duration := t.Sub(cm.Time) 27 | return duration.Nanoseconds() 28 | } 29 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/errors.go: -------------------------------------------------------------------------------- 1 | package topology 2 | 3 | import "fmt" 4 | 5 | // ConnectionError represents a connection error. 6 | type ConnectionError struct { 7 | ConnectionID string 8 | Wrapped error 9 | 10 | // init will be set to true if this error occured during connection initialization or 11 | // during a connection handshake. 12 | init bool 13 | message string 14 | } 15 | 16 | // Error implements the error interface. 17 | func (e ConnectionError) Error() string { 18 | if e.Wrapped != nil { 19 | return fmt.Sprintf("connection(%s) %s: %s", e.ConnectionID, e.message, e.Wrapped.Error()) 20 | } 21 | return fmt.Sprintf("connection(%s) %s", e.ConnectionID, e.message) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology_options_1_10.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package topology 4 | 5 | import "crypto/x509" 6 | 7 | func x509CertSubject(cert *x509.Certificate) string { 8 | return cert.Subject.String() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/topology/topology_options_1_9.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package topology 4 | 5 | import ( 6 | "crypto/x509" 7 | ) 8 | 9 | // We don't support version less then 1.10, but Evergreen needs to be able to compile the driver 10 | // using version 1.8. 11 | func x509CertSubject(cert *x509.Certificate) string { 12 | return "" 13 | } 14 | -------------------------------------------------------------------------------- /vendor/go.mongodb.org/mongo-driver/x/mongo/driver/uuid/uuid.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) MongoDB, Inc. 2017-present. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | package uuid // import "go.mongodb.org/mongo-driver/x/mongo/driver/uuid" 8 | 9 | import ( 10 | "bytes" 11 | "crypto/rand" 12 | "io" 13 | ) 14 | 15 | // UUID represents a UUID. 16 | type UUID [16]byte 17 | 18 | var rander = rand.Reader 19 | 20 | // New generates a new uuid. 21 | func New() (UUID, error) { 22 | var uuid [16]byte 23 | 24 | _, err := io.ReadFull(rander, uuid[:]) 25 | if err != nil { 26 | return [16]byte{}, err 27 | } 28 | uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 29 | uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 30 | 31 | return uuid, nil 32 | } 33 | 34 | // Equal returns true if two UUIDs are equal. 35 | func Equal(a, b UUID) bool { 36 | return bytes.Equal([]byte(a[:]), []byte(b[:])) 37 | } 38 | -------------------------------------------------------------------------------- /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/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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/cases/fold.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 cases 6 | 7 | import "golang.org/x/text/transform" 8 | 9 | type caseFolder struct{ transform.NopResetter } 10 | 11 | // caseFolder implements the Transformer interface for doing case folding. 12 | func (t *caseFolder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { 13 | c := context{dst: dst, src: src, atEOF: atEOF} 14 | for c.next() { 15 | foldFull(&c) 16 | c.checkpoint() 17 | } 18 | return c.ret() 19 | } 20 | 21 | func (t *caseFolder) Span(src []byte, atEOF bool) (n int, err error) { 22 | c := context{src: src, atEOF: atEOF} 23 | for c.next() && isFoldFull(&c) { 24 | c.checkpoint() 25 | } 26 | return c.retSpan() 27 | } 28 | 29 | func makeFold(o options) transform.SpanningTransformer { 30 | // TODO: Special case folding, through option Language, Special/Turkic, or 31 | // both. 32 | // TODO: Implement Compact options. 33 | return &caseFolder{} 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/collate/index.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 collate 6 | 7 | import "golang.org/x/text/internal/colltab" 8 | 9 | const blockSize = 64 10 | 11 | func getTable(t tableIndex) *colltab.Table { 12 | return &colltab.Table{ 13 | Index: colltab.Trie{ 14 | Index0: mainLookup[:][blockSize*t.lookupOffset:], 15 | Values0: mainValues[:][blockSize*t.valuesOffset:], 16 | Index: mainLookup[:], 17 | Values: mainValues[:], 18 | }, 19 | ExpandElem: mainExpandElem[:], 20 | ContractTries: colltab.ContractTrieSet(mainCTEntries[:]), 21 | ContractElem: mainContractElem[:], 22 | MaxContractLen: 18, 23 | VariableTop: varTop, 24 | } 25 | } 26 | 27 | // tableIndex holds information for constructing a table 28 | // for a certain locale based on the main table. 29 | type tableIndex struct { 30 | lookupOffset uint32 31 | valuesOffset uint32 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/colltab/weighter.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 colltab // import "golang.org/x/text/internal/colltab" 6 | 7 | // A Weighter can be used as a source for Collator and Searcher. 8 | type Weighter interface { 9 | // Start finds the start of the segment that includes position p. 10 | Start(p int, b []byte) int 11 | 12 | // StartString finds the start of the segment that includes position p. 13 | StartString(p int, s string) int 14 | 15 | // AppendNext appends Elems to buf corresponding to the longest match 16 | // of a single character or contraction from the start of s. 17 | // It returns the new buf and the number of bytes consumed. 18 | AppendNext(buf []Elem, s []byte) (ce []Elem, n int) 19 | 20 | // AppendNextString appends Elems to buf corresponding to the longest match 21 | // of a single character or contraction from the start of s. 22 | // It returns the new buf and the number of bytes consumed. 23 | AppendNextString(buf []Elem, s string) (ce []Elem, n int) 24 | 25 | // Domain returns a slice of all single characters and contractions for which 26 | // collation elements are defined in this table. 27 | Domain() []string 28 | 29 | // Top returns the highest variable primary value. 30 | Top() uint32 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/internal.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 internal contains non-exported functionality that are used by 6 | // packages in the text repository. 7 | package internal // import "golang.org/x/text/internal" 8 | 9 | import ( 10 | "sort" 11 | 12 | "golang.org/x/text/language" 13 | ) 14 | 15 | // SortTags sorts tags in place. 16 | func SortTags(tags []language.Tag) { 17 | sort.Sort(sorter(tags)) 18 | } 19 | 20 | type sorter []language.Tag 21 | 22 | func (s sorter) Len() int { 23 | return len(s) 24 | } 25 | 26 | func (s sorter) Swap(i, j int) { 27 | s[i], s[j] = s[j], s[i] 28 | } 29 | 30 | func (s sorter) Less(i, j int) bool { 31 | return s[i].String() < s[j].String() 32 | } 33 | 34 | // UniqueTags sorts and filters duplicate tags in place and returns a slice with 35 | // only unique tags. 36 | func UniqueTags(tags []language.Tag) []language.Tag { 37 | if len(tags) <= 1 { 38 | return tags 39 | } 40 | SortTags(tags) 41 | k := 0 42 | for i := 1; i < len(tags); i++ { 43 | if tags[k].String() < tags[i].String() { 44 | k++ 45 | tags[k] = tags[i] 46 | } 47 | } 48 | return tags[:k+1] 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact/gen.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 ignore 6 | 7 | // Language tag table generator. 8 | // Data read from the web. 9 | 10 | package main 11 | 12 | import ( 13 | "flag" 14 | "fmt" 15 | "log" 16 | 17 | "golang.org/x/text/internal/gen" 18 | "golang.org/x/text/unicode/cldr" 19 | ) 20 | 21 | var ( 22 | test = flag.Bool("test", 23 | false, 24 | "test existing tables; can be used to compare web data with package data.") 25 | outputFile = flag.String("output", 26 | "tables.go", 27 | "output file for generated tables") 28 | ) 29 | 30 | func main() { 31 | gen.Init() 32 | 33 | w := gen.NewCodeWriter() 34 | defer w.WriteGoFile("tables.go", "compact") 35 | 36 | fmt.Fprintln(w, `import "golang.org/x/text/internal/language"`) 37 | 38 | b := newBuilder(w) 39 | gen.WriteCLDRVersion(w) 40 | 41 | b.writeCompactIndex() 42 | } 43 | 44 | type builder struct { 45 | w *gen.CodeWriter 46 | data *cldr.CLDR 47 | supp *cldr.SupplementalData 48 | } 49 | 50 | func newBuilder(w *gen.CodeWriter) *builder { 51 | r := gen.OpenCLDRCoreZip() 52 | defer r.Close() 53 | d := &cldr.Decoder{} 54 | data, err := d.DecodeZip(r) 55 | if err != nil { 56 | log.Fatal(err) 57 | } 58 | b := builder{ 59 | w: w, 60 | data: data, 61 | supp: data.Supplemental(), 62 | } 63 | return &b 64 | } 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact/gen_parents.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 ignore 6 | 7 | package main 8 | 9 | import ( 10 | "log" 11 | 12 | "golang.org/x/text/internal/gen" 13 | "golang.org/x/text/internal/language" 14 | "golang.org/x/text/internal/language/compact" 15 | "golang.org/x/text/unicode/cldr" 16 | ) 17 | 18 | func main() { 19 | r := gen.OpenCLDRCoreZip() 20 | defer r.Close() 21 | 22 | d := &cldr.Decoder{} 23 | data, err := d.DecodeZip(r) 24 | if err != nil { 25 | log.Fatalf("DecodeZip: %v", err) 26 | } 27 | 28 | w := gen.NewCodeWriter() 29 | defer w.WriteGoFile("parents.go", "compact") 30 | 31 | // Create parents table. 32 | type ID uint16 33 | parents := make([]ID, compact.NumCompactTags) 34 | for _, loc := range data.Locales() { 35 | tag := language.MustParse(loc) 36 | index, ok := compact.FromTag(tag) 37 | if !ok { 38 | continue 39 | } 40 | parentIndex := compact.ID(0) // und 41 | for p := tag.Parent(); p != language.Und; p = p.Parent() { 42 | if x, ok := compact.FromTag(p); ok { 43 | parentIndex = x 44 | break 45 | } 46 | } 47 | parents[index] = ID(parentIndex) 48 | } 49 | 50 | w.WriteComment(` 51 | parents maps a compact index of a tag to the compact index of the parent of 52 | this tag.`) 53 | w.WriteVar("parents", parents) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/gen_common.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 ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // AliasType is the type of an alias in AliasMap. 12 | type AliasType int8 13 | 14 | const ( 15 | Deprecated AliasType = iota 16 | Macro 17 | Legacy 18 | 19 | AliasTypeUnknown AliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. 8 | // It simplifies safe initialization of Tag values. 9 | func MustParse(s string) Tag { 10 | t, err := Parse(s) 11 | if err != nil { 12 | panic(err) 13 | } 14 | return t 15 | } 16 | 17 | // MustParseBase is like ParseBase, but panics if the given base cannot be parsed. 18 | // It simplifies safe initialization of Base values. 19 | func MustParseBase(s string) Language { 20 | b, err := ParseBase(s) 21 | if err != nil { 22 | panic(err) 23 | } 24 | return b 25 | } 26 | 27 | // MustParseScript is like ParseScript, but panics if the given script cannot be 28 | // parsed. It simplifies safe initialization of Script values. 29 | func MustParseScript(s string) Script { 30 | scr, err := ParseScript(s) 31 | if err != nil { 32 | panic(err) 33 | } 34 | return scr 35 | } 36 | 37 | // MustParseRegion is like ParseRegion, but panics if the given region cannot be 38 | // parsed. It simplifies safe initialization of Region values. 39 | func MustParseRegion(s string) Region { 40 | r, err := ParseRegion(s) 41 | if err != nil { 42 | panic(err) 43 | } 44 | return r 45 | } 46 | 47 | // Und is the root language. 48 | var Und Tag 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.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 !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.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 go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.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 norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "net" 11 | 12 | "appengine/cloudsql" 13 | ) 14 | 15 | func connect(instance string) (net.Conn, error) { 16 | return cloudsql.Dial(instance) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | ) 13 | 14 | func connect(instance string) (net.Conn, error) { 15 | return nil, errors.New(`cloudsql: not supported in App Engine "flexible environment"`) 16 | } 17 | --------------------------------------------------------------------------------