├── .github ├── dependabot.yml └── workflows │ └── go.yml ├── .gitignore ├── LICENSE ├── README.md ├── cmd └── marketplace │ └── main.go ├── ddd-diagram-onion.png ├── go.mod ├── go.sum ├── internal ├── application │ ├── command │ │ ├── create_product_command.go │ │ ├── create_seller_command.go │ │ └── update_seller_command.go │ ├── common │ │ ├── product_result.go │ │ └── seller_result.go │ ├── interfaces │ │ ├── product_service.go │ │ └── seller_service.go │ ├── mapper │ │ ├── product_result.go │ │ └── seller_result.go │ ├── query │ │ ├── product_query_result.go │ │ └── seller_query_result.go │ └── services │ │ ├── product_service.go │ │ ├── product_service_test.go │ │ ├── seller_service.go │ │ └── seller_service_test.go ├── domain │ ├── entities │ │ ├── product.go │ │ ├── product_test.go │ │ ├── seller.go │ │ ├── seller_test.go │ │ ├── validated_product.go │ │ ├── validated_product_test.go │ │ ├── validated_seller.go │ │ └── validated_seller_test.go │ └── repositories │ │ ├── product_repository.go │ │ └── seller_repository.go ├── infrastructure │ ├── db │ │ └── postgres │ │ │ ├── connection.go │ │ │ ├── db_models..go │ │ │ ├── product_mapper.go │ │ │ ├── product_repository.go │ │ │ ├── seller_mapper.go │ │ │ └── seller_repository.go │ └── db_test │ │ └── sqlite │ │ ├── product_repository_test.go │ │ └── seller_repository_test.go └── interface │ └── api │ ├── rest │ ├── dto │ │ ├── mapper │ │ │ ├── product_response_mapper.go │ │ │ └── seller_response_mapper.go │ │ ├── request │ │ │ ├── create_product_request.go │ │ │ ├── create_seller_request.go │ │ │ └── update_seller_request.go │ │ └── response │ │ │ ├── product_response.go │ │ │ └── seller_response.go │ ├── product_controller.go │ └── seller_controller.go │ └── rest_test │ ├── mock_product_service_test.go │ ├── mock_seller_service_test.go │ ├── product_controller_test.go │ └── seller_controller_test.go └── vendor ├── github.com ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── google │ └── uuid │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dce.go │ │ ├── doc.go │ │ ├── hash.go │ │ ├── marshal.go │ │ ├── node.go │ │ ├── node_js.go │ │ ├── node_net.go │ │ ├── null.go │ │ ├── sql.go │ │ ├── time.go │ │ ├── util.go │ │ ├── uuid.go │ │ ├── version1.go │ │ ├── version4.go │ │ ├── version6.go │ │ └── version7.go ├── jackc │ ├── pgpassfile │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── pgpass.go │ ├── pgservicefile │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── pgservicefile.go │ ├── pgx │ │ └── v5 │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── Rakefile │ │ │ ├── batch.go │ │ │ ├── conn.go │ │ │ ├── copy_from.go │ │ │ ├── doc.go │ │ │ ├── extended_query_builder.go │ │ │ ├── internal │ │ │ ├── anynil │ │ │ │ └── anynil.go │ │ │ ├── iobufpool │ │ │ │ └── iobufpool.go │ │ │ ├── pgio │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ └── write.go │ │ │ ├── sanitize │ │ │ │ └── sanitize.go │ │ │ └── stmtcache │ │ │ │ ├── lru_cache.go │ │ │ │ ├── stmtcache.go │ │ │ │ └── unlimited_cache.go │ │ │ ├── large_objects.go │ │ │ ├── named_args.go │ │ │ ├── pgconn │ │ │ ├── README.md │ │ │ ├── auth_scram.go │ │ │ ├── config.go │ │ │ ├── defaults.go │ │ │ ├── defaults_windows.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── internal │ │ │ │ ├── bgreader │ │ │ │ │ └── bgreader.go │ │ │ │ └── ctxwatch │ │ │ │ │ └── context_watcher.go │ │ │ ├── krb5.go │ │ │ └── pgconn.go │ │ │ ├── pgproto3 │ │ │ ├── README.md │ │ │ ├── authentication_cleartext_password.go │ │ │ ├── authentication_gss.go │ │ │ ├── authentication_gss_continue.go │ │ │ ├── authentication_md5_password.go │ │ │ ├── authentication_ok.go │ │ │ ├── authentication_sasl.go │ │ │ ├── authentication_sasl_continue.go │ │ │ ├── authentication_sasl_final.go │ │ │ ├── backend.go │ │ │ ├── backend_key_data.go │ │ │ ├── big_endian.go │ │ │ ├── bind.go │ │ │ ├── bind_complete.go │ │ │ ├── cancel_request.go │ │ │ ├── chunkreader.go │ │ │ ├── close.go │ │ │ ├── close_complete.go │ │ │ ├── command_complete.go │ │ │ ├── copy_both_response.go │ │ │ ├── copy_data.go │ │ │ ├── copy_done.go │ │ │ ├── copy_fail.go │ │ │ ├── copy_in_response.go │ │ │ ├── copy_out_response.go │ │ │ ├── data_row.go │ │ │ ├── describe.go │ │ │ ├── doc.go │ │ │ ├── empty_query_response.go │ │ │ ├── error_response.go │ │ │ ├── execute.go │ │ │ ├── flush.go │ │ │ ├── frontend.go │ │ │ ├── function_call.go │ │ │ ├── function_call_response.go │ │ │ ├── gss_enc_request.go │ │ │ ├── gss_response.go │ │ │ ├── no_data.go │ │ │ ├── notice_response.go │ │ │ ├── notification_response.go │ │ │ ├── parameter_description.go │ │ │ ├── parameter_status.go │ │ │ ├── parse.go │ │ │ ├── parse_complete.go │ │ │ ├── password_message.go │ │ │ ├── pgproto3.go │ │ │ ├── portal_suspended.go │ │ │ ├── query.go │ │ │ ├── ready_for_query.go │ │ │ ├── row_description.go │ │ │ ├── sasl_initial_response.go │ │ │ ├── sasl_response.go │ │ │ ├── ssl_request.go │ │ │ ├── startup_message.go │ │ │ ├── sync.go │ │ │ ├── terminate.go │ │ │ └── trace.go │ │ │ ├── pgtype │ │ │ ├── array.go │ │ │ ├── array_codec.go │ │ │ ├── bits.go │ │ │ ├── bool.go │ │ │ ├── box.go │ │ │ ├── builtin_wrappers.go │ │ │ ├── bytea.go │ │ │ ├── circle.go │ │ │ ├── composite.go │ │ │ ├── convert.go │ │ │ ├── date.go │ │ │ ├── doc.go │ │ │ ├── enum_codec.go │ │ │ ├── float4.go │ │ │ ├── float8.go │ │ │ ├── hstore.go │ │ │ ├── inet.go │ │ │ ├── int.go │ │ │ ├── int.go.erb │ │ │ ├── int_test.go.erb │ │ │ ├── integration_benchmark_test.go.erb │ │ │ ├── integration_benchmark_test_gen.sh │ │ │ ├── interval.go │ │ │ ├── json.go │ │ │ ├── jsonb.go │ │ │ ├── line.go │ │ │ ├── lseg.go │ │ │ ├── ltree.go │ │ │ ├── macaddr.go │ │ │ ├── multirange.go │ │ │ ├── numeric.go │ │ │ ├── path.go │ │ │ ├── pgtype.go │ │ │ ├── pgtype_default.go │ │ │ ├── point.go │ │ │ ├── polygon.go │ │ │ ├── qchar.go │ │ │ ├── range.go │ │ │ ├── range_codec.go │ │ │ ├── record_codec.go │ │ │ ├── register_default_pg_types.go │ │ │ ├── register_default_pg_types_disabled.go │ │ │ ├── text.go │ │ │ ├── text_format_only_codec.go │ │ │ ├── tid.go │ │ │ ├── time.go │ │ │ ├── timestamp.go │ │ │ ├── timestamptz.go │ │ │ ├── uint32.go │ │ │ └── uuid.go │ │ │ ├── pgxpool │ │ │ ├── batch_results.go │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── pool.go │ │ │ ├── rows.go │ │ │ ├── stat.go │ │ │ └── tx.go │ │ │ ├── rows.go │ │ │ ├── stdlib │ │ │ └── sql.go │ │ │ ├── tracer.go │ │ │ ├── tx.go │ │ │ └── values.go │ └── puddle │ │ └── v2 │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ ├── doc.go │ │ ├── internal │ │ └── genstack │ │ │ ├── gen_stack.go │ │ │ └── stack.go │ │ ├── log.go │ │ ├── nanotime_time.go │ │ ├── nanotime_unsafe.go │ │ ├── pool.go │ │ └── resource_list.go ├── jinzhu │ ├── gorm │ │ ├── .gitignore │ │ ├── License │ │ ├── README.md │ │ ├── association.go │ │ ├── callback.go │ │ ├── callback_create.go │ │ ├── callback_delete.go │ │ ├── callback_query.go │ │ ├── callback_query_preload.go │ │ ├── callback_row_query.go │ │ ├── callback_save.go │ │ ├── callback_update.go │ │ ├── dialect.go │ │ ├── dialect_common.go │ │ ├── dialect_mysql.go │ │ ├── dialect_postgres.go │ │ ├── dialect_sqlite3.go │ │ ├── dialects │ │ │ └── postgres │ │ │ │ └── postgres.go │ │ ├── docker-compose.yml │ │ ├── errors.go │ │ ├── field.go │ │ ├── interface.go │ │ ├── join_table_handler.go │ │ ├── logger.go │ │ ├── main.go │ │ ├── model.go │ │ ├── model_struct.go │ │ ├── naming.go │ │ ├── scope.go │ │ ├── search.go │ │ ├── test_all.sh │ │ ├── utils.go │ │ └── wercker.yml │ ├── inflection │ │ ├── LICENSE │ │ ├── README.md │ │ ├── inflections.go │ │ └── wercker.yml │ └── now │ │ ├── Guardfile │ │ ├── License │ │ ├── README.md │ │ ├── main.go │ │ ├── now.go │ │ └── time.go ├── labstack │ ├── echo │ │ └── v4 │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── bind.go │ │ │ ├── binder.go │ │ │ ├── codecov.yml │ │ │ ├── context.go │ │ │ ├── context_fs.go │ │ │ ├── echo.go │ │ │ ├── echo_fs.go │ │ │ ├── group.go │ │ │ ├── group_fs.go │ │ │ ├── ip.go │ │ │ ├── json.go │ │ │ ├── log.go │ │ │ ├── middleware │ │ │ ├── basic_auth.go │ │ │ ├── body_dump.go │ │ │ ├── body_limit.go │ │ │ ├── compress.go │ │ │ ├── context_timeout.go │ │ │ ├── cors.go │ │ │ ├── csrf.go │ │ │ ├── decompress.go │ │ │ ├── extractor.go │ │ │ ├── key_auth.go │ │ │ ├── logger.go │ │ │ ├── method_override.go │ │ │ ├── middleware.go │ │ │ ├── proxy.go │ │ │ ├── rate_limiter.go │ │ │ ├── recover.go │ │ │ ├── redirect.go │ │ │ ├── request_id.go │ │ │ ├── request_logger.go │ │ │ ├── rewrite.go │ │ │ ├── secure.go │ │ │ ├── slash.go │ │ │ ├── static.go │ │ │ ├── static_other.go │ │ │ ├── static_windows.go │ │ │ ├── timeout.go │ │ │ └── util.go │ │ │ ├── renderer.go │ │ │ ├── response.go │ │ │ └── router.go │ └── gommon │ │ ├── LICENSE │ │ ├── bytes │ │ ├── README.md │ │ └── bytes.go │ │ ├── color │ │ ├── README.md │ │ └── color.go │ │ └── log │ │ ├── README.md │ │ ├── color.go │ │ ├── log.go │ │ └── white.go ├── lib │ └── pq │ │ ├── .gitignore │ │ ├── .travis.sh │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── TESTS.md │ │ ├── array.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── connector.go │ │ ├── copy.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── error.go │ │ ├── hstore │ │ └── hstore.go │ │ ├── notify.go │ │ ├── oid │ │ ├── doc.go │ │ └── types.go │ │ ├── rows.go │ │ ├── scram │ │ └── scram.go │ │ ├── ssl.go │ │ ├── ssl_permissions.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ └── uuid.go ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_appengine.go │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ ├── go.test.sh │ │ └── noncolorable.go │ ├── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ └── go-sqlite3 │ │ ├── .codecov.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── callback.go │ │ ├── convert.go │ │ ├── doc.go │ │ ├── error.go │ │ ├── sqlite3-binding.c │ │ ├── sqlite3-binding.h │ │ ├── sqlite3.go │ │ ├── sqlite3_context.go │ │ ├── sqlite3_func_crypt.go │ │ ├── sqlite3_go18.go │ │ ├── sqlite3_libsqlite3.go │ │ ├── sqlite3_load_extension.go │ │ ├── sqlite3_load_extension_omit.go │ │ ├── sqlite3_opt_allow_uri_authority.go │ │ ├── sqlite3_opt_app_armor.go │ │ ├── sqlite3_opt_column_metadata.go │ │ ├── sqlite3_opt_foreign_keys.go │ │ ├── sqlite3_opt_fts5.go │ │ ├── sqlite3_opt_icu.go │ │ ├── sqlite3_opt_introspect.go │ │ ├── sqlite3_opt_math_functions.go │ │ ├── sqlite3_opt_os_trace.go │ │ ├── sqlite3_opt_preupdate.go │ │ ├── sqlite3_opt_preupdate_hook.go │ │ ├── sqlite3_opt_preupdate_omit.go │ │ ├── sqlite3_opt_secure_delete.go │ │ ├── sqlite3_opt_secure_delete_fast.go │ │ ├── sqlite3_opt_serialize.go │ │ ├── sqlite3_opt_serialize_omit.go │ │ ├── sqlite3_opt_stat4.go │ │ ├── sqlite3_opt_unlock_notify.c │ │ ├── sqlite3_opt_unlock_notify.go │ │ ├── sqlite3_opt_userauth.go │ │ ├── sqlite3_opt_userauth_omit.go │ │ ├── sqlite3_opt_vacuum_full.go │ │ ├── sqlite3_opt_vacuum_incr.go │ │ ├── sqlite3_opt_vtable.go │ │ ├── sqlite3_other.go │ │ ├── sqlite3_solaris.go │ │ ├── sqlite3_trace.go │ │ ├── sqlite3_type.go │ │ ├── sqlite3_usleep_windows.go │ │ ├── sqlite3_windows.go │ │ ├── sqlite3ext.h │ │ └── static_mock.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── stretchr │ ├── objx │ │ ├── .codeclimate.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Taskfile.yml │ │ ├── accessors.go │ │ ├── conversions.go │ │ ├── doc.go │ │ ├── map.go │ │ ├── mutations.go │ │ ├── security.go │ │ ├── tests.go │ │ ├── type_specific.go │ │ ├── type_specific_codegen.go │ │ └── value.go │ └── testify │ │ ├── LICENSE │ │ ├── assert │ │ ├── assertion_compare.go │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertion_order.go │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ ├── http_assertions.go │ │ └── yaml │ │ │ ├── yaml_custom.go │ │ │ ├── yaml_default.go │ │ │ └── yaml_fail.go │ │ └── mock │ │ ├── doc.go │ │ └── mock.go └── valyala │ ├── bytebufferpool │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bytebuffer.go │ ├── doc.go │ └── pool.go │ └── fasttemplate │ ├── LICENSE │ ├── README.md │ ├── template.go │ ├── unsafe.go │ └── unsafe_gae.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ ├── acme │ │ ├── acme.go │ │ ├── autocert │ │ │ ├── autocert.go │ │ │ ├── cache.go │ │ │ ├── listener.go │ │ │ └── renewal.go │ │ ├── http.go │ │ ├── jws.go │ │ ├── rfc8555.go │ │ └── types.go │ └── pbkdf2 │ │ └── pbkdf2.go │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── http │ │ └── httpguts │ │ │ ├── guts.go │ │ │ └── httplex.go │ ├── http2 │ │ ├── .gitignore │ │ ├── ascii.go │ │ ├── ciphers.go │ │ ├── client_conn_pool.go │ │ ├── config.go │ │ ├── config_go124.go │ │ ├── config_pre_go124.go │ │ ├── databuffer.go │ │ ├── errors.go │ │ ├── flow.go │ │ ├── frame.go │ │ ├── gotrack.go │ │ ├── h2c │ │ │ └── h2c.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── hpack.go │ │ │ ├── huffman.go │ │ │ ├── static_table.go │ │ │ └── tables.go │ │ ├── http2.go │ │ ├── pipe.go │ │ ├── server.go │ │ ├── timer.go │ │ ├── transport.go │ │ ├── unencrypted.go │ │ ├── write.go │ │ ├── writesched.go │ │ ├── writesched_priority.go │ │ ├── writesched_random.go │ │ └── writesched_roundrobin.go │ └── idna │ │ ├── go118.go │ │ ├── idna10.0.0.go │ │ ├── idna9.0.0.go │ │ ├── pre_go118.go │ │ ├── punycode.go │ │ ├── tables10.0.0.go │ │ ├── tables11.0.0.go │ │ ├── tables12.0.0.go │ │ ├── tables13.0.0.go │ │ ├── tables15.0.0.go │ │ ├── tables9.0.0.go │ │ ├── trie.go │ │ ├── trie12.0.0.go │ │ ├── trie13.0.0.go │ │ └── trieval.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── semaphore │ │ └── semaphore.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ └── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── vgetrandom_linux.go │ │ ├── vgetrandom_unsupported.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ ├── text │ ├── LICENSE │ ├── PATENTS │ ├── cases │ │ ├── cases.go │ │ ├── context.go │ │ ├── fold.go │ │ ├── icu.go │ │ ├── info.go │ │ ├── map.go │ │ ├── tables10.0.0.go │ │ ├── tables11.0.0.go │ │ ├── tables12.0.0.go │ │ ├── tables13.0.0.go │ │ ├── tables15.0.0.go │ │ ├── tables9.0.0.go │ │ └── trieval.go │ ├── internal │ │ ├── internal.go │ │ ├── language │ │ │ ├── common.go │ │ │ ├── compact.go │ │ │ ├── compact │ │ │ │ ├── compact.go │ │ │ │ ├── language.go │ │ │ │ ├── parents.go │ │ │ │ ├── tables.go │ │ │ │ └── tags.go │ │ │ ├── compose.go │ │ │ ├── coverage.go │ │ │ ├── language.go │ │ │ ├── lookup.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── match.go │ │ └── tag │ │ │ └── tag.go │ ├── language │ │ ├── coverage.go │ │ ├── doc.go │ │ ├── language.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go │ ├── runes │ │ ├── cond.go │ │ └── runes.go │ ├── secure │ │ ├── bidirule │ │ │ ├── bidirule.go │ │ │ ├── bidirule10.0.0.go │ │ │ └── bidirule9.0.0.go │ │ └── precis │ │ │ ├── class.go │ │ │ ├── context.go │ │ │ ├── doc.go │ │ │ ├── nickname.go │ │ │ ├── options.go │ │ │ ├── profile.go │ │ │ ├── profiles.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables12.0.0.go │ │ │ ├── tables13.0.0.go │ │ │ ├── tables15.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── transformer.go │ │ │ └── trieval.go │ ├── transform │ │ └── transform.go │ ├── unicode │ │ ├── bidi │ │ │ ├── bidi.go │ │ │ ├── bracket.go │ │ │ ├── core.go │ │ │ ├── prop.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables12.0.0.go │ │ │ ├── tables13.0.0.go │ │ │ ├── tables15.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ └── trieval.go │ │ └── norm │ │ │ ├── composition.go │ │ │ ├── forminfo.go │ │ │ ├── input.go │ │ │ ├── iter.go │ │ │ ├── normalize.go │ │ │ ├── readwriter.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables12.0.0.go │ │ │ ├── tables13.0.0.go │ │ │ ├── tables15.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── transform.go │ │ │ └── trie.go │ └── width │ │ ├── kind_string.go │ │ ├── tables10.0.0.go │ │ ├── tables11.0.0.go │ │ ├── tables12.0.0.go │ │ ├── tables13.0.0.go │ │ ├── tables15.0.0.go │ │ ├── tables9.0.0.go │ │ ├── transform.go │ │ ├── trieval.go │ │ └── width.go │ └── time │ ├── LICENSE │ ├── PATENTS │ └── rate │ ├── rate.go │ └── sometimes.go ├── gopkg.in └── yaml.v3 │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go ├── gorm.io ├── driver │ ├── postgres │ │ ├── .gitignore │ │ ├── License │ │ ├── README.md │ │ ├── error_translator.go │ │ ├── migrator.go │ │ └── postgres.go │ └── sqlite │ │ ├── .gitignore │ │ ├── License │ │ ├── README.md │ │ ├── ddlmod.go │ │ ├── ddlmod_parse_all_columns.go │ │ ├── error_translator.go │ │ ├── errors.go │ │ ├── migrator.go │ │ └── sqlite.go └── gorm │ ├── .gitignore │ ├── .golangci.yml │ ├── LICENSE │ ├── README.md │ ├── association.go │ ├── callbacks.go │ ├── callbacks │ ├── associations.go │ ├── callbacks.go │ ├── callmethod.go │ ├── create.go │ ├── delete.go │ ├── helper.go │ ├── interfaces.go │ ├── preload.go │ ├── query.go │ ├── raw.go │ ├── row.go │ ├── transaction.go │ └── update.go │ ├── chainable_api.go │ ├── clause │ ├── clause.go │ ├── delete.go │ ├── expression.go │ ├── from.go │ ├── group_by.go │ ├── insert.go │ ├── joins.go │ ├── limit.go │ ├── locking.go │ ├── on_conflict.go │ ├── order_by.go │ ├── returning.go │ ├── select.go │ ├── set.go │ ├── update.go │ ├── values.go │ ├── where.go │ └── with.go │ ├── errors.go │ ├── finisher_api.go │ ├── gorm.go │ ├── interfaces.go │ ├── logger │ ├── logger.go │ └── sql.go │ ├── migrator.go │ ├── migrator │ ├── column_type.go │ ├── index.go │ ├── migrator.go │ └── table_type.go │ ├── model.go │ ├── prepare_stmt.go │ ├── scan.go │ ├── schema │ ├── constraint.go │ ├── field.go │ ├── index.go │ ├── interfaces.go │ ├── naming.go │ ├── pool.go │ ├── relationship.go │ ├── schema.go │ ├── serializer.go │ └── utils.go │ ├── soft_delete.go │ ├── statement.go │ └── utils │ └── utils.go └── modules.txt /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gomod" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a golang project 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go 3 | 4 | name: Go 5 | 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ "main" ] 11 | 12 | jobs: 13 | 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - name: Set up Go 20 | uses: actions/setup-go@v4 21 | with: 22 | go-version: '1.22.x' 23 | 24 | - name: Build 25 | run: go build -v ./... 26 | 27 | - name: Test 28 | run: go test -v ./... 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | 3 | # If you prefer the allow list template instead of the deny list, see community template: 4 | # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore 5 | # 6 | # Binaries for programs and plugins 7 | *.exe 8 | *.exe~ 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, built with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | 19 | # Dependency directories (remove the comment below to include it) 20 | # vendor/ 21 | 22 | # Go workspace file 23 | go.work 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Simon Klinkert 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 | -------------------------------------------------------------------------------- /ddd-diagram-onion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sklinkert/go-ddd/25de2c8154fc298a089544c1c1fcac0ea181fa45/ddd-diagram-onion.png -------------------------------------------------------------------------------- /internal/application/command/create_product_command.go: -------------------------------------------------------------------------------- 1 | package command 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/common" 6 | ) 7 | 8 | type CreateProductCommand struct { 9 | // TODO: Implement idempotency key 10 | 11 | Id uuid.UUID 12 | Name string 13 | Price float64 14 | SellerId uuid.UUID 15 | } 16 | 17 | type CreateProductCommandResult struct { 18 | Result *common.ProductResult 19 | } 20 | -------------------------------------------------------------------------------- /internal/application/command/create_seller_command.go: -------------------------------------------------------------------------------- 1 | package command 2 | 3 | import "github.com/sklinkert/go-ddd/internal/application/common" 4 | 5 | type CreateSellerCommand struct { 6 | // TODO: Implement idempotency key 7 | 8 | Name string 9 | } 10 | 11 | type CreateSellerCommandResult struct { 12 | Result *common.SellerResult 13 | } 14 | -------------------------------------------------------------------------------- /internal/application/command/update_seller_command.go: -------------------------------------------------------------------------------- 1 | package command 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/common" 6 | ) 7 | 8 | type UpdateSellerCommand struct { 9 | // TODO: Implement idempotency key 10 | 11 | Id uuid.UUID 12 | Name string 13 | } 14 | 15 | type UpdateSellerCommandResult struct { 16 | Result *common.SellerResult 17 | } 18 | -------------------------------------------------------------------------------- /internal/application/common/product_result.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "time" 6 | ) 7 | 8 | type ProductResult struct { 9 | Id uuid.UUID 10 | Name string 11 | Price float64 12 | Seller *SellerResult 13 | CreatedAt time.Time 14 | UpdatedAt time.Time 15 | } 16 | -------------------------------------------------------------------------------- /internal/application/common/seller_result.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "time" 6 | ) 7 | 8 | type SellerResult struct { 9 | Id uuid.UUID 10 | Name string 11 | CreatedAt time.Time 12 | UpdatedAt time.Time 13 | } 14 | -------------------------------------------------------------------------------- /internal/application/interfaces/product_service.go: -------------------------------------------------------------------------------- 1 | package interfaces 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/command" 6 | "github.com/sklinkert/go-ddd/internal/application/query" 7 | ) 8 | 9 | type ProductService interface { 10 | CreateProduct(productCommand *command.CreateProductCommand) (*command.CreateProductCommandResult, error) 11 | FindAllProducts() (*query.ProductQueryListResult, error) 12 | FindProductById(id uuid.UUID) (*query.ProductQueryResult, error) 13 | } 14 | -------------------------------------------------------------------------------- /internal/application/interfaces/seller_service.go: -------------------------------------------------------------------------------- 1 | package interfaces 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/command" 6 | "github.com/sklinkert/go-ddd/internal/application/query" 7 | ) 8 | 9 | type SellerService interface { 10 | CreateSeller(sellerCommand *command.CreateSellerCommand) (*command.CreateSellerCommandResult, error) 11 | FindAllSellers() (*query.SellerQueryListResult, error) 12 | FindSellerById(id uuid.UUID) (*query.SellerQueryResult, error) 13 | UpdateSeller(updateCommand *command.UpdateSellerCommand) (*command.UpdateSellerCommandResult, error) 14 | DeleteSeller(id uuid.UUID) error 15 | } 16 | -------------------------------------------------------------------------------- /internal/application/mapper/product_result.go: -------------------------------------------------------------------------------- 1 | package mapper 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/application/common" 5 | "github.com/sklinkert/go-ddd/internal/domain/entities" 6 | ) 7 | 8 | func NewProductResultFromValidatedEntity(product *entities.ValidatedProduct) *common.ProductResult { 9 | return NewProductResultFromEntity(&product.Product) 10 | } 11 | 12 | func NewProductResultFromEntity(product *entities.Product) *common.ProductResult { 13 | if product == nil { 14 | return nil 15 | } 16 | 17 | return &common.ProductResult{ 18 | Id: product.Id, 19 | Name: product.Name, 20 | Price: product.Price, 21 | Seller: NewSellerResultFromEntity(&product.Seller), 22 | CreatedAt: product.CreatedAt, 23 | UpdatedAt: product.UpdatedAt, 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/application/mapper/seller_result.go: -------------------------------------------------------------------------------- 1 | package mapper 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/application/common" 5 | "github.com/sklinkert/go-ddd/internal/domain/entities" 6 | ) 7 | 8 | func NewSellerResultFromValidatedEntity(seller *entities.ValidatedSeller) *common.SellerResult { 9 | return NewSellerResultFromEntity(&seller.Seller) 10 | } 11 | 12 | func NewSellerResultFromEntity(seller *entities.Seller) *common.SellerResult { 13 | if seller == nil { 14 | return nil 15 | } 16 | 17 | return &common.SellerResult{ 18 | Id: seller.Id, 19 | Name: seller.Name, 20 | CreatedAt: seller.CreatedAt, 21 | UpdatedAt: seller.UpdatedAt, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /internal/application/query/product_query_result.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | import "github.com/sklinkert/go-ddd/internal/application/common" 4 | 5 | type ProductQueryResult struct { 6 | Result *common.ProductResult 7 | } 8 | 9 | type ProductQueryListResult struct { 10 | Result []*common.ProductResult 11 | } 12 | -------------------------------------------------------------------------------- /internal/application/query/seller_query_result.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | import "github.com/sklinkert/go-ddd/internal/application/common" 4 | 5 | type SellerQueryResult struct { 6 | Result *common.SellerResult 7 | } 8 | 9 | type SellerQueryListResult struct { 10 | Result []*common.SellerResult 11 | } 12 | -------------------------------------------------------------------------------- /internal/domain/entities/product_test.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "testing" 6 | ) 7 | 8 | func TestNewProduct(t *testing.T) { 9 | seller := NewSeller("Example Seller") 10 | validatedSeller, err := NewValidatedSeller(seller) 11 | if err != nil { 12 | t.Fatalf("Expected no error, but got %s", err.Error()) 13 | } 14 | 15 | product := NewProduct("Example Product", 10.0, *validatedSeller) 16 | 17 | if product.Name != "Example Product" { 18 | t.Errorf("Expected product name to be 'Example Product', but got %s", product.Name) 19 | } 20 | 21 | if product.Price != 10.0 { 22 | t.Errorf("Expected product price to be 10.0, but got %f", product.Price) 23 | } 24 | 25 | if product.Id == (uuid.UUID{}) { 26 | t.Error("Expected product Id to be set, but got zero value") 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /internal/domain/entities/seller.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "errors" 5 | "github.com/google/uuid" 6 | "time" 7 | ) 8 | 9 | type Seller struct { 10 | Id uuid.UUID 11 | CreatedAt time.Time 12 | UpdatedAt time.Time 13 | Name string 14 | } 15 | 16 | func NewSeller(name string) *Seller { 17 | return &Seller{ 18 | Id: uuid.New(), 19 | CreatedAt: time.Now(), 20 | UpdatedAt: time.Now(), 21 | Name: name, 22 | } 23 | } 24 | 25 | func (s *Seller) validate() error { 26 | if s.Name == "" { 27 | return errors.New("name must not be empty") 28 | } 29 | if s.CreatedAt.After(s.UpdatedAt) { 30 | return errors.New("created_at must be before updated_at") 31 | } 32 | 33 | return nil 34 | } 35 | 36 | func (s *Seller) UpdateName(name string) error { 37 | s.Name = name 38 | s.UpdatedAt = time.Now() 39 | 40 | return s.validate() 41 | } 42 | -------------------------------------------------------------------------------- /internal/domain/entities/seller_test.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "testing" 6 | ) 7 | 8 | func TestNewSeller(t *testing.T) { 9 | seller := NewSeller("Example Seller") 10 | 11 | if seller.Name != "Example Seller" { 12 | t.Errorf("Expected seller name to be 'Example Seller', but got %s", seller.Name) 13 | } 14 | 15 | if seller.Id == (uuid.UUID{}) { 16 | t.Error("Expected seller Id to be set, but got zero value") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /internal/domain/entities/validated_product.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type ValidatedProduct struct { 4 | Product 5 | isValidated bool 6 | } 7 | 8 | func (vp *ValidatedProduct) IsValid() bool { 9 | return vp.isValidated 10 | } 11 | 12 | func NewValidatedProduct(product *Product) (*ValidatedProduct, error) { 13 | if err := product.validate(); err != nil { 14 | return nil, err 15 | } 16 | 17 | return &ValidatedProduct{ 18 | Product: *product, 19 | isValidated: true, 20 | }, nil 21 | } 22 | -------------------------------------------------------------------------------- /internal/domain/entities/validated_seller.go: -------------------------------------------------------------------------------- 1 | package entities 2 | 3 | type ValidatedSeller struct { 4 | Seller 5 | isValidated bool 6 | } 7 | 8 | func (vp *ValidatedSeller) IsValid() bool { 9 | return vp.isValidated 10 | } 11 | 12 | func NewValidatedSeller(seller *Seller) (*ValidatedSeller, error) { 13 | if err := seller.validate(); err != nil { 14 | return nil, err 15 | } 16 | 17 | return &ValidatedSeller{ 18 | Seller: *seller, 19 | isValidated: true, 20 | }, nil 21 | } 22 | -------------------------------------------------------------------------------- /internal/domain/repositories/product_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/domain/entities" 6 | ) 7 | 8 | type ProductRepository interface { 9 | Create(product *entities.ValidatedProduct) (*entities.Product, error) 10 | FindById(id uuid.UUID) (*entities.Product, error) 11 | FindAll() ([]*entities.Product, error) 12 | Update(product *entities.ValidatedProduct) (*entities.Product, error) 13 | Delete(id uuid.UUID) error 14 | } 15 | -------------------------------------------------------------------------------- /internal/domain/repositories/seller_repository.go: -------------------------------------------------------------------------------- 1 | package repositories 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/domain/entities" 6 | ) 7 | 8 | type SellerRepository interface { 9 | Create(seller *entities.ValidatedSeller) (*entities.Seller, error) 10 | FindById(id uuid.UUID) (*entities.Seller, error) 11 | FindAll() ([]*entities.Seller, error) 12 | Update(seller *entities.ValidatedSeller) (*entities.Seller, error) 13 | Delete(id uuid.UUID) error 14 | } 15 | -------------------------------------------------------------------------------- /internal/infrastructure/db/postgres/connection.go: -------------------------------------------------------------------------------- 1 | package postgres 2 | 3 | import ( 4 | "github.com/jinzhu/gorm" 5 | _ "github.com/jinzhu/gorm/dialects/postgres" 6 | ) 7 | 8 | func NewConnection() (*gorm.DB, error) { 9 | return gorm.Open("postgres", "your_connection_string_here") 10 | } 11 | -------------------------------------------------------------------------------- /internal/infrastructure/db/postgres/db_models..go: -------------------------------------------------------------------------------- 1 | package postgres 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "time" 6 | ) 7 | 8 | type Product struct { 9 | Id uuid.UUID `gorm:"primaryKey"` 10 | Name string 11 | Price float64 12 | SellerId uuid.UUID `gorm:"index"` 13 | Seller Seller `gorm:"foreignKey:SellerId"` 14 | CreatedAt time.Time 15 | UpdatedAt time.Time 16 | } 17 | 18 | type Seller struct { 19 | Id uuid.UUID `gorm:"primaryKey"` 20 | Name string 21 | CreatedAt time.Time 22 | UpdatedAt time.Time 23 | } 24 | -------------------------------------------------------------------------------- /internal/infrastructure/db/postgres/product_mapper.go: -------------------------------------------------------------------------------- 1 | package postgres 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/domain/entities" 5 | ) 6 | 7 | func toDBProduct(product *entities.ValidatedProduct) *Product { 8 | var p = &Product{ 9 | Name: product.Name, 10 | Price: product.Price, 11 | SellerId: product.Seller.Id, // Ensure Seller is non-nil when mapping 12 | CreatedAt: product.CreatedAt, 13 | UpdatedAt: product.UpdatedAt, 14 | } 15 | p.Id = product.Id 16 | 17 | return p 18 | } 19 | 20 | func fromDBProduct(dbProduct *Product) *entities.Product { 21 | var seller = &entities.Seller{ 22 | Id: dbProduct.Seller.Id, 23 | Name: dbProduct.Seller.Name, 24 | CreatedAt: dbProduct.Seller.CreatedAt, 25 | UpdatedAt: dbProduct.Seller.UpdatedAt, 26 | } 27 | 28 | var p = &entities.Product{ 29 | Name: dbProduct.Name, 30 | Price: dbProduct.Price, 31 | Seller: *seller, 32 | CreatedAt: dbProduct.CreatedAt, 33 | UpdatedAt: dbProduct.UpdatedAt, 34 | } 35 | p.Id = dbProduct.Id 36 | 37 | return p 38 | } 39 | -------------------------------------------------------------------------------- /internal/infrastructure/db/postgres/seller_mapper.go: -------------------------------------------------------------------------------- 1 | package postgres 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/domain/entities" 5 | ) 6 | 7 | // toDBSeller maps domain Seller entity to DB persistence model. 8 | func toDBSeller(seller *entities.ValidatedSeller) *Seller { 9 | s := &Seller{ 10 | Name: seller.Name, 11 | } 12 | s.Id = seller.Id 13 | 14 | return s 15 | } 16 | 17 | // fromDBSeller maps DB persistence model to domain Seller entity. 18 | func fromDBSeller(dbSeller *Seller) *entities.Seller { 19 | s := &entities.Seller{ 20 | Name: dbSeller.Name, 21 | } 22 | s.Id = dbSeller.Id 23 | 24 | return s 25 | } 26 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/mapper/product_response_mapper.go: -------------------------------------------------------------------------------- 1 | package mapper 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/application/common" 5 | "github.com/sklinkert/go-ddd/internal/interface/api/rest/dto/response" 6 | ) 7 | 8 | func ToProductResponse(product *common.ProductResult) *response.ProductResponse { 9 | return &response.ProductResponse{ 10 | Id: product.Id.String(), 11 | Name: product.Name, 12 | Price: product.Price, 13 | CreatedAt: product.CreatedAt, 14 | UpdatedAt: product.UpdatedAt, 15 | } 16 | } 17 | 18 | func ToProductListResponse(products []*common.ProductResult) *response.ListProductsResponse { 19 | var responseList []*response.ProductResponse 20 | for _, product := range products { 21 | responseList = append(responseList, ToProductResponse(product)) 22 | } 23 | return &response.ListProductsResponse{Products: responseList} 24 | } 25 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/mapper/seller_response_mapper.go: -------------------------------------------------------------------------------- 1 | package mapper 2 | 3 | import ( 4 | "github.com/sklinkert/go-ddd/internal/application/common" 5 | "github.com/sklinkert/go-ddd/internal/interface/api/rest/dto/response" 6 | ) 7 | 8 | func ToSellerResponse(product *common.SellerResult) *response.SellerResponse { 9 | return &response.SellerResponse{ 10 | Id: product.Id.String(), 11 | Name: product.Name, 12 | CreatedAt: product.CreatedAt, 13 | UpdatedAt: product.UpdatedAt, 14 | } 15 | } 16 | 17 | func ToSellerListResponse(products []*common.SellerResult) *response.ListSellersResponse { 18 | var responseList []*response.SellerResponse 19 | 20 | for _, product := range products { 21 | responseList = append(responseList, ToSellerResponse(product)) 22 | } 23 | 24 | return &response.ListSellersResponse{Sellers: responseList} 25 | } 26 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/request/create_product_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/command" 6 | ) 7 | 8 | type CreateProductRequest struct { 9 | Name string `json:"Name"` 10 | Price float64 `json:"Price"` 11 | SellerId string `json:"SellerId"` 12 | } 13 | 14 | func (req *CreateProductRequest) ToCreateProductCommand() (*command.CreateProductCommand, error) { 15 | sellerId, err := uuid.Parse(req.SellerId) 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | return &command.CreateProductCommand{ 21 | Name: req.Name, 22 | Price: req.Price, 23 | SellerId: sellerId, 24 | }, nil 25 | } 26 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/request/create_seller_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import "github.com/sklinkert/go-ddd/internal/application/command" 4 | 5 | type CreateSellerRequest struct { 6 | Name string `json:"Name"` 7 | } 8 | 9 | func (req *CreateSellerRequest) ToCreateSellerCommand() (*command.CreateSellerCommand, error) { 10 | return &command.CreateSellerCommand{ 11 | Name: req.Name, 12 | }, nil 13 | } 14 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/request/update_seller_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/google/uuid" 5 | "github.com/sklinkert/go-ddd/internal/application/command" 6 | ) 7 | 8 | type UpdateSellerRequest struct { 9 | Id uuid.UUID `json:"Id"` 10 | Name string `json:"Name"` 11 | } 12 | 13 | func (req *UpdateSellerRequest) ToUpdateSellerCommand() (*command.UpdateSellerCommand, error) { 14 | return &command.UpdateSellerCommand{ 15 | Id: req.Id, 16 | Name: req.Name, 17 | }, nil 18 | } 19 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/response/product_response.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "time" 4 | 5 | type ProductResponse struct { 6 | Id string 7 | Name string 8 | Price float64 9 | CreatedAt time.Time 10 | UpdatedAt time.Time 11 | } 12 | 13 | type ListProductsResponse struct { 14 | Products []*ProductResponse `json:"Products"` 15 | } 16 | -------------------------------------------------------------------------------- /internal/interface/api/rest/dto/response/seller_response.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "time" 4 | 5 | type SellerResponse struct { 6 | Id string 7 | Name string 8 | CreatedAt time.Time 9 | UpdatedAt time.Time 10 | } 11 | 12 | type ListSellersResponse struct { 13 | Sellers []*SellerResponse 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Tips 6 | 7 | Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). 8 | 9 | Always try to include a test case! If it is not possible or not necessary, 10 | please explain why in the pull request description. 11 | 12 | ### Releasing 13 | 14 | Commits that would precipitate a SemVer change, as described in the Conventional 15 | Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) 16 | to create a release candidate pull request. Once submitted, `release-please` 17 | will create a release. 18 | 19 | For tips on how to work with `release-please`, see its documentation. 20 | 21 | ### Legal requirements 22 | 23 | In order to protect both you and ourselves, you will need to sign the 24 | [Contributor License Agreement](https://cla.developers.google.com/clas). 25 | 26 | You may have already signed it for other Google projects. 27 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid 2 | The uuid package generates and inspects UUIDs based on 3 | [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) 4 | and DCE 1.1: Authentication and Security Services. 5 | 6 | This package is based on the github.com/pborman/uuid package (previously named 7 | code.google.com/p/go-uuid). It differs from these earlier packages in that 8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this 9 | change is the ability to represent an invalid UUID (vs a NIL UUID). 10 | 11 | ###### Install 12 | ```sh 13 | go get github.com/google/uuid 14 | ``` 15 | 16 | ###### Documentation 17 | [![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) 18 | 19 | Full `go doc` style documentation for the package can be viewed online without 20 | installing this package by using the GoDoc site here: 21 | http://pkg.go.dev/github.com/google/uuid 22 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/marshal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid 6 | 7 | import "fmt" 8 | 9 | // MarshalText implements encoding.TextMarshaler. 10 | func (uuid UUID) MarshalText() ([]byte, error) { 11 | var js [36]byte 12 | encodeHex(js[:], uuid) 13 | return js[:], nil 14 | } 15 | 16 | // UnmarshalText implements encoding.TextUnmarshaler. 17 | func (uuid *UUID) UnmarshalText(data []byte) error { 18 | id, err := ParseBytes(data) 19 | if err != nil { 20 | return err 21 | } 22 | *uuid = id 23 | return nil 24 | } 25 | 26 | // MarshalBinary implements encoding.BinaryMarshaler. 27 | func (uuid UUID) MarshalBinary() ([]byte, error) { 28 | return uuid[:], nil 29 | } 30 | 31 | // UnmarshalBinary implements encoding.BinaryUnmarshaler. 32 | func (uuid *UUID) UnmarshalBinary(data []byte) error { 33 | if len(data) != 16 { 34 | return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) 35 | } 36 | copy(uuid[:], data) 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 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 js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This removes the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 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 !js 6 | 7 | package uuid 8 | 9 | import "net" 10 | 11 | var interfaces []net.Interface // cached list of interfaces 12 | 13 | // getHardwareInterface returns the name and hardware address of interface name. 14 | // If name is "" then the name and hardware address of one of the system's 15 | // interfaces is returned. If no interfaces are found (name does not exist or 16 | // there are no interfaces) then "", nil is returned. 17 | // 18 | // Only addresses of at least 6 bytes are returned. 19 | func getHardwareInterface(name string) (string, []byte) { 20 | if interfaces == nil { 21 | var err error 22 | interfaces, err = net.Interfaces() 23 | if err != nil { 24 | return "", nil 25 | } 26 | } 27 | for _, ifs := range interfaces { 28 | if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { 29 | return ifs.Name, ifs.HardwareAddr 30 | } 31 | } 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgpassfile/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgpassfile/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Jack Christensen 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgpassfile/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgpassfile?status.svg)](https://godoc.org/github.com/jackc/pgpassfile) 2 | [![Build Status](https://travis-ci.org/jackc/pgpassfile.svg)](https://travis-ci.org/jackc/pgpassfile) 3 | 4 | # pgpassfile 5 | 6 | Package pgpassfile is a parser PostgreSQL .pgpass files. 7 | 8 | Extracted and rewritten from original implementation in https://github.com/jackc/pgx. 9 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgservicefile/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgservicefile/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Jack Christensen 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgservicefile/README.md: -------------------------------------------------------------------------------- 1 | [![](https://godoc.org/github.com/jackc/pgservicefile?status.svg)](https://godoc.org/github.com/jackc/pgservicefile) 2 | [![Build Status](https://travis-ci.org/jackc/pgservicefile.svg)](https://travis-ci.org/jackc/pgservicefile) 3 | 4 | # pgservicefile 5 | 6 | Package pgservicefile is a parser for PostgreSQL service files (e.g. `.pg_service.conf`). 7 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/.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 | 24 | .envrc 25 | /.testdb 26 | 27 | .DS_Store 28 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2021 Jack Christensen 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/Rakefile: -------------------------------------------------------------------------------- 1 | require "erb" 2 | 3 | rule '.go' => '.go.erb' do |task| 4 | erb = ERB.new(File.read(task.source)) 5 | File.write(task.name, "// Do not edit. Generated from #{task.source}\n" + erb.result(binding)) 6 | sh "goimports", "-w", task.name 7 | end 8 | 9 | generated_code_files = [ 10 | "pgtype/int.go", 11 | "pgtype/int_test.go", 12 | "pgtype/integration_benchmark_test.go", 13 | "pgtype/zeronull/int.go", 14 | "pgtype/zeronull/int_test.go" 15 | ] 16 | 17 | desc "Generate code" 18 | task generate: generated_code_files 19 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/internal/anynil/anynil.go: -------------------------------------------------------------------------------- 1 | package anynil 2 | 3 | import "reflect" 4 | 5 | // Is returns true if value is any type of nil. e.g. nil or []byte(nil). 6 | func Is(value any) bool { 7 | if value == nil { 8 | return true 9 | } 10 | 11 | refVal := reflect.ValueOf(value) 12 | switch refVal.Kind() { 13 | case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: 14 | return refVal.IsNil() 15 | default: 16 | return false 17 | } 18 | } 19 | 20 | // Normalize converts typed nils (e.g. []byte(nil)) into untyped nil. Other values are returned unmodified. 21 | func Normalize(v any) any { 22 | if Is(v) { 23 | return nil 24 | } 25 | return v 26 | } 27 | 28 | // NormalizeSlice converts all typed nils (e.g. []byte(nil)) in s into untyped nils. Other values are unmodified. s is 29 | // mutated in place. 30 | func NormalizeSlice(s []any) { 31 | for i := range s { 32 | if Is(s[i]) { 33 | s[i] = nil 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/internal/pgio/README.md: -------------------------------------------------------------------------------- 1 | # pgio 2 | 3 | Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. 4 | 5 | pgio provides functions for appending integers to a []byte while doing byte 6 | order conversion. 7 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/internal/pgio/doc.go: -------------------------------------------------------------------------------- 1 | // Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. 2 | /* 3 | pgio provides functions for appending integers to a []byte while doing byte 4 | order conversion. 5 | */ 6 | package pgio 7 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/internal/pgio/write.go: -------------------------------------------------------------------------------- 1 | package pgio 2 | 3 | import "encoding/binary" 4 | 5 | func AppendUint16(buf []byte, n uint16) []byte { 6 | wp := len(buf) 7 | buf = append(buf, 0, 0) 8 | binary.BigEndian.PutUint16(buf[wp:], n) 9 | return buf 10 | } 11 | 12 | func AppendUint32(buf []byte, n uint32) []byte { 13 | wp := len(buf) 14 | buf = append(buf, 0, 0, 0, 0) 15 | binary.BigEndian.PutUint32(buf[wp:], n) 16 | return buf 17 | } 18 | 19 | func AppendUint64(buf []byte, n uint64) []byte { 20 | wp := len(buf) 21 | buf = append(buf, 0, 0, 0, 0, 0, 0, 0, 0) 22 | binary.BigEndian.PutUint64(buf[wp:], n) 23 | return buf 24 | } 25 | 26 | func AppendInt16(buf []byte, n int16) []byte { 27 | return AppendUint16(buf, uint16(n)) 28 | } 29 | 30 | func AppendInt32(buf []byte, n int32) []byte { 31 | return AppendUint32(buf, uint32(n)) 32 | } 33 | 34 | func AppendInt64(buf []byte, n int64) []byte { 35 | return AppendUint64(buf, uint64(n)) 36 | } 37 | 38 | func SetInt32(buf []byte, n int32) { 39 | binary.BigEndian.PutUint32(buf, uint32(n)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgconn/README.md: -------------------------------------------------------------------------------- 1 | # pgconn 2 | 3 | Package pgconn is a low-level PostgreSQL database driver. It operates at nearly the same level as the C library libpq. 4 | It is primarily intended to serve as the foundation for higher level libraries such as https://github.com/jackc/pgx. 5 | Applications should handle normal queries with a higher level library and only use pgconn directly when required for 6 | low-level access to PostgreSQL functionality. 7 | 8 | ## Example Usage 9 | 10 | ```go 11 | pgConn, err := pgconn.Connect(context.Background(), os.Getenv("DATABASE_URL")) 12 | if err != nil { 13 | log.Fatalln("pgconn failed to connect:", err) 14 | } 15 | defer pgConn.Close(context.Background()) 16 | 17 | result := pgConn.ExecParams(context.Background(), "SELECT email FROM users WHERE id=$1", [][]byte{[]byte("123")}, nil, nil, nil) 18 | for result.NextRow() { 19 | fmt.Println("User 123 has email:", string(result.Values()[0])) 20 | } 21 | _, err = result.Close() 22 | if err != nil { 23 | log.Fatalln("failed reading result:", err) 24 | } 25 | ``` 26 | 27 | ## Testing 28 | 29 | See CONTRIBUTING.md for setup instructions. 30 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/README.md: -------------------------------------------------------------------------------- 1 | # pgproto3 2 | 3 | Package pgproto3 is an encoder and decoder of the PostgreSQL wire protocol version 3. 4 | 5 | pgproto3 can be used as a foundation for PostgreSQL drivers, proxies, mock servers, load balancers and more. 6 | 7 | See example/pgfortune for a playful example of a fake PostgreSQL server. 8 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/big_endian.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/binary" 5 | ) 6 | 7 | type BigEndianBuf [8]byte 8 | 9 | func (b BigEndianBuf) Int16(n int16) []byte { 10 | buf := b[0:2] 11 | binary.BigEndian.PutUint16(buf, uint16(n)) 12 | return buf 13 | } 14 | 15 | func (b BigEndianBuf) Uint16(n uint16) []byte { 16 | buf := b[0:2] 17 | binary.BigEndian.PutUint16(buf, n) 18 | return buf 19 | } 20 | 21 | func (b BigEndianBuf) Int32(n int32) []byte { 22 | buf := b[0:4] 23 | binary.BigEndian.PutUint32(buf, uint32(n)) 24 | return buf 25 | } 26 | 27 | func (b BigEndianBuf) Uint32(n uint32) []byte { 28 | buf := b[0:4] 29 | binary.BigEndian.PutUint32(buf, n) 30 | return buf 31 | } 32 | 33 | func (b BigEndianBuf) Int64(n int64) []byte { 34 | buf := b[0:8] 35 | binary.BigEndian.PutUint64(buf, uint64(n)) 36 | return buf 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/bind_complete.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type BindComplete struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*BindComplete) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *BindComplete) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "BindComplete", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *BindComplete) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, '2', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src BindComplete) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "BindComplete", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/close_complete.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type CloseComplete struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*CloseComplete) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *CloseComplete) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "CloseComplete", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *CloseComplete) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, '3', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src CloseComplete) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "CloseComplete", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/doc.go: -------------------------------------------------------------------------------- 1 | // Package pgproto3 is an encoder and decoder of the PostgreSQL wire protocol version 3. 2 | // 3 | // The primary interfaces are Frontend and Backend. They correspond to a client and server respectively. Messages are 4 | // sent with Send (or a specialized Send variant). Messages are automatically buffered to minimize small writes. Call 5 | // Flush to ensure a message has actually been sent. 6 | // 7 | // The Trace method of Frontend and Backend can be used to examine the wire-level message traffic. It outputs in a 8 | // similar format to the PQtrace function in libpq. 9 | // 10 | // See https://www.postgresql.org/docs/current/protocol-message-formats.html for meanings of the different messages. 11 | package pgproto3 12 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/empty_query_response.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type EmptyQueryResponse struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*EmptyQueryResponse) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *EmptyQueryResponse) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "EmptyQueryResponse", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *EmptyQueryResponse) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 'I', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src EmptyQueryResponse) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "EmptyQueryResponse", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/flush.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Flush struct{} 8 | 9 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 10 | func (*Flush) Frontend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *Flush) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "Flush", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *Flush) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 'H', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src Flush) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "Flush", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/gss_response.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type GSSResponse struct { 8 | Data []byte 9 | } 10 | 11 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 12 | func (g *GSSResponse) Frontend() {} 13 | 14 | func (g *GSSResponse) Decode(data []byte) error { 15 | g.Data = data 16 | return nil 17 | } 18 | 19 | func (g *GSSResponse) Encode(dst []byte) ([]byte, error) { 20 | dst, sp := beginMessage(dst, 'p') 21 | dst = append(dst, g.Data...) 22 | return finishMessage(dst, sp) 23 | } 24 | 25 | // MarshalJSON implements encoding/json.Marshaler. 26 | func (g *GSSResponse) MarshalJSON() ([]byte, error) { 27 | return json.Marshal(struct { 28 | Type string 29 | Data []byte 30 | }{ 31 | Type: "GSSResponse", 32 | Data: g.Data, 33 | }) 34 | } 35 | 36 | // UnmarshalJSON implements encoding/json.Unmarshaler. 37 | func (g *GSSResponse) UnmarshalJSON(data []byte) error { 38 | var msg struct { 39 | Data []byte 40 | } 41 | if err := json.Unmarshal(data, &msg); err != nil { 42 | return err 43 | } 44 | g.Data = msg.Data 45 | return nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/no_data.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type NoData struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*NoData) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *NoData) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "NoData", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *NoData) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 'n', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src NoData) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "NoData", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/notice_response.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | type NoticeResponse ErrorResponse 4 | 5 | // Backend identifies this message as sendable by the PostgreSQL backend. 6 | func (*NoticeResponse) Backend() {} 7 | 8 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 9 | // type identifier and 4 byte message length. 10 | func (dst *NoticeResponse) Decode(src []byte) error { 11 | return (*ErrorResponse)(dst).Decode(src) 12 | } 13 | 14 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 15 | func (src *NoticeResponse) Encode(dst []byte) ([]byte, error) { 16 | dst, sp := beginMessage(dst, 'N') 17 | dst = (*ErrorResponse)(src).appendFields(dst) 18 | return finishMessage(dst, sp) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/parse_complete.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type ParseComplete struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*ParseComplete) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *ParseComplete) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "ParseComplete", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *ParseComplete) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, '1', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src ParseComplete) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "ParseComplete", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/portal_suspended.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type PortalSuspended struct{} 8 | 9 | // Backend identifies this message as sendable by the PostgreSQL backend. 10 | func (*PortalSuspended) Backend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *PortalSuspended) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "PortalSuspended", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *PortalSuspended) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 's', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src PortalSuspended) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "PortalSuspended", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/sync.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Sync struct{} 8 | 9 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 10 | func (*Sync) Frontend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *Sync) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "Sync", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *Sync) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 'S', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src Sync) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "Sync", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgproto3/terminate.go: -------------------------------------------------------------------------------- 1 | package pgproto3 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type Terminate struct{} 8 | 9 | // Frontend identifies this message as sendable by a PostgreSQL frontend. 10 | func (*Terminate) Frontend() {} 11 | 12 | // Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message 13 | // type identifier and 4 byte message length. 14 | func (dst *Terminate) Decode(src []byte) error { 15 | if len(src) != 0 { 16 | return &invalidMessageLenErr{messageType: "Terminate", expectedLen: 0, actualLen: len(src)} 17 | } 18 | 19 | return nil 20 | } 21 | 22 | // Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length. 23 | func (src *Terminate) Encode(dst []byte) ([]byte, error) { 24 | return append(dst, 'X', 0, 0, 0, 4), nil 25 | } 26 | 27 | // MarshalJSON implements encoding/json.Marshaler. 28 | func (src Terminate) MarshalJSON() ([]byte, error) { 29 | return json.Marshal(struct { 30 | Type string 31 | }{ 32 | Type: "Terminate", 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgtype/integration_benchmark_test_gen.sh: -------------------------------------------------------------------------------- 1 | erb integration_benchmark_test.go.erb > integration_benchmark_test.go 2 | goimports -w integration_benchmark_test.go 3 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgtype/register_default_pg_types_disabled.go: -------------------------------------------------------------------------------- 1 | //go:build nopgxregisterdefaulttypes 2 | 3 | package pgtype 4 | 5 | func registerDefaultPgTypeVariants[T any](m *Map, name string) { 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgtype/text_format_only_codec.go: -------------------------------------------------------------------------------- 1 | package pgtype 2 | 3 | type TextFormatOnlyCodec struct { 4 | Codec 5 | } 6 | 7 | func (c *TextFormatOnlyCodec) FormatSupported(format int16) bool { 8 | return format == TextFormatCode && c.Codec.FormatSupported(format) 9 | } 10 | 11 | func (TextFormatOnlyCodec) PreferredFormat() int16 { 12 | return TextFormatCode 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgxpool/batch_results.go: -------------------------------------------------------------------------------- 1 | package pgxpool 2 | 3 | import ( 4 | "github.com/jackc/pgx/v5" 5 | "github.com/jackc/pgx/v5/pgconn" 6 | ) 7 | 8 | type errBatchResults struct { 9 | err error 10 | } 11 | 12 | func (br errBatchResults) Exec() (pgconn.CommandTag, error) { 13 | return pgconn.CommandTag{}, br.err 14 | } 15 | 16 | func (br errBatchResults) Query() (pgx.Rows, error) { 17 | return errRows{err: br.err}, br.err 18 | } 19 | 20 | func (br errBatchResults) QueryRow() pgx.Row { 21 | return errRow{err: br.err} 22 | } 23 | 24 | func (br errBatchResults) Close() error { 25 | return br.err 26 | } 27 | 28 | type poolBatchResults struct { 29 | br pgx.BatchResults 30 | c *Conn 31 | } 32 | 33 | func (br *poolBatchResults) Exec() (pgconn.CommandTag, error) { 34 | return br.br.Exec() 35 | } 36 | 37 | func (br *poolBatchResults) Query() (pgx.Rows, error) { 38 | return br.br.Query() 39 | } 40 | 41 | func (br *poolBatchResults) QueryRow() pgx.Row { 42 | return br.br.QueryRow() 43 | } 44 | 45 | func (br *poolBatchResults) Close() error { 46 | err := br.br.Close() 47 | if br.c != nil { 48 | br.c.Release() 49 | br.c = nil 50 | } 51 | return err 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/pgx/v5/pgxpool/doc.go: -------------------------------------------------------------------------------- 1 | // Package pgxpool is a concurrency-safe connection pool for pgx. 2 | /* 3 | pgxpool implements a nearly identical interface to pgx connections. 4 | 5 | Creating a Pool 6 | 7 | The primary way of creating a pool is with [pgxpool.New]: 8 | 9 | pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL")) 10 | 11 | The database connection string can be in URL or DSN format. PostgreSQL settings, pgx settings, and pool settings can be 12 | specified here. In addition, a config struct can be created by [ParseConfig]. 13 | 14 | config, err := pgxpool.ParseConfig(os.Getenv("DATABASE_URL")) 15 | if err != nil { 16 | // ... 17 | } 18 | config.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error { 19 | // do something with every new connection 20 | } 21 | 22 | pool, err := pgxpool.NewWithConfig(context.Background(), config) 23 | 24 | A pool returns without waiting for any connections to be established. Acquire a connection immediately after creating 25 | the pool to check if a connection can successfully be established. 26 | */ 27 | package pgxpool 28 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Jack Christensen 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/context.go: -------------------------------------------------------------------------------- 1 | package puddle 2 | 3 | import ( 4 | "context" 5 | "time" 6 | ) 7 | 8 | // valueCancelCtx combines two contexts into one. One context is used for values and the other is used for cancellation. 9 | type valueCancelCtx struct { 10 | valueCtx context.Context 11 | cancelCtx context.Context 12 | } 13 | 14 | func (ctx *valueCancelCtx) Deadline() (time.Time, bool) { return ctx.cancelCtx.Deadline() } 15 | func (ctx *valueCancelCtx) Done() <-chan struct{} { return ctx.cancelCtx.Done() } 16 | func (ctx *valueCancelCtx) Err() error { return ctx.cancelCtx.Err() } 17 | func (ctx *valueCancelCtx) Value(key any) any { return ctx.valueCtx.Value(key) } 18 | 19 | func newValueCancelCtx(valueCtx, cancelContext context.Context) context.Context { 20 | return &valueCancelCtx{ 21 | valueCtx: valueCtx, 22 | cancelCtx: cancelContext, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/doc.go: -------------------------------------------------------------------------------- 1 | // Package puddle is a generic resource pool with type-parametrized api. 2 | /* 3 | 4 | Puddle is a tiny generic resource pool library for Go that uses the standard 5 | context library to signal cancellation of acquires. It is designed to contain 6 | the minimum functionality a resource pool needs that cannot be implemented 7 | without concurrency concerns. For example, a database connection pool may use 8 | puddle internally and implement health checks and keep-alive behavior without 9 | needing to implement any concurrent code of its own. 10 | */ 11 | package puddle 12 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/internal/genstack/stack.go: -------------------------------------------------------------------------------- 1 | package genstack 2 | 3 | // stack is a wrapper around an array implementing a stack. 4 | // 5 | // We cannot use slice to represent the stack because append might change the 6 | // pointer value of the slice. That would be an issue in GenStack 7 | // implementation. 8 | type stack[T any] struct { 9 | arr []T 10 | } 11 | 12 | // push pushes a new element at the top of a stack. 13 | func (s *stack[T]) push(vs ...T) { s.arr = append(s.arr, vs...) } 14 | 15 | // pop pops the stack top-most element. 16 | // 17 | // If stack length is zero, this method panics. 18 | func (s *stack[T]) pop() T { 19 | idx := s.len() - 1 20 | val := s.arr[idx] 21 | 22 | // Avoid memory leak 23 | var zero T 24 | s.arr[idx] = zero 25 | 26 | s.arr = s.arr[:idx] 27 | return val 28 | } 29 | 30 | // takeAll returns all elements in the stack in order as they are stored - i.e. 31 | // the top-most stack element is the last one. 32 | func (s *stack[T]) takeAll() []T { 33 | arr := s.arr 34 | s.arr = nil 35 | return arr 36 | } 37 | 38 | // len returns number of elements in the stack. 39 | func (s *stack[T]) len() int { return len(s.arr) } 40 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/log.go: -------------------------------------------------------------------------------- 1 | package puddle 2 | 3 | import "unsafe" 4 | 5 | type ints interface { 6 | int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 7 | } 8 | 9 | // log2Int returns log2 of an integer. This function panics if val < 0. For val 10 | // == 0, returns 0. 11 | func log2Int[T ints](val T) uint8 { 12 | if val <= 0 { 13 | panic("log2 of non-positive number does not exist") 14 | } 15 | 16 | return log2IntRange(val, 0, uint8(8*unsafe.Sizeof(val))) 17 | } 18 | 19 | func log2IntRange[T ints](val T, begin, end uint8) uint8 { 20 | length := end - begin 21 | if length == 1 { 22 | return begin 23 | } 24 | 25 | delim := begin + length/2 26 | mask := T(1) << delim 27 | if mask > val { 28 | return log2IntRange(val, begin, delim) 29 | } else { 30 | return log2IntRange(val, delim, end) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/nanotime_time.go: -------------------------------------------------------------------------------- 1 | //go:build purego || appengine || js 2 | 3 | // This file contains the safe implementation of nanotime using time.Now(). 4 | 5 | package puddle 6 | 7 | import ( 8 | "time" 9 | ) 10 | 11 | func nanotime() int64 { 12 | return time.Now().UnixNano() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/nanotime_unsafe.go: -------------------------------------------------------------------------------- 1 | //go:build !purego && !appengine && !js 2 | 3 | // This file contains the implementation of nanotime using runtime.nanotime. 4 | 5 | package puddle 6 | 7 | import "unsafe" 8 | 9 | var _ = unsafe.Sizeof(0) 10 | 11 | //go:linkname nanotime runtime.nanotime 12 | func nanotime() int64 13 | -------------------------------------------------------------------------------- /vendor/github.com/jackc/puddle/v2/resource_list.go: -------------------------------------------------------------------------------- 1 | package puddle 2 | 3 | type resList[T any] []*Resource[T] 4 | 5 | func (l *resList[T]) append(val *Resource[T]) { *l = append(*l, val) } 6 | 7 | func (l *resList[T]) popBack() *Resource[T] { 8 | idx := len(*l) - 1 9 | val := (*l)[idx] 10 | (*l)[idx] = nil // Avoid memory leak 11 | *l = (*l)[:idx] 12 | 13 | return val 14 | } 15 | 16 | func (l *resList[T]) remove(val *Resource[T]) { 17 | for i, elem := range *l { 18 | if elem == val { 19 | lastIdx := len(*l) - 1 20 | (*l)[i] = (*l)[lastIdx] 21 | (*l)[lastIdx] = nil // Avoid memory leak 22 | (*l) = (*l)[:lastIdx] 23 | return 24 | } 25 | } 26 | 27 | panic("BUG: removeResource could not find res in slice") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/.gitignore: -------------------------------------------------------------------------------- 1 | documents 2 | coverage.txt 3 | _book 4 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/README.md: -------------------------------------------------------------------------------- 1 | # GORM 2 | 3 | GORM V2 moved to https://github.com/go-gorm/gorm 4 | 5 | GORM V1 Doc https://v1.gorm.io/ 6 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/callback_row_query.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | ) 7 | 8 | // Define callbacks for row query 9 | func init() { 10 | DefaultCallback.RowQuery().Register("gorm:row_query", rowQueryCallback) 11 | } 12 | 13 | type RowQueryResult struct { 14 | Row *sql.Row 15 | } 16 | 17 | type RowsQueryResult struct { 18 | Rows *sql.Rows 19 | Error error 20 | } 21 | 22 | // queryCallback used to query data from database 23 | func rowQueryCallback(scope *Scope) { 24 | if result, ok := scope.InstanceGet("row_query_result"); ok { 25 | scope.prepareQuerySQL() 26 | 27 | if str, ok := scope.Get("gorm:query_hint"); ok { 28 | scope.SQL = fmt.Sprint(str) + scope.SQL 29 | } 30 | 31 | if str, ok := scope.Get("gorm:query_option"); ok { 32 | scope.SQL += addExtraSpaceIfExist(fmt.Sprint(str)) 33 | } 34 | 35 | if rowResult, ok := result.(*RowQueryResult); ok { 36 | rowResult.Row = scope.SQLDB().QueryRow(scope.SQL, scope.SQLVars...) 37 | } else if rowsResult, ok := result.(*RowsQueryResult); ok { 38 | rowsResult.Rows, rowsResult.Error = scope.SQLDB().Query(scope.SQL, scope.SQLVars...) 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | mysql: 5 | image: 'mysql:latest' 6 | ports: 7 | - 9910:3306 8 | environment: 9 | - MYSQL_DATABASE=gorm 10 | - MYSQL_USER=gorm 11 | - MYSQL_PASSWORD=gorm 12 | - MYSQL_RANDOM_ROOT_PASSWORD="yes" 13 | postgres: 14 | image: 'postgres:latest' 15 | ports: 16 | - 9920:5432 17 | environment: 18 | - POSTGRES_USER=gorm 19 | - POSTGRES_DB=gorm 20 | - POSTGRES_PASSWORD=gorm 21 | mssql: 22 | image: 'mcmoe/mssqldocker:latest' 23 | ports: 24 | - 9930:1433 25 | environment: 26 | - ACCEPT_EULA=Y 27 | - SA_PASSWORD=LoremIpsum86 28 | - MSSQL_DB=gorm 29 | - MSSQL_USER=gorm 30 | - MSSQL_PASSWORD=LoremIpsum86 31 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/interface.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | ) 7 | 8 | // SQLCommon is the minimal database connection functionality gorm requires. Implemented by *sql.DB. 9 | type SQLCommon interface { 10 | Exec(query string, args ...interface{}) (sql.Result, error) 11 | Prepare(query string) (*sql.Stmt, error) 12 | Query(query string, args ...interface{}) (*sql.Rows, error) 13 | QueryRow(query string, args ...interface{}) *sql.Row 14 | } 15 | 16 | type sqlDb interface { 17 | Begin() (*sql.Tx, error) 18 | BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) 19 | } 20 | 21 | type sqlTx interface { 22 | Commit() error 23 | Rollback() error 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/model.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "time" 4 | 5 | // Model base model definition, including fields `ID`, `CreatedAt`, `UpdatedAt`, `DeletedAt`, which could be embedded in your models 6 | // type User struct { 7 | // gorm.Model 8 | // } 9 | type Model struct { 10 | ID uint `gorm:"primary_key"` 11 | CreatedAt time.Time 12 | UpdatedAt time.Time 13 | DeletedAt *time.Time `sql:"index"` 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/gorm/test_all.sh: -------------------------------------------------------------------------------- 1 | dialects=("postgres" "mysql" "mssql" "sqlite") 2 | 3 | for dialect in "${dialects[@]}" ; do 4 | DEBUG=false GORM_DIALECT=${dialect} go test 5 | done 6 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 - Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/inflection/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | 3 | build: 4 | steps: 5 | - setup-go-workspace 6 | 7 | # Gets the dependencies 8 | - script: 9 | name: go get 10 | code: | 11 | go get 12 | 13 | # Build the project 14 | - script: 15 | name: go build 16 | code: | 17 | go build ./... 18 | 19 | # Test the project 20 | - script: 21 | name: go test 22 | code: | 23 | go test ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/now/Guardfile: -------------------------------------------------------------------------------- 1 | guard 'gotest' do 2 | watch(%r{\.go$}) 3 | end 4 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/now/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/now/time.go: -------------------------------------------------------------------------------- 1 | package now 2 | 3 | import "time" 4 | 5 | func formatTimeToList(t time.Time) []int { 6 | hour, min, sec := t.Clock() 7 | year, month, day := t.Date() 8 | return []int{t.Nanosecond(), sec, min, hour, day, int(month), year} 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig coding styles definitions. For more information about the 2 | # properties used in this file, please see the EditorConfig documentation: 3 | # http://editorconfig.org/ 4 | 5 | # indicate this is the root of the project 6 | root = true 7 | 8 | [*] 9 | charset = utf-8 10 | 11 | end_of_line = LF 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [Makefile] 19 | indent_style = tab 20 | 21 | [*.md] 22 | trim_trailing_whitespace = false 23 | 24 | [*.go] 25 | indent_style = tab 26 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on checking and 6 | # prevent conversion to CRLF when they are checked out (this is required in 7 | # order to prevent newline related issues) 8 | .* text eol=lf 9 | *.go text eol=lf 10 | *.yml text eol=lf 11 | *.html text eol=lf 12 | *.css text eol=lf 13 | *.js text eol=lf 14 | *.json text eol=lf 15 | LICENSE text eol=lf 16 | 17 | # Exclude `website` and `cookbook` from GitHub's language statistics 18 | # https://github.com/github/linguist#using-gitattributes 19 | cookbook/* linguist-documentation 20 | website/* linguist-documentation 21 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | coverage.txt 3 | _test 4 | vendor 5 | .idea 6 | *.iml 7 | *.out 8 | .vscode 9 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2021 LabStack 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/labstack/echo/v4/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 1% 6 | patch: 7 | default: 8 | threshold: 1% 9 | 10 | comment: 11 | require_changes: true -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/log.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors 3 | 4 | package echo 5 | 6 | import ( 7 | "github.com/labstack/gommon/log" 8 | "io" 9 | ) 10 | 11 | // Logger defines the logging interface. 12 | type Logger interface { 13 | Output() io.Writer 14 | SetOutput(w io.Writer) 15 | Prefix() string 16 | SetPrefix(p string) 17 | Level() log.Lvl 18 | SetLevel(v log.Lvl) 19 | SetHeader(h string) 20 | Print(i ...interface{}) 21 | Printf(format string, args ...interface{}) 22 | Printj(j log.JSON) 23 | Debug(i ...interface{}) 24 | Debugf(format string, args ...interface{}) 25 | Debugj(j log.JSON) 26 | Info(i ...interface{}) 27 | Infof(format string, args ...interface{}) 28 | Infoj(j log.JSON) 29 | Warn(i ...interface{}) 30 | Warnf(format string, args ...interface{}) 31 | Warnj(j log.JSON) 32 | Error(i ...interface{}) 33 | Errorf(format string, args ...interface{}) 34 | Errorj(j log.JSON) 35 | Fatal(i ...interface{}) 36 | Fatalj(j log.JSON) 37 | Fatalf(format string, args ...interface{}) 38 | Panic(i ...interface{}) 39 | Panicj(j log.JSON) 40 | Panicf(format string, args ...interface{}) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/middleware/static_other.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors 3 | 4 | //go:build !windows 5 | 6 | package middleware 7 | 8 | import ( 9 | "os" 10 | ) 11 | 12 | // We ignore these errors as there could be handler that matches request path. 13 | func isIgnorableOpenFileError(err error) bool { 14 | return os.IsNotExist(err) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/echo/v4/renderer.go: -------------------------------------------------------------------------------- 1 | package echo 2 | 3 | import "io" 4 | 5 | // Renderer is the interface that wraps the Render function. 6 | type Renderer interface { 7 | Render(io.Writer, string, interface{}, Context) error 8 | } 9 | 10 | // TemplateRenderer is helper to ease creating renderers for `html/template` and `text/template` packages. 11 | // Example usage: 12 | // 13 | // e.Renderer = &echo.TemplateRenderer{ 14 | // Template: template.Must(template.ParseGlob("templates/*.html")), 15 | // } 16 | // 17 | // e.Renderer = &echo.TemplateRenderer{ 18 | // Template: template.Must(template.New("hello").Parse("Hello, {{.}}!")), 19 | // } 20 | type TemplateRenderer struct { 21 | Template interface { 22 | ExecuteTemplate(wr io.Writer, name string, data any) error 23 | } 24 | } 25 | 26 | // Render renders the template with given data. 27 | func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c Context) error { 28 | return t.Template.ExecuteTemplate(w, name, data) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 labstack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/bytes/README.md: -------------------------------------------------------------------------------- 1 | # Bytes 2 | 3 | - Format bytes integer to human readable bytes string. 4 | - Parse human readable bytes string to bytes integer. 5 | 6 | ## Installation 7 | 8 | ```go 9 | go get github.com/labstack/gommon/bytes 10 | ``` 11 | 12 | ## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go) 13 | 14 | ### Format 15 | 16 | ```go 17 | println(bytes.Format(13231323)) 18 | ``` 19 | 20 | `12.62MB` 21 | 22 | ### Parse 23 | 24 | ```go 25 | b, _ = Parse("2M") 26 | println(b) 27 | ``` 28 | 29 | `2097152` 30 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/log/README.md: -------------------------------------------------------------------------------- 1 | ## WORK IN PROGRESS 2 | 3 | ### Usage 4 | 5 | [log_test.go](log_test.go) 6 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/log/color.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package log 4 | 5 | import ( 6 | "io" 7 | 8 | "github.com/mattn/go-colorable" 9 | ) 10 | 11 | func output() io.Writer { 12 | return colorable.NewColorableStdout() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/labstack/gommon/log/white.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package log 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func output() io.Writer { 11 | return os.Stdout 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /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/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/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 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/mattn/go-colorable/colorable_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !appengine 2 | // +build !windows,!appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: off 4 | patch: off 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.exe 3 | *.dll 4 | *.o 5 | 6 | # VSCode 7 | .vscode 8 | 9 | # Exclude from upgrade 10 | upgrade/*.c 11 | upgrade/*.h 12 | 13 | # Exclude upgrade binary 14 | upgrade/upgrade 15 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Yasuhiro Matsumoto 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/mattn/go-sqlite3/sqlite3_libsqlite3.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build libsqlite3 7 | // +build libsqlite3 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DUSE_LIBSQLITE3 13 | #cgo linux LDFLAGS: -lsqlite3 14 | #cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/sqlite/lib -lsqlite3 15 | #cgo darwin,amd64 CFLAGS: -I/usr/local/opt/sqlite/include 16 | #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/sqlite/lib -lsqlite3 17 | #cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/sqlite/include 18 | #cgo openbsd LDFLAGS: -lsqlite3 19 | #cgo solaris LDFLAGS: -lsqlite3 20 | #cgo windows LDFLAGS: -lsqlite3 21 | */ 22 | import "C" 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_load_extension_omit.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_omit_load_extension 7 | // +build sqlite_omit_load_extension 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_OMIT_LOAD_EXTENSION 13 | */ 14 | import "C" 15 | import ( 16 | "errors" 17 | ) 18 | 19 | func (c *SQLiteConn) loadExtensions(extensions []string) error { 20 | return errors.New("Extensions have been disabled for static builds") 21 | } 22 | 23 | func (c *SQLiteConn) LoadExtension(lib string, entry string) error { 24 | return errors.New("Extensions have been disabled for static builds") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_allow_uri_authority.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_allow_uri_authority 8 | // +build sqlite_allow_uri_authority 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_ALLOW_URI_AUTHORITY 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_app_armor.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build !windows && sqlite_app_armor 8 | // +build !windows,sqlite_app_armor 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_ENABLE_API_ARMOR 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_column_metadata.go: -------------------------------------------------------------------------------- 1 | //go:build sqlite_column_metadata 2 | // +build sqlite_column_metadata 3 | 4 | package sqlite3 5 | 6 | /* 7 | #ifndef USE_LIBSQLITE3 8 | #cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA 9 | #include 10 | #else 11 | #include 12 | #endif 13 | */ 14 | import "C" 15 | 16 | // ColumnTableName returns the table that is the origin of a particular result 17 | // column in a SELECT statement. 18 | // 19 | // See https://www.sqlite.org/c3ref/column_database_name.html 20 | func (s *SQLiteStmt) ColumnTableName(n int) string { 21 | return C.GoString(C.sqlite3_column_table_name(s.s, C.int(n))) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_foreign_keys.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_foreign_keys 8 | // +build sqlite_foreign_keys 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_DEFAULT_FOREIGN_KEYS=1 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_fts5.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_fts5 || fts5 7 | // +build sqlite_fts5 fts5 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_ENABLE_FTS5 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_icu.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_icu || icu 7 | // +build sqlite_icu icu 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo LDFLAGS: -licuuc -licui18n 13 | #cgo CFLAGS: -DSQLITE_ENABLE_ICU 14 | #cgo darwin,amd64 CFLAGS: -I/usr/local/opt/icu4c/include 15 | #cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/icu4c/lib 16 | #cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/icu4c/include 17 | #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/icu4c/lib 18 | #cgo openbsd LDFLAGS: -lsqlite3 19 | */ 20 | import "C" 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_introspect.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_introspect 8 | // +build sqlite_introspect 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_INTROSPECTION_PRAGMAS 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_math_functions.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_math_functions 7 | // +build sqlite_math_functions 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_ENABLE_MATH_FUNCTIONS 13 | #cgo LDFLAGS: -lm 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_os_trace.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build sqlite_os_trace 7 | // +build sqlite_os_trace 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -DSQLITE_FORCE_OS_TRACE=1 13 | #cgo CFLAGS: -DSQLITE_DEBUG_OS_TRACE=1 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 G.J.R. Timmer . 2 | // Copyright (C) 2018 segment.com 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build cgo 8 | // +build cgo 9 | 10 | package sqlite3 11 | 12 | // SQLitePreUpdateData represents all of the data available during a 13 | // pre-update hook call. 14 | type SQLitePreUpdateData struct { 15 | Conn *SQLiteConn 16 | Op int 17 | DatabaseName string 18 | TableName string 19 | OldRowID int64 20 | NewRowID int64 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate_omit.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 G.J.R. Timmer . 2 | // Copyright (C) 2018 segment.com 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build !sqlite_preupdate_hook && cgo 8 | // +build !sqlite_preupdate_hook,cgo 9 | 10 | package sqlite3 11 | 12 | // RegisterPreUpdateHook sets the pre-update hook for a connection. 13 | // 14 | // The callback is passed a SQLitePreUpdateData struct with the data for 15 | // the update, as well as methods for fetching copies of impacted data. 16 | // 17 | // If there is an existing preupdate hook for this connection, it will be 18 | // removed. If callback is nil the existing hook (if any) will be removed 19 | // without creating a new one. 20 | func (c *SQLiteConn) RegisterPreUpdateHook(callback func(SQLitePreUpdateData)) { 21 | // NOOP 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_secure_delete 8 | // +build sqlite_secure_delete 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_SECURE_DELETE=1 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete_fast.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_secure_delete_fast 8 | // +build sqlite_secure_delete_fast 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_SECURE_DELETE=FAST 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_serialize_omit.go: -------------------------------------------------------------------------------- 1 | //go:build libsqlite3 && !sqlite_serialize 2 | // +build libsqlite3,!sqlite_serialize 3 | 4 | package sqlite3 5 | 6 | import ( 7 | "errors" 8 | ) 9 | 10 | /* 11 | #cgo CFLAGS: -DSQLITE_OMIT_DESERIALIZE 12 | */ 13 | import "C" 14 | 15 | func (c *SQLiteConn) Serialize(schema string) ([]byte, error) { 16 | return nil, errors.New("sqlite3: Serialize requires the sqlite_serialize build tag when using the libsqlite3 build tag") 17 | } 18 | 19 | func (c *SQLiteConn) Deserialize(b []byte, schema string) error { 20 | return errors.New("sqlite3: Deserialize requires the sqlite_serialize build tag when using the libsqlite3 build tag") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_stat4.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_stat4 8 | // +build sqlite_stat4 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_ENABLE_STAT4 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_full.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_vacuum_full 8 | // +build sqlite_vacuum_full 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_DEFAULT_AUTOVACUUM=1 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_incr.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // Copyright (C) 2018 G.J.R. Timmer . 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build sqlite_vacuum_incr 8 | // +build sqlite_vacuum_incr 9 | 10 | package sqlite3 11 | 12 | /* 13 | #cgo CFLAGS: -DSQLITE_DEFAULT_AUTOVACUUM=2 14 | #cgo LDFLAGS: -lm 15 | */ 16 | import "C" 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build !windows 7 | // +build !windows 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -I. 13 | #cgo linux LDFLAGS: -ldl 14 | #cgo linux,ppc LDFLAGS: -lpthread 15 | #cgo linux,ppc64 LDFLAGS: -lpthread 16 | #cgo linux,ppc64le LDFLAGS: -lpthread 17 | */ 18 | import "C" 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build solaris 7 | // +build solaris 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -D__EXTENSIONS__=1 13 | #cgo LDFLAGS: -lc 14 | */ 15 | import "C" 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Yasuhiro Matsumoto . 2 | // 3 | // Use of this source code is governed by an MIT-style 4 | // license that can be found in the LICENSE file. 5 | 6 | //go:build windows 7 | // +build windows 8 | 9 | package sqlite3 10 | 11 | /* 12 | #cgo CFLAGS: -I. 13 | #cgo CFLAGS: -fno-stack-check 14 | #cgo CFLAGS: -fno-stack-protector 15 | #cgo CFLAGS: -mno-stack-arg-probe 16 | #cgo windows,386 CFLAGS: -D_USE_32BIT_TIME_T 17 | */ 18 | import "C" 19 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.codeclimate.yml: -------------------------------------------------------------------------------- 1 | engines: 2 | gofmt: 3 | enabled: true 4 | golint: 5 | enabled: true 6 | govet: 7 | enabled: true 8 | 9 | exclude_patterns: 10 | - ".github/" 11 | - "vendor/" 12 | - "codegen/" 13 | - "*.yml" 14 | - ".*.yml" 15 | - "*.md" 16 | - "Gopkg.*" 17 | - "doc.go" 18 | - "type_specific_codegen_test.go" 19 | - "type_specific_codegen.go" 20 | - ".gitignore" 21 | - "LICENSE" 22 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/Taskfile.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | tasks: 4 | default: 5 | deps: [test] 6 | 7 | lint: 8 | desc: Checks code style 9 | cmds: 10 | - gofmt -d -s *.go 11 | - go vet ./... 12 | silent: true 13 | 14 | lint-fix: 15 | desc: Fixes code style 16 | cmds: 17 | - gofmt -w -s *.go 18 | 19 | test: 20 | desc: Runs go tests 21 | cmds: 22 | - go test -race ./... 23 | 24 | test-coverage: 25 | desc: Runs go tests and calculates test coverage 26 | cmds: 27 | - go test -race -coverprofile=c.out ./... 28 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security key 9 | func HashWithKey(data, key string) string { 10 | d := sha1.Sum([]byte(data + ":" + key)) 11 | return hex.EncodeToString(d[:]) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 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/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go: -------------------------------------------------------------------------------- 1 | //go:build testify_yaml_custom && !testify_yaml_fail && !testify_yaml_default 2 | // +build testify_yaml_custom,!testify_yaml_fail,!testify_yaml_default 3 | 4 | // Package yaml is an implementation of YAML functions that calls a pluggable implementation. 5 | // 6 | // This implementation is selected with the testify_yaml_custom build tag. 7 | // 8 | // go test -tags testify_yaml_custom 9 | // 10 | // This implementation can be used at build time to replace the default implementation 11 | // to avoid linking with [gopkg.in/yaml.v3]. 12 | // 13 | // In your test package: 14 | // 15 | // import assertYaml "github.com/stretchr/testify/assert/yaml" 16 | // 17 | // func init() { 18 | // assertYaml.Unmarshal = func (in []byte, out interface{}) error { 19 | // // ... 20 | // return nil 21 | // } 22 | // } 23 | package yaml 24 | 25 | var Unmarshal func(in []byte, out interface{}) error 26 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go: -------------------------------------------------------------------------------- 1 | //go:build testify_yaml_fail && !testify_yaml_custom && !testify_yaml_default 2 | // +build testify_yaml_fail,!testify_yaml_custom,!testify_yaml_default 3 | 4 | // Package yaml is an implementation of YAML functions that always fail. 5 | // 6 | // This implementation can be used at build time to replace the default implementation 7 | // to avoid linking with [gopkg.in/yaml.v3]: 8 | // 9 | // go test -tags testify_yaml_fail 10 | package yaml 11 | 12 | import "errors" 13 | 14 | var errNotImplemented = errors.New("YAML functions are not available (see https://pkg.go.dev/github.com/stretchr/testify/assert/yaml)") 15 | 16 | func Unmarshal([]byte, interface{}) error { 17 | return errNotImplemented 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | 6 | script: 7 | # build test for supported platforms 8 | - GOOS=linux go build 9 | - GOOS=darwin go build 10 | - GOOS=freebsd go build 11 | - GOOS=windows go build 12 | - GOARCH=386 go build 13 | 14 | # run tests on a standard platform 15 | - go test -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/valyala/bytebufferpool.svg)](https://travis-ci.org/valyala/bytebufferpool) 2 | [![GoDoc](https://godoc.org/github.com/valyala/bytebufferpool?status.svg)](http://godoc.org/github.com/valyala/bytebufferpool) 3 | [![Go Report](http://goreportcard.com/badge/valyala/bytebufferpool)](http://goreportcard.com/report/valyala/bytebufferpool) 4 | 5 | # bytebufferpool 6 | 7 | An implementation of a pool of byte buffers with anti-memory-waste protection. 8 | 9 | The pool may waste limited amount of memory due to fragmentation. 10 | This amount equals to the maximum total size of the byte buffers 11 | in concurrent use. 12 | 13 | # Benchmark results 14 | Currently bytebufferpool is fastest and most effective buffer pool written in Go. 15 | 16 | You can find results [here](https://omgnull.github.io/go-benchmark/buffer/). 17 | 18 | # bytebufferpool users 19 | 20 | * [fasthttp](https://github.com/valyala/fasthttp) 21 | * [quicktemplate](https://github.com/valyala/quicktemplate) 22 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/bytebufferpool/doc.go: -------------------------------------------------------------------------------- 1 | // Package bytebufferpool implements a pool of byte buffers 2 | // with anti-fragmentation protection. 3 | // 4 | // The pool may waste limited amount of memory due to fragmentation. 5 | // This amount equals to the maximum total size of the byte buffers 6 | // in concurrent use. 7 | package bytebufferpool 8 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasttemplate/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Aliaksandr Valialkin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasttemplate/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package fasttemplate 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | func unsafeBytes2String(b []byte) string { 11 | return *(*string)(unsafe.Pointer(&b)) 12 | } 13 | 14 | func unsafeString2Bytes(s string) (b []byte) { 15 | sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) 16 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 17 | bh.Data = sh.Data 18 | bh.Cap = sh.Len 19 | bh.Len = sh.Len 20 | return b 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fasttemplate/unsafe_gae.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package fasttemplate 4 | 5 | func unsafeBytes2String(b []byte) string { 6 | return string(b) 7 | } 8 | 9 | func unsafeString2Bytes(s string) []byte { 10 | return []byte(s) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | h2i/h2i 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/config_pre_go124.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | //go:build !go1.24 6 | 7 | package http2 8 | 9 | import "net/http" 10 | 11 | // Pre-Go 1.24 fallback. 12 | // The Server.HTTP2 and Transport.HTTP2 config fields were added in Go 1.24. 13 | 14 | func fillNetHTTPServerConfig(conf *http2Config, srv *http.Server) {} 15 | 16 | func fillNetHTTPTransportConfig(conf *http2Config, tr *http.Transport) {} 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/timer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | package http2 5 | 6 | import "time" 7 | 8 | // A timer is a time.Timer, as an interface which can be replaced in tests. 9 | type timer = interface { 10 | C() <-chan time.Time 11 | Reset(d time.Duration) bool 12 | Stop() bool 13 | } 14 | 15 | // timeTimer adapts a time.Timer to the timer interface. 16 | type timeTimer struct { 17 | *time.Timer 18 | } 19 | 20 | func (t timeTimer) C() <-chan time.Time { return t.Timer.C } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/idna/go118.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | // Copyright 2021 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build go1.18 8 | 9 | package idna 10 | 11 | // Transitional processing is disabled by default in Go 1.18. 12 | // https://golang.org/issue/47510 13 | const transitionalLookup = false 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/idna/pre_go118.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | // Copyright 2021 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build !go1.18 8 | 9 | package idna 10 | 11 | const transitionalLookup = true 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/idna/trie12.0.0.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | // Copyright 2016 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build !go1.16 8 | 9 | package idna 10 | 11 | // appendMapping appends the mapping for the respective rune. isMapped must be 12 | // true. A mapping is a categorization of a rune as defined in UTS #46. 13 | func (c info) appendMapping(b []byte, s string) []byte { 14 | index := int(c >> indexShift) 15 | if c&xorBit == 0 { 16 | s := mappings[index:] 17 | return append(b, s[1:s[0]+1]...) 18 | } 19 | b = append(b, s...) 20 | if c&inlineXOR == inlineXOR { 21 | // TODO: support and handle two-byte inline masks 22 | b[len(b)-1] ^= byte(index) 23 | } else { 24 | for p := len(b) - int(xorData[index]); p < len(b); p++ { 25 | index++ 26 | b[p] ^= xorData[index] 27 | } 28 | } 29 | return b 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/idna/trie13.0.0.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | // Copyright 2016 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | //go:build go1.16 8 | 9 | package idna 10 | 11 | // appendMapping appends the mapping for the respective rune. isMapped must be 12 | // true. A mapping is a categorization of a rune as defined in UTS #46. 13 | func (c info) appendMapping(b []byte, s string) []byte { 14 | index := int(c >> indexShift) 15 | if c&xorBit == 0 { 16 | p := index 17 | return append(b, mappings[mappingIndex[p]:mappingIndex[p+1]]...) 18 | } 19 | b = append(b, s...) 20 | if c&inlineXOR == inlineXOR { 21 | // TODO: support and handle two-byte inline masks 22 | b[len(b)-1] ^= byte(index) 23 | } else { 24 | for p := len(b) - int(xorData[index]); p < len(b); p++ { 25 | index++ 26 | b[p] ^= xorData[index] 27 | } 28 | } 29 | return b 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 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 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 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 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.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 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.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 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.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 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.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 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.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 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.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 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 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 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.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 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.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 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.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 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.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 | //go:build linux && gccgo && 386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.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 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 | //go:build 386 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 | //go:build amd64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.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 | //go:build arm && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 | //go:build amd64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.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 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.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 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 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 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /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/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/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/secure/bidirule/bidirule10.0.0.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 | //go:build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.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 | //go:build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/doc.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 precis contains types and functions for the preparation, 6 | // enforcement, and comparison of internationalized strings ("PRECIS") as 7 | // defined in RFC 8264. It also contains several pre-defined profiles for 8 | // passwords, nicknames, and usernames as defined in RFC 8265 and RFC 8266. 9 | // 10 | // BE ADVISED: This package is under construction and the API may change in 11 | // backwards incompatible ways and without notice. 12 | package precis // import "golang.org/x/text/secure/precis" 13 | 14 | //go:generate go run gen.go gen_trieval.go 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/precis/transformer.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 precis 6 | 7 | import "golang.org/x/text/transform" 8 | 9 | // Transformer implements the transform.Transformer interface. 10 | type Transformer struct { 11 | t transform.Transformer 12 | } 13 | 14 | // Reset implements the transform.Transformer interface. 15 | func (t Transformer) Reset() { t.t.Reset() } 16 | 17 | // Transform implements the transform.Transformer interface. 18 | func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) { 19 | return t.t.Transform(dst, src, atEOF) 20 | } 21 | 22 | // Bytes returns a new byte slice with the result of applying t to b. 23 | func (t Transformer) Bytes(b []byte) []byte { 24 | b, _, _ = transform.Bytes(t, b) 25 | return b 26 | } 27 | 28 | // String returns a string with the result of applying t to s. 29 | func (t Transformer) String(s string) string { 30 | s, _, _ = transform.String(t, s) 31 | return s 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/kind_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Kind"; DO NOT EDIT. 2 | 3 | package width 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[Neutral-0] 12 | _ = x[EastAsianAmbiguous-1] 13 | _ = x[EastAsianWide-2] 14 | _ = x[EastAsianNarrow-3] 15 | _ = x[EastAsianFullwidth-4] 16 | _ = x[EastAsianHalfwidth-5] 17 | } 18 | 19 | const _Kind_name = "NeutralEastAsianAmbiguousEastAsianWideEastAsianNarrowEastAsianFullwidthEastAsianHalfwidth" 20 | 21 | var _Kind_index = [...]uint8{0, 7, 25, 38, 53, 71, 89} 22 | 23 | func (i Kind) String() string { 24 | if i < 0 || i >= Kind(len(_Kind_index)-1) { 25 | return "Kind(" + strconv.FormatInt(int64(i), 10) + ")" 26 | } 27 | return _Kind_name[_Kind_index[i]:_Kind_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/width/trieval.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package width 4 | 5 | // elem is an entry of the width trie. The high byte is used to encode the type 6 | // of the rune. The low byte is used to store the index to a mapping entry in 7 | // the inverseData array. 8 | type elem uint16 9 | 10 | const ( 11 | tagNeutral elem = iota << typeShift 12 | tagAmbiguous 13 | tagWide 14 | tagNarrow 15 | tagFullwidth 16 | tagHalfwidth 17 | ) 18 | 19 | const ( 20 | numTypeBits = 3 21 | typeShift = 16 - numTypeBits 22 | 23 | // tagNeedsFold is true for all fullwidth and halfwidth runes except for 24 | // the Won sign U+20A9. 25 | tagNeedsFold = 0x1000 26 | 27 | // The Korean Won sign is halfwidth, but SHOULD NOT be mapped to a wide 28 | // variant. 29 | wonSign rune = 0x20A9 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/postgres/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/postgres/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/postgres/README.md: -------------------------------------------------------------------------------- 1 | # GORM PostgreSQL Driver 2 | 3 | ## Quick Start 4 | 5 | ```go 6 | import ( 7 | "gorm.io/driver/postgres" 8 | "gorm.io/gorm" 9 | ) 10 | 11 | // https://github.com/jackc/pgx 12 | dsn := "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai" 13 | db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) 14 | ``` 15 | 16 | ## Configuration 17 | 18 | ```go 19 | import ( 20 | "gorm.io/driver/postgres" 21 | "gorm.io/gorm" 22 | ) 23 | 24 | db, err := gorm.Open(postgres.New(postgres.Config{ 25 | DSN: "host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai", // data source name, refer https://github.com/jackc/pgx 26 | PreferSimpleProtocol: true, // disables implicit prepared statement usage. By default pgx automatically uses the extended protocol 27 | }), &gorm.Config{}) 28 | ``` 29 | 30 | 31 | Checkout [https://gorm.io](https://gorm.io) for details. 32 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/README.md: -------------------------------------------------------------------------------- 1 | # GORM Sqlite Driver 2 | 3 | ![CI](https://github.com/go-gorm/sqlite/workflows/CI/badge.svg) 4 | 5 | ## USAGE 6 | 7 | ```go 8 | import ( 9 | "gorm.io/driver/sqlite" 10 | "gorm.io/gorm" 11 | ) 12 | 13 | // github.com/mattn/go-sqlite3 14 | db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{}) 15 | ``` 16 | 17 | Checkout [https://gorm.io](https://gorm.io) for details. 18 | 19 | ### Pure go Sqlite Driver 20 | 21 | checkout [https://github.com/glebarez/sqlite](https://github.com/glebarez/sqlite) for details 22 | 23 | ```go 24 | import ( 25 | "github.com/glebarez/sqlite" 26 | "gorm.io/gorm" 27 | ) 28 | 29 | db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{}) 30 | ``` 31 | -------------------------------------------------------------------------------- /vendor/gorm.io/driver/sqlite/errors.go: -------------------------------------------------------------------------------- 1 | package sqlite 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrConstraintsNotImplemented = errors.New("constraints not implemented on sqlite, consider using DisableForeignKeyConstraintWhenMigrating, more details https://github.com/go-gorm/gorm/wiki/GORM-V2-Release-Note-Draft#all-new-migrator") 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/.gitignore: -------------------------------------------------------------------------------- 1 | TODO* 2 | documents 3 | coverage.txt 4 | _book 5 | .idea 6 | vendor 7 | .vscode 8 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable: 3 | - cyclop 4 | - exportloopref 5 | - gocritic 6 | - gosec 7 | - ineffassign 8 | - misspell 9 | - prealloc 10 | - unconvert 11 | - unparam 12 | - goimports 13 | - whitespace 14 | 15 | linters-settings: 16 | whitespace: 17 | multi-func: true 18 | goimports: 19 | local-prefixes: gorm.io/gorm 20 | 21 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-NOW Jinzhu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/callmethod.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "reflect" 5 | 6 | "gorm.io/gorm" 7 | ) 8 | 9 | func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) { 10 | tx := db.Session(&gorm.Session{NewDB: true}) 11 | if called := fc(db.Statement.ReflectValue.Interface(), tx); !called { 12 | switch db.Statement.ReflectValue.Kind() { 13 | case reflect.Slice, reflect.Array: 14 | db.Statement.CurDestIndex = 0 15 | for i := 0; i < db.Statement.ReflectValue.Len(); i++ { 16 | if value := reflect.Indirect(db.Statement.ReflectValue.Index(i)); value.CanAddr() { 17 | fc(value.Addr().Interface(), tx) 18 | } else { 19 | db.AddError(gorm.ErrInvalidValue) 20 | return 21 | } 22 | db.Statement.CurDestIndex++ 23 | } 24 | case reflect.Struct: 25 | if db.Statement.ReflectValue.CanAddr() { 26 | fc(db.Statement.ReflectValue.Addr().Interface(), tx) 27 | } else { 28 | db.AddError(gorm.ErrInvalidValue) 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/interfaces.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import "gorm.io/gorm" 4 | 5 | type BeforeCreateInterface interface { 6 | BeforeCreate(*gorm.DB) error 7 | } 8 | 9 | type AfterCreateInterface interface { 10 | AfterCreate(*gorm.DB) error 11 | } 12 | 13 | type BeforeUpdateInterface interface { 14 | BeforeUpdate(*gorm.DB) error 15 | } 16 | 17 | type AfterUpdateInterface interface { 18 | AfterUpdate(*gorm.DB) error 19 | } 20 | 21 | type BeforeSaveInterface interface { 22 | BeforeSave(*gorm.DB) error 23 | } 24 | 25 | type AfterSaveInterface interface { 26 | AfterSave(*gorm.DB) error 27 | } 28 | 29 | type BeforeDeleteInterface interface { 30 | BeforeDelete(*gorm.DB) error 31 | } 32 | 33 | type AfterDeleteInterface interface { 34 | AfterDelete(*gorm.DB) error 35 | } 36 | 37 | type AfterFindInterface interface { 38 | AfterFind(*gorm.DB) error 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/raw.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func RawExec(db *gorm.DB) { 8 | if db.Error == nil && !db.DryRun { 9 | result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 10 | if err != nil { 11 | db.AddError(err) 12 | return 13 | } 14 | 15 | db.RowsAffected, _ = result.RowsAffected() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/row.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func RowQuery(db *gorm.DB) { 8 | if db.Error == nil { 9 | BuildQuerySQL(db) 10 | if db.DryRun || db.Error != nil { 11 | return 12 | } 13 | 14 | if isRows, ok := db.Get("rows"); ok && isRows.(bool) { 15 | db.Statement.Settings.Delete("rows") 16 | db.Statement.Dest, db.Error = db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 17 | } else { 18 | db.Statement.Dest = db.Statement.ConnPool.QueryRowContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...) 19 | } 20 | 21 | db.RowsAffected = -1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/callbacks/transaction.go: -------------------------------------------------------------------------------- 1 | package callbacks 2 | 3 | import ( 4 | "gorm.io/gorm" 5 | ) 6 | 7 | func BeginTransaction(db *gorm.DB) { 8 | if !db.Config.SkipDefaultTransaction && db.Error == nil { 9 | if tx := db.Begin(); tx.Error == nil { 10 | db.Statement.ConnPool = tx.Statement.ConnPool 11 | db.InstanceSet("gorm:started_transaction", true) 12 | } else if tx.Error == gorm.ErrInvalidTransaction { 13 | tx.Error = nil 14 | } else { 15 | db.Error = tx.Error 16 | } 17 | } 18 | } 19 | 20 | func CommitOrRollbackTransaction(db *gorm.DB) { 21 | if !db.Config.SkipDefaultTransaction { 22 | if _, ok := db.InstanceGet("gorm:started_transaction"); ok { 23 | if db.Error != nil { 24 | db.Rollback() 25 | } else { 26 | db.Commit() 27 | } 28 | 29 | db.Statement.ConnPool = db.ConnPool 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/delete.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Delete struct { 4 | Modifier string 5 | } 6 | 7 | func (d Delete) Name() string { 8 | return "DELETE" 9 | } 10 | 11 | func (d Delete) Build(builder Builder) { 12 | builder.WriteString("DELETE") 13 | 14 | if d.Modifier != "" { 15 | builder.WriteByte(' ') 16 | builder.WriteString(d.Modifier) 17 | } 18 | } 19 | 20 | func (d Delete) MergeClause(clause *Clause) { 21 | clause.Name = "" 22 | clause.Expression = d 23 | } 24 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/from.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | // From from clause 4 | type From struct { 5 | Tables []Table 6 | Joins []Join 7 | } 8 | 9 | // Name from clause name 10 | func (from From) Name() string { 11 | return "FROM" 12 | } 13 | 14 | // Build build from clause 15 | func (from From) Build(builder Builder) { 16 | if len(from.Tables) > 0 { 17 | for idx, table := range from.Tables { 18 | if idx > 0 { 19 | builder.WriteByte(',') 20 | } 21 | 22 | builder.WriteQuoted(table) 23 | } 24 | } else { 25 | builder.WriteQuoted(currentTable) 26 | } 27 | 28 | for _, join := range from.Joins { 29 | builder.WriteByte(' ') 30 | join.Build(builder) 31 | } 32 | } 33 | 34 | // MergeClause merge from clause 35 | func (from From) MergeClause(clause *Clause) { 36 | clause.Expression = from 37 | } 38 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/insert.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Insert struct { 4 | Table Table 5 | Modifier string 6 | } 7 | 8 | // Name insert clause name 9 | func (insert Insert) Name() string { 10 | return "INSERT" 11 | } 12 | 13 | // Build build insert clause 14 | func (insert Insert) Build(builder Builder) { 15 | if insert.Modifier != "" { 16 | builder.WriteString(insert.Modifier) 17 | builder.WriteByte(' ') 18 | } 19 | 20 | builder.WriteString("INTO ") 21 | if insert.Table.Name == "" { 22 | builder.WriteQuoted(currentTable) 23 | } else { 24 | builder.WriteQuoted(insert.Table) 25 | } 26 | } 27 | 28 | // MergeClause merge insert clause 29 | func (insert Insert) MergeClause(clause *Clause) { 30 | if v, ok := clause.Expression.(Insert); ok { 31 | if insert.Modifier == "" { 32 | insert.Modifier = v.Modifier 33 | } 34 | if insert.Table.Name == "" { 35 | insert.Table = v.Table 36 | } 37 | } 38 | clause.Expression = insert 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/joins.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type JoinType string 4 | 5 | const ( 6 | CrossJoin JoinType = "CROSS" 7 | InnerJoin JoinType = "INNER" 8 | LeftJoin JoinType = "LEFT" 9 | RightJoin JoinType = "RIGHT" 10 | ) 11 | 12 | // Join clause for from 13 | type Join struct { 14 | Type JoinType 15 | Table Table 16 | ON Where 17 | Using []string 18 | Expression Expression 19 | } 20 | 21 | func (join Join) Build(builder Builder) { 22 | if join.Expression != nil { 23 | join.Expression.Build(builder) 24 | } else { 25 | if join.Type != "" { 26 | builder.WriteString(string(join.Type)) 27 | builder.WriteByte(' ') 28 | } 29 | 30 | builder.WriteString("JOIN ") 31 | builder.WriteQuoted(join.Table) 32 | 33 | if len(join.ON.Exprs) > 0 { 34 | builder.WriteString(" ON ") 35 | join.ON.Build(builder) 36 | } else if len(join.Using) > 0 { 37 | builder.WriteString(" USING (") 38 | for idx, c := range join.Using { 39 | if idx > 0 { 40 | builder.WriteByte(',') 41 | } 42 | builder.WriteQuoted(c) 43 | } 44 | builder.WriteByte(')') 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/limit.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | // Limit limit clause 4 | type Limit struct { 5 | Limit *int 6 | Offset int 7 | } 8 | 9 | // Name where clause name 10 | func (limit Limit) Name() string { 11 | return "LIMIT" 12 | } 13 | 14 | // Build build where clause 15 | func (limit Limit) Build(builder Builder) { 16 | if limit.Limit != nil && *limit.Limit >= 0 { 17 | builder.WriteString("LIMIT ") 18 | builder.AddVar(builder, *limit.Limit) 19 | } 20 | if limit.Offset > 0 { 21 | if limit.Limit != nil && *limit.Limit >= 0 { 22 | builder.WriteByte(' ') 23 | } 24 | builder.WriteString("OFFSET ") 25 | builder.AddVar(builder, limit.Offset) 26 | } 27 | } 28 | 29 | // MergeClause merge order by clauses 30 | func (limit Limit) MergeClause(clause *Clause) { 31 | clause.Name = "" 32 | 33 | if v, ok := clause.Expression.(Limit); ok { 34 | if (limit.Limit == nil || *limit.Limit == 0) && v.Limit != nil { 35 | limit.Limit = v.Limit 36 | } 37 | 38 | if limit.Offset == 0 && v.Offset > 0 { 39 | limit.Offset = v.Offset 40 | } else if limit.Offset < 0 { 41 | limit.Offset = 0 42 | } 43 | } 44 | 45 | clause.Expression = limit 46 | } 47 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/locking.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | const ( 4 | LockingStrengthUpdate = "UPDATE" 5 | LockingStrengthShare = "SHARE" 6 | LockingOptionsSkipLocked = "SKIP LOCKED" 7 | LockingOptionsNoWait = "NOWAIT" 8 | ) 9 | 10 | type Locking struct { 11 | Strength string 12 | Table Table 13 | Options string 14 | } 15 | 16 | // Name where clause name 17 | func (locking Locking) Name() string { 18 | return "FOR" 19 | } 20 | 21 | // Build build where clause 22 | func (locking Locking) Build(builder Builder) { 23 | builder.WriteString(locking.Strength) 24 | if locking.Table.Name != "" { 25 | builder.WriteString(" OF ") 26 | builder.WriteQuoted(locking.Table) 27 | } 28 | 29 | if locking.Options != "" { 30 | builder.WriteByte(' ') 31 | builder.WriteString(locking.Options) 32 | } 33 | } 34 | 35 | // MergeClause merge order by clauses 36 | func (locking Locking) MergeClause(clause *Clause) { 37 | clause.Expression = locking 38 | } 39 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/returning.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Returning struct { 4 | Columns []Column 5 | } 6 | 7 | // Name where clause name 8 | func (returning Returning) Name() string { 9 | return "RETURNING" 10 | } 11 | 12 | // Build build where clause 13 | func (returning Returning) Build(builder Builder) { 14 | if len(returning.Columns) > 0 { 15 | for idx, column := range returning.Columns { 16 | if idx > 0 { 17 | builder.WriteByte(',') 18 | } 19 | 20 | builder.WriteQuoted(column) 21 | } 22 | } else { 23 | builder.WriteByte('*') 24 | } 25 | } 26 | 27 | // MergeClause merge order by clauses 28 | func (returning Returning) MergeClause(clause *Clause) { 29 | if v, ok := clause.Expression.(Returning); ok { 30 | returning.Columns = append(v.Columns, returning.Columns...) 31 | } 32 | 33 | clause.Expression = returning 34 | } 35 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/update.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Update struct { 4 | Modifier string 5 | Table Table 6 | } 7 | 8 | // Name update clause name 9 | func (update Update) Name() string { 10 | return "UPDATE" 11 | } 12 | 13 | // Build build update clause 14 | func (update Update) Build(builder Builder) { 15 | if update.Modifier != "" { 16 | builder.WriteString(update.Modifier) 17 | builder.WriteByte(' ') 18 | } 19 | 20 | if update.Table.Name == "" { 21 | builder.WriteQuoted(currentTable) 22 | } else { 23 | builder.WriteQuoted(update.Table) 24 | } 25 | } 26 | 27 | // MergeClause merge update clause 28 | func (update Update) MergeClause(clause *Clause) { 29 | if v, ok := clause.Expression.(Update); ok { 30 | if update.Modifier == "" { 31 | update.Modifier = v.Modifier 32 | } 33 | if update.Table.Name == "" { 34 | update.Table = v.Table 35 | } 36 | } 37 | clause.Expression = update 38 | } 39 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/values.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type Values struct { 4 | Columns []Column 5 | Values [][]interface{} 6 | } 7 | 8 | // Name from clause name 9 | func (Values) Name() string { 10 | return "VALUES" 11 | } 12 | 13 | // Build build from clause 14 | func (values Values) Build(builder Builder) { 15 | if len(values.Columns) > 0 { 16 | builder.WriteByte('(') 17 | for idx, column := range values.Columns { 18 | if idx > 0 { 19 | builder.WriteByte(',') 20 | } 21 | builder.WriteQuoted(column) 22 | } 23 | builder.WriteByte(')') 24 | 25 | builder.WriteString(" VALUES ") 26 | 27 | for idx, value := range values.Values { 28 | if idx > 0 { 29 | builder.WriteByte(',') 30 | } 31 | 32 | builder.WriteByte('(') 33 | builder.AddVar(builder, value...) 34 | builder.WriteByte(')') 35 | } 36 | } else { 37 | builder.WriteString("DEFAULT VALUES") 38 | } 39 | } 40 | 41 | // MergeClause merge values clauses 42 | func (values Values) MergeClause(clause *Clause) { 43 | clause.Name = "" 44 | clause.Expression = values 45 | } 46 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/clause/with.go: -------------------------------------------------------------------------------- 1 | package clause 2 | 3 | type With struct{} 4 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/migrator/table_type.go: -------------------------------------------------------------------------------- 1 | package migrator 2 | 3 | import ( 4 | "database/sql" 5 | ) 6 | 7 | // TableType table type implements TableType interface 8 | type TableType struct { 9 | SchemaValue string 10 | NameValue string 11 | TypeValue string 12 | CommentValue sql.NullString 13 | } 14 | 15 | // Schema returns the schema of the table. 16 | func (ct TableType) Schema() string { 17 | return ct.SchemaValue 18 | } 19 | 20 | // Name returns the name of the table. 21 | func (ct TableType) Name() string { 22 | return ct.NameValue 23 | } 24 | 25 | // Type returns the type of the table. 26 | func (ct TableType) Type() string { 27 | return ct.TypeValue 28 | } 29 | 30 | // Comment returns the comment of current table. 31 | func (ct TableType) Comment() (comment string, ok bool) { 32 | return ct.CommentValue.String, ct.CommentValue.Valid 33 | } 34 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/model.go: -------------------------------------------------------------------------------- 1 | package gorm 2 | 3 | import "time" 4 | 5 | // Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt 6 | // It may be embedded into your model or you may build your own model without it 7 | // 8 | // type User struct { 9 | // gorm.Model 10 | // } 11 | type Model struct { 12 | ID uint `gorm:"primarykey"` 13 | CreatedAt time.Time 14 | UpdatedAt time.Time 15 | DeletedAt DeletedAt `gorm:"index"` 16 | } 17 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/schema/interfaces.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | import ( 4 | "gorm.io/gorm/clause" 5 | ) 6 | 7 | // ConstraintInterface database constraint interface 8 | type ConstraintInterface interface { 9 | GetName() string 10 | Build() (sql string, vars []interface{}) 11 | } 12 | 13 | // GormDataTypeInterface gorm data type interface 14 | type GormDataTypeInterface interface { 15 | GormDataType() string 16 | } 17 | 18 | // FieldNewValuePool field new scan value pool 19 | type FieldNewValuePool interface { 20 | Get() interface{} 21 | Put(interface{}) 22 | } 23 | 24 | // CreateClausesInterface create clauses interface 25 | type CreateClausesInterface interface { 26 | CreateClauses(*Field) []clause.Interface 27 | } 28 | 29 | // QueryClausesInterface query clauses interface 30 | type QueryClausesInterface interface { 31 | QueryClauses(*Field) []clause.Interface 32 | } 33 | 34 | // UpdateClausesInterface update clauses interface 35 | type UpdateClausesInterface interface { 36 | UpdateClauses(*Field) []clause.Interface 37 | } 38 | 39 | // DeleteClausesInterface delete clauses interface 40 | type DeleteClausesInterface interface { 41 | DeleteClauses(*Field) []clause.Interface 42 | } 43 | -------------------------------------------------------------------------------- /vendor/gorm.io/gorm/schema/pool.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | import ( 4 | "reflect" 5 | "sync" 6 | ) 7 | 8 | // sync pools 9 | var ( 10 | normalPool sync.Map 11 | poolInitializer = func(reflectType reflect.Type) FieldNewValuePool { 12 | v, _ := normalPool.LoadOrStore(reflectType, &sync.Pool{ 13 | New: func() interface{} { 14 | return reflect.New(reflectType).Interface() 15 | }, 16 | }) 17 | return v.(FieldNewValuePool) 18 | } 19 | ) 20 | --------------------------------------------------------------------------------