├── .envrc ├── .github ├── dependabot.yml └── workflows │ ├── go.yml │ └── protect-master.yml ├── .gitignore ├── .golangci.yml ├── LICENSE ├── NOTICE ├── README.md ├── assert ├── be_dir_matcher.go ├── json_matchers.go └── path_matchers.go ├── bin ├── build ├── build-linux-amd64 ├── test ├── test-unit └── test-unit.ps1 ├── blobstore ├── blobstore_interface.go ├── blobstore_suite_test.go ├── digest_blobstore_interface.go ├── digest_verifiable_blobstore.go ├── digest_verifiable_blobstore_test.go ├── dummy_blobstore.go ├── external_blobstore.go ├── external_blobstore_test.go ├── fakes │ ├── fake_blobstore.go │ └── fake_digest_blobstore.go ├── local_blobstore.go ├── local_blobstore_test.go ├── provider.go ├── provider_test.go ├── retryable_blobstore.go ├── retryable_blobstore_test.go └── test_assets │ └── some.config ├── ci ├── README.md ├── configure.sh ├── docker │ └── Dockerfile ├── pipeline.yml └── tasks │ ├── build-multidigest-binary.sh │ ├── build-multidigest-binary.yml │ ├── test-unit-windows.yml │ ├── test-unit.ps1 │ ├── test-unit.sh │ └── test-unit.yml ├── crypto ├── algorithms.go ├── algorithms_test.go ├── crypto_suite_test.go ├── cryptofakes │ └── fake_archive_digest_file_path_reader.go ├── digest.go ├── digest_test.go ├── interfaces.go ├── multiple_digest.go ├── multiple_digest_test.go ├── x509.go └── x509_test.go ├── errors ├── errors.go ├── errors_suite_test.go ├── errors_test.go ├── multi_error.go └── multi_error_test.go ├── fileutil ├── compressor_interface.go ├── copier_interface.go ├── fakes │ ├── fake_compressor.go │ ├── fake_copier.go │ └── fake_mover.go ├── fileutil_suite_test.go ├── generic_cp_copier.go ├── generic_cp_copier_test.go ├── mover.go ├── mover_interface.go ├── mover_test.go ├── mover_windows_test.go ├── tarball_compressor.go ├── tarball_compressor_test.go └── test_assets │ ├── compressor-decompress-file-to-dir.tgz │ ├── compressor-decompress-owner-root.tgz │ ├── compressor-decompress-with-links.tgz │ ├── fixture_dir │ ├── .keep │ ├── app.stderr.log │ ├── app.stdout.log │ ├── other_logs │ │ ├── more_logs │ │ │ └── more.stdout.log │ │ ├── other_app.stderr.log │ │ └── other_app.stdout.log │ └── some_directory │ │ └── sub_dir │ │ └── other_sub_dir │ │ └── .keep │ └── symlink_target │ ├── app.stdout.log │ └── sub_dir │ └── sub_app.stdout.log ├── go.mod ├── go.sum ├── httpclient ├── assets │ ├── test_ca.pem │ ├── test_client.key │ └── test_client.pem ├── default_http_clients.go ├── default_http_clients_test.go ├── http_client.go ├── http_client_test.go ├── httpclient_suite_test.go ├── keepalive_syscall_linux_test.go ├── mutual_tls_client.go ├── mutual_tls_client_test.go ├── request_retryable.go ├── request_retryable_test.go ├── retry_clients.go ├── retry_clients_test.go ├── socksify.go └── socksify_test.go ├── logger ├── async.go ├── async_test.go ├── file │ ├── file_logger.go │ ├── file_suite_test.go │ └── file_test.go ├── logger.go ├── logger_suite_test.go ├── logger_test.go └── loggerfakes │ └── fake_logger.go ├── main ├── main_suite_test.go ├── verify_multidigest.go ├── verify_multidigest_test.go └── version.go ├── property ├── builders.go ├── list.go ├── map.go ├── map_test.go ├── property.go └── property_suite_test.go ├── retrystrategy ├── attempt_retry_strategy.go ├── attempt_retry_strategy_test.go ├── backoff_with_jitter_retry_strategy.go ├── backoff_with_jitter_retry_strategy_test.go ├── fakes │ └── fake_retry_strategy.go ├── retry_strategy.go ├── retrystrategy_suite_test.go ├── timeout_retry_strategy.go ├── timeout_retry_strategy_test.go ├── unlimited_retry_strategy.go └── unlimited_retry_strategy_test.go ├── system ├── cmd_runner_interface.go ├── exec_cmd_runner.go ├── exec_cmd_runner_fixtures │ ├── cat │ │ └── cat.go │ ├── child_ignore_term │ │ └── child_ignore_term.go │ ├── child_term │ │ └── child_term.go │ ├── exe_exits │ │ └── exe_exits.go │ ├── false │ │ └── false.go │ ├── parent_ignore_term │ │ └── parent_ignore_term.go │ ├── parent_term │ │ └── parent_term.go │ └── windows_exe │ │ └── windows_exe.go ├── exec_cmd_runner_test.go ├── exec_cmd_runner_unix.go ├── exec_cmd_runner_windows.go ├── exec_error.go ├── exec_error_test.go ├── exec_process.go ├── exec_process_test.go ├── exec_process_unix.go ├── exec_process_unix_test.go ├── exec_process_windows.go ├── exec_process_windows_test.go ├── fakes │ ├── fake_cmd_runner.go │ ├── fake_cmd_runner_test.go │ ├── fake_file_system.go │ ├── fake_file_system_test.go │ └── fakes_suite_test.go ├── file_system_interface.go ├── ip_helper.go ├── ip_helper_test.go ├── os_file_system.go ├── os_file_system_test.go ├── os_file_system_unix.go ├── os_file_system_unix_test.go ├── os_file_system_windows.go ├── os_file_system_windows_test.go ├── os_long_path_test.go ├── system_suite_test.go └── test_assets │ └── test_copy_dir_entries │ ├── bar │ ├── bar.txt │ └── baz │ │ └── .gitkeep │ └── foo.txt ├── tools └── tools.go ├── uuid ├── fakes │ └── fake_generator.go ├── generator_interface.go ├── uuid_suite_test.go ├── uuid_v4_generator.go └── uuid_v4_generator_test.go ├── vendor ├── code.cloudfoundry.org │ ├── clock │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── clock.go │ │ ├── fakeclock │ │ │ ├── fake_clock.go │ │ │ ├── fake_ticker.go │ │ │ ├── fake_timer.go │ │ │ └── package.go │ │ ├── package.go │ │ ├── ticker.go │ │ └── timer.go │ └── tlsconfig │ │ ├── .gitignore │ │ ├── CODEOWNERS │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── authority.go │ │ ├── config.go │ │ ├── staticcheck.conf │ │ └── verify.go ├── github.com │ ├── bmatcuk │ │ └── doublestar │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── doublestar.go │ ├── charlievieth │ │ └── fs │ │ │ ├── LICENSE │ │ │ ├── fs.go │ │ │ ├── fs_unix.go │ │ │ └── fs_windows.go │ ├── cloudfoundry │ │ ├── go-socks5 │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── credentials.go │ │ │ ├── request.go │ │ │ ├── resolver.go │ │ │ ├── ruleset.go │ │ │ └── socks5.go │ │ └── socks5-proxy │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── host_key.go │ │ │ ├── socks5_proxy.go │ │ │ ├── ssh_client_config.go │ │ │ └── ssh_test_server.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── go-logr │ │ └── logr │ │ │ ├── .golangci.yaml │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── context.go │ │ │ ├── context_noslog.go │ │ │ ├── context_slog.go │ │ │ ├── discard.go │ │ │ ├── funcr │ │ │ ├── funcr.go │ │ │ └── slogsink.go │ │ │ ├── logr.go │ │ │ ├── sloghandler.go │ │ │ ├── slogr.go │ │ │ └── slogsink.go │ ├── go-task │ │ └── slim-sprig │ │ │ └── v3 │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── Taskfile.yml │ │ │ ├── crypto.go │ │ │ ├── date.go │ │ │ ├── defaults.go │ │ │ ├── dict.go │ │ │ ├── doc.go │ │ │ ├── functions.go │ │ │ ├── list.go │ │ │ ├── network.go │ │ │ ├── numeric.go │ │ │ ├── reflect.go │ │ │ ├── regex.go │ │ │ ├── strings.go │ │ │ └── url.go │ ├── google │ │ ├── go-cmp │ │ │ ├── LICENSE │ │ │ └── cmp │ │ │ │ ├── compare.go │ │ │ │ ├── export.go │ │ │ │ ├── internal │ │ │ │ ├── diff │ │ │ │ │ ├── debug_disable.go │ │ │ │ │ ├── debug_enable.go │ │ │ │ │ └── diff.go │ │ │ │ ├── flags │ │ │ │ │ └── flags.go │ │ │ │ ├── function │ │ │ │ │ └── func.go │ │ │ │ └── value │ │ │ │ │ ├── name.go │ │ │ │ │ ├── pointer.go │ │ │ │ │ └── sort.go │ │ │ │ ├── options.go │ │ │ │ ├── path.go │ │ │ │ ├── report.go │ │ │ │ ├── report_compare.go │ │ │ │ ├── report_references.go │ │ │ │ ├── report_reflect.go │ │ │ │ ├── report_slices.go │ │ │ │ ├── report_text.go │ │ │ │ └── report_value.go │ │ └── pprof │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ └── profile │ │ │ ├── encode.go │ │ │ ├── filter.go │ │ │ ├── index.go │ │ │ ├── legacy_java_profile.go │ │ │ ├── legacy_profile.go │ │ │ ├── merge.go │ │ │ ├── profile.go │ │ │ ├── proto.go │ │ │ └── prune.go │ ├── jessevdk │ │ └── go-flags │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── arg.go │ │ │ ├── check_crosscompile.sh │ │ │ ├── closest.go │ │ │ ├── command.go │ │ │ ├── completion.go │ │ │ ├── convert.go │ │ │ ├── error.go │ │ │ ├── flags.go │ │ │ ├── group.go │ │ │ ├── help.go │ │ │ ├── ini.go │ │ │ ├── man.go │ │ │ ├── multitag.go │ │ │ ├── option.go │ │ │ ├── optstyle_other.go │ │ │ ├── optstyle_windows.go │ │ │ ├── parser.go │ │ │ ├── termsize.go │ │ │ ├── termsize_nosysioctl.go │ │ │ └── termsize_windows.go │ ├── jpillora │ │ └── backoff │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── backoff.go │ ├── maxbrunsfeld │ │ └── counterfeiter │ │ │ └── v6 │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .golangci.yaml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── arguments │ │ │ ├── files.go │ │ │ ├── parser.go │ │ │ └── usage.go │ │ │ ├── command │ │ │ └── runner.go │ │ │ ├── generator │ │ │ ├── cache.go │ │ │ ├── ctx.go │ │ │ ├── ctx_old.go │ │ │ ├── fake.go │ │ │ ├── file_reader.go │ │ │ ├── function_loader.go │ │ │ ├── function_template.go │ │ │ ├── import.go │ │ │ ├── interface_loader.go │ │ │ ├── interface_template.go │ │ │ ├── loader.go │ │ │ ├── package_loader.go │ │ │ ├── package_template.go │ │ │ ├── param.go │ │ │ └── return.go │ │ │ └── main.go │ ├── nu7hatch │ │ └── gouuid │ │ │ ├── .gitignore │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ └── uuid.go │ ├── onsi │ │ ├── ginkgo │ │ │ └── v2 │ │ │ │ ├── .gitignore │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── RELEASING.md │ │ │ │ ├── config │ │ │ │ └── deprecated.go │ │ │ │ ├── core_dsl.go │ │ │ │ ├── decorator_dsl.go │ │ │ │ ├── deprecated_dsl.go │ │ │ │ ├── formatter │ │ │ │ ├── colorable_others.go │ │ │ │ ├── colorable_windows.go │ │ │ │ └── formatter.go │ │ │ │ ├── ginkgo │ │ │ │ ├── build │ │ │ │ │ └── build_command.go │ │ │ │ ├── command │ │ │ │ │ ├── abort.go │ │ │ │ │ ├── command.go │ │ │ │ │ └── program.go │ │ │ │ ├── generators │ │ │ │ │ ├── boostrap_templates.go │ │ │ │ │ ├── bootstrap_command.go │ │ │ │ │ ├── generate_command.go │ │ │ │ │ ├── generate_templates.go │ │ │ │ │ └── generators_common.go │ │ │ │ ├── internal │ │ │ │ │ ├── compile.go │ │ │ │ │ ├── gocovmerge.go │ │ │ │ │ ├── profiles_and_reports.go │ │ │ │ │ ├── run.go │ │ │ │ │ ├── test_suite.go │ │ │ │ │ ├── utils.go │ │ │ │ │ └── verify_version.go │ │ │ │ ├── labels │ │ │ │ │ └── labels_command.go │ │ │ │ ├── main.go │ │ │ │ ├── outline │ │ │ │ │ ├── ginkgo.go │ │ │ │ │ ├── import.go │ │ │ │ │ ├── outline.go │ │ │ │ │ └── outline_command.go │ │ │ │ ├── run │ │ │ │ │ └── run_command.go │ │ │ │ ├── unfocus │ │ │ │ │ └── unfocus_command.go │ │ │ │ └── watch │ │ │ │ │ ├── delta.go │ │ │ │ │ ├── delta_tracker.go │ │ │ │ │ ├── dependencies.go │ │ │ │ │ ├── package_hash.go │ │ │ │ │ ├── package_hashes.go │ │ │ │ │ ├── suite.go │ │ │ │ │ └── watch_command.go │ │ │ │ ├── ginkgo_cli_dependencies.go │ │ │ │ ├── ginkgo_t_dsl.go │ │ │ │ ├── internal │ │ │ │ ├── counter.go │ │ │ │ ├── failer.go │ │ │ │ ├── focus.go │ │ │ │ ├── global │ │ │ │ │ └── init.go │ │ │ │ ├── group.go │ │ │ │ ├── interrupt_handler │ │ │ │ │ ├── interrupt_handler.go │ │ │ │ │ ├── sigquit_swallower_unix.go │ │ │ │ │ └── sigquit_swallower_windows.go │ │ │ │ ├── node.go │ │ │ │ ├── ordering.go │ │ │ │ ├── output_interceptor.go │ │ │ │ ├── output_interceptor_unix.go │ │ │ │ ├── output_interceptor_wasm.go │ │ │ │ ├── output_interceptor_win.go │ │ │ │ ├── parallel_support │ │ │ │ │ ├── client_server.go │ │ │ │ │ ├── http_client.go │ │ │ │ │ ├── http_server.go │ │ │ │ │ ├── rpc_client.go │ │ │ │ │ ├── rpc_server.go │ │ │ │ │ └── server_handler.go │ │ │ │ ├── progress_report.go │ │ │ │ ├── progress_report_bsd.go │ │ │ │ ├── progress_report_unix.go │ │ │ │ ├── progress_report_wasm.go │ │ │ │ ├── progress_report_win.go │ │ │ │ ├── progress_reporter_manager.go │ │ │ │ ├── report_entry.go │ │ │ │ ├── spec.go │ │ │ │ ├── spec_context.go │ │ │ │ ├── suite.go │ │ │ │ ├── testingtproxy │ │ │ │ │ └── testing_t_proxy.go │ │ │ │ ├── tree.go │ │ │ │ └── writer.go │ │ │ │ ├── reporters │ │ │ │ ├── default_reporter.go │ │ │ │ ├── deprecated_reporter.go │ │ │ │ ├── json_report.go │ │ │ │ ├── junit_report.go │ │ │ │ ├── reporter.go │ │ │ │ └── teamcity_report.go │ │ │ │ ├── reporting_dsl.go │ │ │ │ ├── table_dsl.go │ │ │ │ └── types │ │ │ │ ├── code_location.go │ │ │ │ ├── config.go │ │ │ │ ├── deprecated_types.go │ │ │ │ ├── deprecation_support.go │ │ │ │ ├── enum_support.go │ │ │ │ ├── errors.go │ │ │ │ ├── file_filter.go │ │ │ │ ├── flags.go │ │ │ │ ├── label_filter.go │ │ │ │ ├── report_entry.go │ │ │ │ ├── types.go │ │ │ │ └── version.go │ │ └── gomega │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── RELEASING.md │ │ │ ├── format │ │ │ └── format.go │ │ │ ├── gbytes │ │ │ ├── buffer.go │ │ │ ├── io_wrappers.go │ │ │ └── say_matcher.go │ │ │ ├── gexec │ │ │ ├── build.go │ │ │ ├── exit_matcher.go │ │ │ ├── prefixed_writer.go │ │ │ └── session.go │ │ │ ├── ghttp │ │ │ ├── handlers.go │ │ │ └── test_server.go │ │ │ ├── gomega_dsl.go │ │ │ ├── internal │ │ │ ├── assertion.go │ │ │ ├── async_assertion.go │ │ │ ├── duration_bundle.go │ │ │ ├── gomega.go │ │ │ ├── gutil │ │ │ │ ├── post_ioutil.go │ │ │ │ └── using_ioutil.go │ │ │ ├── polling_signal_error.go │ │ │ └── vetoptdesc.go │ │ │ ├── matchers.go │ │ │ ├── matchers │ │ │ ├── and.go │ │ │ ├── assignable_to_type_of_matcher.go │ │ │ ├── attributes_slice.go │ │ │ ├── be_a_directory.go │ │ │ ├── be_a_regular_file.go │ │ │ ├── be_an_existing_file.go │ │ │ ├── be_closed_matcher.go │ │ │ ├── be_comparable_to_matcher.go │ │ │ ├── be_element_of_matcher.go │ │ │ ├── be_empty_matcher.go │ │ │ ├── be_equivalent_to_matcher.go │ │ │ ├── be_false_matcher.go │ │ │ ├── be_identical_to.go │ │ │ ├── be_key_of_matcher.go │ │ │ ├── be_nil_matcher.go │ │ │ ├── be_numerically_matcher.go │ │ │ ├── be_sent_matcher.go │ │ │ ├── be_temporally_matcher.go │ │ │ ├── be_true_matcher.go │ │ │ ├── be_zero_matcher.go │ │ │ ├── consist_of.go │ │ │ ├── contain_element_matcher.go │ │ │ ├── contain_elements_matcher.go │ │ │ ├── contain_substring_matcher.go │ │ │ ├── equal_matcher.go │ │ │ ├── have_cap_matcher.go │ │ │ ├── have_each_matcher.go │ │ │ ├── have_exact_elements.go │ │ │ ├── have_existing_field_matcher.go │ │ │ ├── have_field.go │ │ │ ├── have_http_body_matcher.go │ │ │ ├── have_http_header_with_value_matcher.go │ │ │ ├── have_http_status_matcher.go │ │ │ ├── have_key_matcher.go │ │ │ ├── have_key_with_value_matcher.go │ │ │ ├── have_len_matcher.go │ │ │ ├── have_occurred_matcher.go │ │ │ ├── have_prefix_matcher.go │ │ │ ├── have_suffix_matcher.go │ │ │ ├── have_value.go │ │ │ ├── internal │ │ │ │ └── miter │ │ │ │ │ ├── type_support_iter.go │ │ │ │ │ └── type_support_noiter.go │ │ │ ├── match_error_matcher.go │ │ │ ├── match_json_matcher.go │ │ │ ├── match_regexp_matcher.go │ │ │ ├── match_xml_matcher.go │ │ │ ├── match_yaml_matcher.go │ │ │ ├── not.go │ │ │ ├── or.go │ │ │ ├── panic_matcher.go │ │ │ ├── receive_matcher.go │ │ │ ├── satisfy_matcher.go │ │ │ ├── semi_structured_data_support.go │ │ │ ├── succeed_matcher.go │ │ │ ├── support │ │ │ │ └── goraph │ │ │ │ │ ├── bipartitegraph │ │ │ │ │ ├── bipartitegraph.go │ │ │ │ │ └── bipartitegraphmatching.go │ │ │ │ │ ├── edge │ │ │ │ │ └── edge.go │ │ │ │ │ ├── node │ │ │ │ │ └── node.go │ │ │ │ │ └── util │ │ │ │ │ └── util.go │ │ │ ├── type_support.go │ │ │ └── with_transform.go │ │ │ └── types │ │ │ └── types.go │ ├── pivotal-cf │ │ └── paraphernalia │ │ │ ├── LICENSE │ │ │ └── secure │ │ │ └── tlsconfig │ │ │ ├── BUILD.bazel │ │ │ └── config.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ └── stretchr │ │ └── 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 ├── go.uber.org │ └── automaxprocs │ │ ├── .codecov.yml │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── automaxprocs.go │ │ ├── internal │ │ ├── cgroups │ │ │ ├── cgroup.go │ │ │ ├── cgroups.go │ │ │ ├── cgroups2.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── mountpoint.go │ │ │ └── subsys.go │ │ └── runtime │ │ │ ├── cpu_quota_linux.go │ │ │ ├── cpu_quota_unsupported.go │ │ │ └── runtime.go │ │ └── maxprocs │ │ ├── maxprocs.go │ │ └── version.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── blowfish │ │ │ ├── block.go │ │ │ ├── cipher.go │ │ │ └── const.go │ │ ├── chacha20 │ │ │ ├── chacha_arm64.go │ │ │ ├── chacha_arm64.s │ │ │ ├── chacha_generic.go │ │ │ ├── chacha_noasm.go │ │ │ ├── chacha_ppc64x.go │ │ │ ├── chacha_ppc64x.s │ │ │ ├── chacha_s390x.go │ │ │ ├── chacha_s390x.s │ │ │ └── xor.go │ │ ├── curve25519 │ │ │ └── curve25519.go │ │ ├── internal │ │ │ ├── alias │ │ │ │ ├── alias.go │ │ │ │ └── alias_purego.go │ │ │ └── poly1305 │ │ │ │ ├── mac_noasm.go │ │ │ │ ├── poly1305.go │ │ │ │ ├── sum_amd64.s │ │ │ │ ├── sum_asm.go │ │ │ │ ├── sum_generic.go │ │ │ │ ├── sum_loong64.s │ │ │ │ ├── sum_ppc64x.s │ │ │ │ ├── sum_s390x.go │ │ │ │ └── sum_s390x.s │ │ └── ssh │ │ │ ├── buffer.go │ │ │ ├── certs.go │ │ │ ├── channel.go │ │ │ ├── cipher.go │ │ │ ├── client.go │ │ │ ├── client_auth.go │ │ │ ├── common.go │ │ │ ├── connection.go │ │ │ ├── doc.go │ │ │ ├── handshake.go │ │ │ ├── internal │ │ │ └── bcrypt_pbkdf │ │ │ │ └── bcrypt_pbkdf.go │ │ │ ├── kex.go │ │ │ ├── keys.go │ │ │ ├── mac.go │ │ │ ├── messages.go │ │ │ ├── mlkem.go │ │ │ ├── mux.go │ │ │ ├── server.go │ │ │ ├── session.go │ │ │ ├── ssh_gss.go │ │ │ ├── streamlocal.go │ │ │ ├── tcpip.go │ │ │ └── transport.go │ │ ├── mod │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── internal │ │ │ └── lazyregexp │ │ │ │ └── lazyre.go │ │ ├── module │ │ │ ├── module.go │ │ │ └── pseudo.go │ │ └── semver │ │ │ └── semver.go │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── context │ │ │ └── context.go │ │ ├── html │ │ │ ├── atom │ │ │ │ ├── atom.go │ │ │ │ └── table.go │ │ │ ├── charset │ │ │ │ └── charset.go │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── doctype.go │ │ │ ├── entity.go │ │ │ ├── escape.go │ │ │ ├── foreign.go │ │ │ ├── iter.go │ │ │ ├── node.go │ │ │ ├── parse.go │ │ │ ├── render.go │ │ │ └── token.go │ │ ├── internal │ │ │ └── socks │ │ │ │ ├── client.go │ │ │ │ └── socks.go │ │ └── proxy │ │ │ ├── dial.go │ │ │ ├── direct.go │ │ │ ├── per_host.go │ │ │ ├── proxy.go │ │ │ └── socks5.go │ │ ├── sync │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── errgroup │ │ │ └── errgroup.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── cpu │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_x86_gc.s │ │ │ ├── byteorder.go │ │ │ ├── cpu.go │ │ │ ├── cpu_aix.go │ │ │ ├── cpu_arm.go │ │ │ ├── cpu_arm64.go │ │ │ ├── cpu_arm64.s │ │ │ ├── cpu_darwin_x86.go │ │ │ ├── cpu_gc_arm64.go │ │ │ ├── cpu_gc_s390x.go │ │ │ ├── cpu_gc_x86.go │ │ │ ├── cpu_gc_x86.s │ │ │ ├── cpu_gccgo_arm64.go │ │ │ ├── cpu_gccgo_s390x.go │ │ │ ├── cpu_gccgo_x86.c │ │ │ ├── cpu_gccgo_x86.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_linux_arm.go │ │ │ ├── cpu_linux_arm64.go │ │ │ ├── cpu_linux_loong64.go │ │ │ ├── cpu_linux_mips64x.go │ │ │ ├── cpu_linux_noinit.go │ │ │ ├── cpu_linux_ppc64x.go │ │ │ ├── cpu_linux_riscv64.go │ │ │ ├── cpu_linux_s390x.go │ │ │ ├── cpu_loong64.go │ │ │ ├── cpu_loong64.s │ │ │ ├── cpu_mips64x.go │ │ │ ├── cpu_mipsx.go │ │ │ ├── cpu_netbsd_arm64.go │ │ │ ├── cpu_openbsd_arm64.go │ │ │ ├── cpu_openbsd_arm64.s │ │ │ ├── cpu_other_arm.go │ │ │ ├── cpu_other_arm64.go │ │ │ ├── cpu_other_mips64x.go │ │ │ ├── cpu_other_ppc64x.go │ │ │ ├── cpu_other_riscv64.go │ │ │ ├── cpu_other_x86.go │ │ │ ├── cpu_ppc64x.go │ │ │ ├── cpu_riscv64.go │ │ │ ├── cpu_s390x.go │ │ │ ├── cpu_s390x.s │ │ │ ├── cpu_wasm.go │ │ │ ├── cpu_x86.go │ │ │ ├── cpu_zos.go │ │ │ ├── cpu_zos_s390x.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── hwcap_linux.go │ │ │ ├── parse.go │ │ │ ├── proc_cpuinfo_linux.go │ │ │ ├── runtime_auxv.go │ │ │ ├── runtime_auxv_go121.go │ │ │ ├── syscall_aix_gccgo.go │ │ │ ├── syscall_aix_ppc64_gc.go │ │ │ └── syscall_darwin_x86_gc.go │ │ └── 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 │ │ │ ├── auxv.go │ │ │ ├── auxv_unsupported.go │ │ │ ├── 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 │ │ ├── encoding │ │ │ ├── charmap │ │ │ │ ├── charmap.go │ │ │ │ └── tables.go │ │ │ ├── encoding.go │ │ │ ├── htmlindex │ │ │ │ ├── htmlindex.go │ │ │ │ ├── map.go │ │ │ │ └── tables.go │ │ │ ├── internal │ │ │ │ ├── identifier │ │ │ │ │ ├── identifier.go │ │ │ │ │ └── mib.go │ │ │ │ └── internal.go │ │ │ ├── japanese │ │ │ │ ├── all.go │ │ │ │ ├── eucjp.go │ │ │ │ ├── iso2022jp.go │ │ │ │ ├── shiftjis.go │ │ │ │ └── tables.go │ │ │ ├── korean │ │ │ │ ├── euckr.go │ │ │ │ └── tables.go │ │ │ ├── simplifiedchinese │ │ │ │ ├── all.go │ │ │ │ ├── gbk.go │ │ │ │ ├── hzgb2312.go │ │ │ │ └── tables.go │ │ │ ├── traditionalchinese │ │ │ │ ├── big5.go │ │ │ │ └── tables.go │ │ │ └── unicode │ │ │ │ ├── override.go │ │ │ │ └── unicode.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 │ │ │ └── utf8internal │ │ │ │ └── utf8internal.go │ │ ├── language │ │ │ ├── coverage.go │ │ │ ├── doc.go │ │ │ ├── language.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── runes │ │ │ ├── cond.go │ │ │ └── runes.go │ │ ├── transform │ │ │ └── transform.go │ │ └── unicode │ │ │ └── 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 │ │ └── tools │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── cover │ │ └── profile.go │ │ ├── go │ │ ├── ast │ │ │ ├── astutil │ │ │ │ ├── enclosing.go │ │ │ │ ├── imports.go │ │ │ │ ├── rewrite.go │ │ │ │ └── util.go │ │ │ └── inspector │ │ │ │ ├── inspector.go │ │ │ │ ├── iter.go │ │ │ │ ├── typeof.go │ │ │ │ └── walk.go │ │ ├── gcexportdata │ │ │ ├── gcexportdata.go │ │ │ └── importer.go │ │ ├── packages │ │ │ ├── doc.go │ │ │ ├── external.go │ │ │ ├── golist.go │ │ │ ├── golist_overlay.go │ │ │ ├── loadmode_string.go │ │ │ ├── packages.go │ │ │ └── visit.go │ │ └── types │ │ │ ├── objectpath │ │ │ └── objectpath.go │ │ │ └── typeutil │ │ │ ├── callee.go │ │ │ ├── imports.go │ │ │ ├── map.go │ │ │ ├── methodsetcache.go │ │ │ └── ui.go │ │ ├── imports │ │ └── forward.go │ │ └── internal │ │ ├── aliases │ │ ├── aliases.go │ │ └── aliases_go122.go │ │ ├── astutil │ │ └── edge │ │ │ └── edge.go │ │ ├── event │ │ ├── core │ │ │ ├── event.go │ │ │ ├── export.go │ │ │ └── fast.go │ │ ├── doc.go │ │ ├── event.go │ │ ├── keys │ │ │ ├── keys.go │ │ │ ├── standard.go │ │ │ └── util.go │ │ └── label │ │ │ └── label.go │ │ ├── gcimporter │ │ ├── bimport.go │ │ ├── exportdata.go │ │ ├── gcimporter.go │ │ ├── iexport.go │ │ ├── iimport.go │ │ ├── iimport_go122.go │ │ ├── predeclared.go │ │ ├── support.go │ │ └── ureader_yes.go │ │ ├── gocommand │ │ ├── invoke.go │ │ ├── invoke_notunix.go │ │ ├── invoke_unix.go │ │ ├── vendor.go │ │ └── version.go │ │ ├── gopathwalk │ │ └── walk.go │ │ ├── imports │ │ ├── fix.go │ │ ├── imports.go │ │ ├── mod.go │ │ ├── mod_cache.go │ │ ├── sortimports.go │ │ ├── source.go │ │ ├── source_env.go │ │ └── source_modindex.go │ │ ├── modindex │ │ ├── directories.go │ │ ├── index.go │ │ ├── lookup.go │ │ ├── modindex.go │ │ ├── symbols.go │ │ └── types.go │ │ ├── packagesinternal │ │ └── packages.go │ │ ├── pkgbits │ │ ├── codes.go │ │ ├── decoder.go │ │ ├── doc.go │ │ ├── encoder.go │ │ ├── flags.go │ │ ├── reloc.go │ │ ├── support.go │ │ ├── sync.go │ │ ├── syncmarker_string.go │ │ └── version.go │ │ ├── stdlib │ │ ├── deps.go │ │ ├── import.go │ │ ├── manifest.go │ │ └── stdlib.go │ │ ├── typeparams │ │ ├── common.go │ │ ├── coretype.go │ │ ├── free.go │ │ ├── normalize.go │ │ ├── termlist.go │ │ └── typeterm.go │ │ ├── typesinternal │ │ ├── classify_call.go │ │ ├── element.go │ │ ├── errorcode.go │ │ ├── errorcode_string.go │ │ ├── qualifier.go │ │ ├── recv.go │ │ ├── toonew.go │ │ ├── types.go │ │ ├── varkind.go │ │ └── zerovalue.go │ │ └── versions │ │ ├── features.go │ │ ├── gover.go │ │ ├── types.go │ │ └── versions.go ├── google.golang.org │ └── protobuf │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── encoding │ │ ├── prototext │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ │ └── protowire │ │ │ └── wire.go │ │ ├── internal │ │ ├── descfmt │ │ │ └── stringer.go │ │ ├── descopts │ │ │ └── options.go │ │ ├── detrand │ │ │ └── rand.go │ │ ├── editiondefaults │ │ │ ├── defaults.go │ │ │ └── editions_defaults.binpb │ │ ├── encoding │ │ │ ├── defval │ │ │ │ └── default.go │ │ │ ├── messageset │ │ │ │ └── messageset.go │ │ │ ├── tag │ │ │ │ └── tag.go │ │ │ └── text │ │ │ │ ├── decode.go │ │ │ │ ├── decode_number.go │ │ │ │ ├── decode_string.go │ │ │ │ ├── decode_token.go │ │ │ │ ├── doc.go │ │ │ │ └── encode.go │ │ ├── errors │ │ │ └── errors.go │ │ ├── filedesc │ │ │ ├── build.go │ │ │ ├── desc.go │ │ │ ├── desc_init.go │ │ │ ├── desc_lazy.go │ │ │ ├── desc_list.go │ │ │ ├── desc_list_gen.go │ │ │ ├── editions.go │ │ │ └── placeholder.go │ │ ├── filetype │ │ │ └── build.go │ │ ├── flags │ │ │ ├── flags.go │ │ │ ├── proto_legacy_disable.go │ │ │ └── proto_legacy_enable.go │ │ ├── genid │ │ │ ├── any_gen.go │ │ │ ├── api_gen.go │ │ │ ├── descriptor_gen.go │ │ │ ├── doc.go │ │ │ ├── duration_gen.go │ │ │ ├── empty_gen.go │ │ │ ├── field_mask_gen.go │ │ │ ├── go_features_gen.go │ │ │ ├── goname.go │ │ │ ├── map_entry.go │ │ │ ├── name.go │ │ │ ├── source_context_gen.go │ │ │ ├── struct_gen.go │ │ │ ├── timestamp_gen.go │ │ │ ├── type_gen.go │ │ │ ├── wrappers.go │ │ │ └── wrappers_gen.go │ │ ├── impl │ │ │ ├── api_export.go │ │ │ ├── api_export_opaque.go │ │ │ ├── bitmap.go │ │ │ ├── bitmap_race.go │ │ │ ├── checkinit.go │ │ │ ├── codec_extension.go │ │ │ ├── codec_field.go │ │ │ ├── codec_field_opaque.go │ │ │ ├── codec_gen.go │ │ │ ├── codec_map.go │ │ │ ├── codec_message.go │ │ │ ├── codec_message_opaque.go │ │ │ ├── codec_messageset.go │ │ │ ├── codec_tables.go │ │ │ ├── codec_unsafe.go │ │ │ ├── convert.go │ │ │ ├── convert_list.go │ │ │ ├── convert_map.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── enum.go │ │ │ ├── equal.go │ │ │ ├── extension.go │ │ │ ├── lazy.go │ │ │ ├── legacy_enum.go │ │ │ ├── legacy_export.go │ │ │ ├── legacy_extension.go │ │ │ ├── legacy_file.go │ │ │ ├── legacy_message.go │ │ │ ├── merge.go │ │ │ ├── merge_gen.go │ │ │ ├── message.go │ │ │ ├── message_opaque.go │ │ │ ├── message_opaque_gen.go │ │ │ ├── message_reflect.go │ │ │ ├── message_reflect_field.go │ │ │ ├── message_reflect_field_gen.go │ │ │ ├── message_reflect_gen.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_opaque.go │ │ │ ├── presence.go │ │ │ └── validate.go │ │ ├── order │ │ │ ├── order.go │ │ │ └── range.go │ │ ├── pragma │ │ │ └── pragma.go │ │ ├── protolazy │ │ │ ├── bufferreader.go │ │ │ ├── lazy.go │ │ │ └── pointer_unsafe.go │ │ ├── set │ │ │ └── ints.go │ │ ├── strs │ │ │ ├── strings.go │ │ │ ├── strings_unsafe_go120.go │ │ │ └── strings_unsafe_go121.go │ │ └── version │ │ │ └── version.go │ │ ├── proto │ │ ├── checkinit.go │ │ ├── decode.go │ │ ├── decode_gen.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_gen.go │ │ ├── equal.go │ │ ├── extension.go │ │ ├── merge.go │ │ ├── messageset.go │ │ ├── proto.go │ │ ├── proto_methods.go │ │ ├── proto_reflect.go │ │ ├── reset.go │ │ ├── size.go │ │ ├── size_gen.go │ │ ├── wrapperopaque.go │ │ └── wrappers.go │ │ ├── protoadapt │ │ └── convert.go │ │ ├── reflect │ │ ├── protoreflect │ │ │ ├── methods.go │ │ │ ├── proto.go │ │ │ ├── source.go │ │ │ ├── source_gen.go │ │ │ ├── type.go │ │ │ ├── value.go │ │ │ ├── value_equal.go │ │ │ ├── value_union.go │ │ │ ├── value_unsafe_go120.go │ │ │ └── value_unsafe_go121.go │ │ └── protoregistry │ │ │ └── registry.go │ │ └── runtime │ │ ├── protoiface │ │ ├── legacy.go │ │ └── methods.go │ │ └── protoimpl │ │ ├── impl.go │ │ └── version.go ├── gopkg.in │ ├── yaml.v2 │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── 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 │ └── 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 └── modules.txt └── work ├── pool.go ├── pool_test.go └── work_suite_test.go /.envrc: -------------------------------------------------------------------------------- 1 | export GOPATH=$PWD/../../../.. 2 | export PATH=$GOPATH/bin:$PATH 3 | 4 | if command -v lorri &> /dev/null; then 5 | eval "$(lorri direnv)" 6 | fi 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | target-branch: "develop" 9 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: go 2 | on: 3 | push: 4 | pull_request: 5 | jobs: 6 | verify: # <- name 7 | strategy: 8 | matrix: 9 | os: [macos-latest, ubuntu-latest, windows-2019] 10 | runs-on: ${{ matrix.os }} 11 | steps: 12 | - uses: actions/checkout@v4 13 | - uses: actions/setup-go@v5 14 | with: 15 | go-version-file: go.mod 16 | - uses: golangci/golangci-lint-action@v6 17 | - name: Unit Tests (Windows) 18 | if: runner.os == 'Windows' 19 | run: ./bin/test-unit.ps1 20 | - name: Unit Tests (Linux) 21 | if: runner.os == 'Linux' 22 | run: ./bin/test-unit 23 | -------------------------------------------------------------------------------- /.github/workflows/protect-master.yml: -------------------------------------------------------------------------------- 1 | name: Master Branch Protection 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | check-branch: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check branch 13 | run: | 14 | echo "Error: Pull request against master is prohibited" 15 | exit 1 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vagrant 3 | *.iml 4 | out 5 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | # https://golangci-lint.run/usage/configuration/ 2 | run: 3 | timeout: 5m # 1m default times out on github-action runners 4 | 5 | output: 6 | # Sort results by: filepath, line and column. 7 | sort-results: true 8 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. 2 | 3 | This project contains software that is Copyright (c) 2015 Pivotal Software, Inc. 4 | 5 | This project is licensed to you under the Apache License, Version 2.0 (the "License"). 6 | 7 | You may not use this project except in compliance with the License. 8 | 9 | This project may include a number of subcomponents with separate copyright notices 10 | and license terms. Your use of these subcomponents is subject to the terms and 11 | conditions of the subcomponent's license, as noted in the LICENSE file. 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bosh-utils 2 | Generic packages extracted from bosh-agent and bosh-init 3 | 4 | # Dev Testing 5 | Make changes to develop and push. 6 | 7 | The CI pipeline [here](https://ci.bosh-ecosystem.cf-app.com/teams/main/pipelines/bosh-utils) will promote to master once the tests pass. Note the pipeline is not publicly accessible. 8 | -------------------------------------------------------------------------------- /assert/be_dir_matcher.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | type BeDir struct { 9 | } 10 | 11 | func (m BeDir) Match(actual interface{}) (bool, error) { 12 | path, ok := actual.(string) 13 | if !ok { 14 | return false, fmt.Errorf("`%s' is not a valid path", actual) 15 | } 16 | 17 | dir, err := os.Open(path) 18 | if err != nil { 19 | return false, fmt.Errorf("could not open `%s'", actual) 20 | } 21 | defer dir.Close() 22 | 23 | dirInfo, err := dir.Stat() 24 | if err != nil { 25 | return false, fmt.Errorf("could not stat `%s'", actual) 26 | } 27 | 28 | return dirInfo.IsDir(), nil 29 | } 30 | 31 | // FailureMessage (actual interface{}) (message string) 32 | func (m BeDir) FailureMessage(actual interface{}) string { 33 | return fmt.Sprintf("Expected `%s' to be a directory", actual) 34 | } 35 | 36 | // NegatedFailureMessage (actual interface{}) (message string) 37 | func (m BeDir) NegatedFailureMessage(actual interface{}) string { 38 | return fmt.Sprintf("Expected `%s' to not be a directory", actual) 39 | } 40 | -------------------------------------------------------------------------------- /bin/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | bin=$(dirname $0) 6 | 7 | if [[ "$GOOS" == 'linux' ]] && [[ "$GOARCH" == 'amd64' ]]; then 8 | export GOTOOLDIR=$(go env GOROOT)/pkg/linux_amd64 9 | fi 10 | 11 | CGO_ENABLED=0 go build -o $bin/../out/verify-multidigest github.com/cloudfoundry/bosh-utils/main 12 | -------------------------------------------------------------------------------- /bin/build-linux-amd64: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export GOARCH=amd64 6 | export GOOS=linux 7 | export GOTOOLDIR=$(go env GOROOT)/pkg/linux_amd64 8 | 9 | $(dirname $0)/build 10 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | bin=$(dirname $0) 6 | 7 | echo "Formatting packages..." 8 | go fmt $(go list github.com/cloudfoundry/bosh-utils/... | grep -v vendor) 9 | 10 | $bin/test-unit 11 | -------------------------------------------------------------------------------- /bin/test-unit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | bin=$(dirname $0) 5 | 6 | echo -e "\n Testing packages..." 7 | go run github.com/onsi/ginkgo/v2/ginkgo run -p -r --race --trace --keep-going "${@}" 8 | -------------------------------------------------------------------------------- /bin/test-unit.ps1: -------------------------------------------------------------------------------- 1 | trap { 2 | write-error $_ 3 | exit 1 4 | } 5 | 6 | go.exe version 7 | 8 | go.exe run github.com/onsi/ginkgo/v2/ginkgo -r -keep-going 9 | if ($LastExitCode -ne 0) 10 | { 11 | Write-Error $_ 12 | exit 1 13 | } 14 | -------------------------------------------------------------------------------- /blobstore/blobstore_interface.go: -------------------------------------------------------------------------------- 1 | package blobstore 2 | 3 | type Blobstore interface { 4 | Get(blobID string) (fileName string, err error) 5 | 6 | CleanUp(fileName string) (err error) 7 | 8 | Create(fileName string) (blobID string, err error) 9 | 10 | Validate() (err error) 11 | 12 | Delete(blobId string) (err error) 13 | } 14 | -------------------------------------------------------------------------------- /blobstore/blobstore_suite_test.go: -------------------------------------------------------------------------------- 1 | package blobstore_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestBlobstore(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Blobstore Suite") 13 | } 14 | -------------------------------------------------------------------------------- /blobstore/digest_blobstore_interface.go: -------------------------------------------------------------------------------- 1 | package blobstore 2 | 3 | import ( 4 | boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" 5 | ) 6 | 7 | type DigestBlobstore interface { 8 | // Assuming that local file system is available, 9 | // file handle is returned to downloaded blob. 10 | // Caller must not assume anything about layout of such scratch space. 11 | // Cleanup call is needed to properly cleanup downloaded blob. 12 | Get(blobID string, digest boshcrypto.Digest) (fileName string, err error) 13 | 14 | CleanUp(fileName string) (err error) 15 | 16 | Create(fileName string) (blobID string, digest boshcrypto.MultipleDigest, err error) 17 | 18 | Validate() (err error) 19 | 20 | Delete(blobId string) (err error) 21 | } 22 | -------------------------------------------------------------------------------- /blobstore/dummy_blobstore.go: -------------------------------------------------------------------------------- 1 | package blobstore 2 | 3 | type dummyBlobstore struct{} 4 | 5 | func newDummyBlobstore() dummyBlobstore { 6 | return dummyBlobstore{} 7 | } 8 | 9 | func (b dummyBlobstore) Get(blobID string) (string, error) { 10 | return "", nil 11 | } 12 | 13 | func (b dummyBlobstore) CleanUp(fileName string) error { 14 | return nil 15 | } 16 | 17 | func (b dummyBlobstore) Create(fileName string) (string, error) { 18 | return "", nil 19 | } 20 | 21 | func (b dummyBlobstore) Validate() error { 22 | return nil 23 | } 24 | 25 | func (b dummyBlobstore) Delete(blobID string) error { 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /blobstore/test_assets/some.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/blobstore/test_assets/some.config -------------------------------------------------------------------------------- /ci/README.md: -------------------------------------------------------------------------------- 1 | # Steps for Configuring the Pipeline 2 | 3 | Run the configure script 4 | -------------------------------------------------------------------------------- /ci/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | fly -t "${CONCOURSE_TARGET:-bosh-ecosystem}" set-pipeline -p bosh-utils -c ci/pipeline.yml 6 | -------------------------------------------------------------------------------- /ci/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bosh/golang-release 2 | 3 | RUN \ 4 | apt-get update \ 5 | && apt-get install -y \ 6 | lsof \ 7 | && apt-get clean \ 8 | && rm -rf /var/lib/apt/lists/* 9 | -------------------------------------------------------------------------------- /ci/tasks/build-multidigest-binary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -x -u 4 | 5 | base=$(pwd) 6 | export GOPATH=$(pwd)/gopath 7 | export PATH=/usr/local/ruby/bin:/usr/local/go/bin:$PATH 8 | 9 | 10 | semver=`cat version-semver/version` 11 | timestamp=`date -u +"%Y-%m-%dT%H:%M:%SZ"` 12 | filename="verify-multidigest-${semver}-${GOOS}-${GOARCH}" 13 | 14 | cd gopath/src/github.com/cloudfoundry/bosh-utils 15 | 16 | git_rev=`git rev-parse --short HEAD` 17 | version="${semver}-${git_rev}-${timestamp}" 18 | 19 | echo "building ${filename} with version ${version}" 20 | sed -i 's/\[DEV BUILD\]/'"$version"'/' main/version.go 21 | 22 | bin/build 23 | shasum -a 256 out/verify-multidigest 24 | 25 | mv out/verify-multidigest $base/out/${filename} 26 | -------------------------------------------------------------------------------- /ci/tasks/build-multidigest-binary.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: bosh/utils 8 | tag: latest 9 | 10 | inputs: 11 | - name: bosh-utils 12 | path: gopath/src/github.com/cloudfoundry/bosh-utils 13 | - name: version-semver 14 | 15 | outputs: 16 | - name: out 17 | 18 | params: 19 | GOOS: linux 20 | GOARCH: amd64 21 | 22 | run: 23 | path: gopath/src/github.com/cloudfoundry/bosh-utils/ci/tasks/build-multidigest-binary.sh 24 | -------------------------------------------------------------------------------- /ci/tasks/test-unit-windows.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: windows 3 | 4 | inputs: 5 | - name: bosh-utils 6 | path: gopath/src/github.com/cloudfoundry/bosh-utils 7 | 8 | run: 9 | path: powershell 10 | args: 11 | - "-ExecutionPolicy" 12 | - "Bypass" 13 | - "-File" 14 | - gopath/src/github.com/cloudfoundry/bosh-utils/ci/tasks/test-unit.ps1 15 | -------------------------------------------------------------------------------- /ci/tasks/test-unit.ps1: -------------------------------------------------------------------------------- 1 | trap { 2 | write-error $_ 3 | exit 1 4 | } 5 | 6 | $env:GOPATH = Join-Path -Path $PWD "gopath" 7 | $env:PATH = $env:GOPATH + "/bin;C:/bin;" + $env:PATH 8 | 9 | cd $env:GOPATH/src/github.com/cloudfoundry/bosh-utils 10 | 11 | if ((Get-Command "tar.exe" -ErrorAction SilentlyContinue) -eq $null) 12 | { 13 | Write-Host "Installing tar!" 14 | New-Item -ItemType directory -Path C:\bin -Force 15 | 16 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 17 | Invoke-WebRequest 'https://s3.amazonaws.com/bosh-windows-dependencies/tar-1490035387.exe' -OutFile C:\bin\tar.exe 18 | 19 | Write-Host "tar is installed!" 20 | } 21 | 22 | go.exe version 23 | 24 | go.exe run github.com/onsi/ginkgo/v2/ginkgo -r -keep-going --skip-package="vendor" 25 | if ($LastExitCode -ne 0) 26 | { 27 | Write-Error $_ 28 | exit 1 29 | } 30 | -------------------------------------------------------------------------------- /ci/tasks/test-unit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | cd bosh-utils 6 | bin/test-unit 7 | -------------------------------------------------------------------------------- /ci/tasks/test-unit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | platform: linux 3 | 4 | image_resource: 5 | type: docker-image 6 | source: 7 | repository: bosh/utils 8 | 9 | inputs: 10 | - name: bosh-utils 11 | 12 | run: 13 | path: bosh-utils/ci/tasks/test-unit.sh 14 | -------------------------------------------------------------------------------- /crypto/crypto_suite_test.go: -------------------------------------------------------------------------------- 1 | package crypto_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestReg(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Crypto Suite") 13 | } 14 | -------------------------------------------------------------------------------- /crypto/interfaces.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | "io" 5 | 6 | boshsys "github.com/cloudfoundry/bosh-utils/system" 7 | "os" 8 | ) 9 | 10 | type Digest interface { 11 | Verify(io.Reader) error 12 | VerifyFilePath(filePath string, fs boshsys.FileSystem) error 13 | Algorithm() Algorithm 14 | String() string 15 | } 16 | 17 | //go:generate counterfeiter . ArchiveDigestFilePathReader 18 | type ArchiveDigestFilePathReader interface { 19 | OpenFile(path string, flag int, perm os.FileMode) (boshsys.File, error) 20 | } 21 | 22 | var _ Digest = digestImpl{} 23 | var _ Digest = MultipleDigest{} 24 | 25 | type Algorithm interface { 26 | CreateDigest(io.Reader) (Digest, error) 27 | Name() string 28 | } 29 | 30 | var _ Algorithm = algorithmSHAImpl{} 31 | var _ Algorithm = unknownAlgorithmImpl{} 32 | -------------------------------------------------------------------------------- /crypto/x509.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | "crypto/x509" 5 | "encoding/pem" 6 | "strings" 7 | 8 | bosherr "github.com/cloudfoundry/bosh-utils/errors" 9 | ) 10 | 11 | func CertPoolFromPEM(pemCerts []byte) (*x509.CertPool, error) { 12 | certPool := x509.NewCertPool() 13 | 14 | for pemCertsIdx := 1; len(pemCerts) > 0; pemCertsIdx++ { 15 | var block *pem.Block 16 | 17 | block, pemCerts = pem.Decode(pemCerts) 18 | if block == nil { 19 | if strings.TrimSpace(string(pemCerts)) != "" { 20 | return nil, bosherr.Errorf("Parsing certificate %d: Missing PEM block", pemCertsIdx) 21 | } 22 | 23 | break 24 | } 25 | 26 | if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { 27 | return nil, bosherr.Errorf("Parsing certificate %d: Not a certificate", pemCertsIdx) 28 | } 29 | 30 | cert, err := x509.ParseCertificate(block.Bytes) 31 | if err != nil { 32 | return nil, bosherr.WrapErrorf(err, "Parsing certificate %d", pemCertsIdx) 33 | } 34 | 35 | certPool.AddCert(cert) 36 | } 37 | 38 | return certPool, nil 39 | } 40 | -------------------------------------------------------------------------------- /errors/errors_suite_test.go: -------------------------------------------------------------------------------- 1 | package errors_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestHandler(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Errors Suite") 13 | } 14 | -------------------------------------------------------------------------------- /errors/multi_error.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | type MultiError struct { 8 | Errors []error 9 | } 10 | 11 | func NewMultiError(errors ...error) error { 12 | return MultiError{Errors: errors} 13 | } 14 | 15 | func (e MultiError) Error() string { 16 | errors := make([]string, len(e.Errors), len(e.Errors)) //nolint:gosimple 17 | for i, err := range e.Errors { 18 | errors[i] = err.Error() 19 | } 20 | return strings.Join(errors, "\n") 21 | } 22 | -------------------------------------------------------------------------------- /errors/multi_error_test.go: -------------------------------------------------------------------------------- 1 | package errors_test 2 | 3 | import ( 4 | "errors" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | 9 | . "github.com/cloudfoundry/bosh-utils/errors" 10 | ) 11 | 12 | var _ = Describe("MultiError", func() { 13 | Describe("Error", func() { 14 | Context("when reasons are given", func() { 15 | It("returns each reason as bullet points", func() { 16 | err := NewMultiError(errors.New("reason 1"), errors.New("reason 2")) 17 | Expect(err.Error()).To(Equal("reason 1\nreason 2")) 18 | }) 19 | }) 20 | 21 | Context("when no reasons are given", func() { 22 | It("returns empty string", func() { 23 | err := NewMultiError() 24 | Expect(err.Error()).To(Equal("")) 25 | }) 26 | }) 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /fileutil/compressor_interface.go: -------------------------------------------------------------------------------- 1 | package fileutil 2 | 3 | type CompressorOptions struct { 4 | SameOwner bool 5 | PathInArchive string 6 | StripComponents int 7 | } 8 | 9 | type Compressor interface { 10 | // CompressFilesInDir returns path to a compressed file 11 | CompressFilesInDir(dir string) (path string, err error) 12 | 13 | CompressSpecificFilesInDir(dir string, files []string) (path string, err error) 14 | 15 | DecompressFileToDir(path string, dir string, options CompressorOptions) (err error) 16 | 17 | // CleanUp cleans up compressed file after it was used 18 | CleanUp(path string) error 19 | } 20 | -------------------------------------------------------------------------------- /fileutil/copier_interface.go: -------------------------------------------------------------------------------- 1 | package fileutil 2 | 3 | type Copier interface { 4 | FilteredMultiCopyToTemp(dirs []DirToCopy, filters []string) (string, error) 5 | FilteredCopyToTemp(dir string, filters []string) (tempDir string, err error) 6 | CleanUp(tempDir string) 7 | } 8 | -------------------------------------------------------------------------------- /fileutil/mover.go: -------------------------------------------------------------------------------- 1 | package fileutil 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | "syscall" 7 | 8 | boshsys "github.com/cloudfoundry/bosh-utils/system" 9 | ) 10 | 11 | type fileMover struct { 12 | fs boshsys.FileSystem 13 | } 14 | 15 | func NewFileMover(fs boshsys.FileSystem) fileMover { 16 | return fileMover{fs: fs} 17 | } 18 | 19 | func (m fileMover) Move(oldPath, newPath string) error { 20 | err := m.fs.Rename(oldPath, newPath) 21 | 22 | le, ok := err.(*os.LinkError) 23 | if !ok { 24 | return err 25 | } 26 | 27 | // 0x11 is Win32 Error Code ERROR_NOT_SAME_DEVICE (https://msdn.microsoft.com/en-us/library/cc231199.aspx) 28 | if le.Err == syscall.Errno(0x12) || (runtime.GOOS == "windows" && le.Err == syscall.Errno(0x11)) { 29 | err = m.fs.CopyFile(oldPath, newPath) 30 | if err != nil { 31 | return err 32 | } 33 | 34 | err = m.fs.RemoveAll(oldPath) 35 | if err != nil { 36 | return err 37 | } 38 | 39 | return nil 40 | } 41 | 42 | return err 43 | } 44 | -------------------------------------------------------------------------------- /fileutil/mover_interface.go: -------------------------------------------------------------------------------- 1 | package fileutil 2 | 3 | type Mover interface { 4 | Move(string, string) error 5 | } 6 | -------------------------------------------------------------------------------- /fileutil/test_assets/compressor-decompress-file-to-dir.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/compressor-decompress-file-to-dir.tgz -------------------------------------------------------------------------------- /fileutil/test_assets/compressor-decompress-owner-root.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/compressor-decompress-owner-root.tgz -------------------------------------------------------------------------------- /fileutil/test_assets/compressor-decompress-with-links.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/compressor-decompress-with-links.tgz -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/fixture_dir/.keep -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/app.stderr.log: -------------------------------------------------------------------------------- 1 | this is app stderr 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/app.stdout.log: -------------------------------------------------------------------------------- 1 | this is app stdout 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/other_logs/more_logs/more.stdout.log: -------------------------------------------------------------------------------- 1 | this is more stdout 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/other_logs/other_app.stderr.log: -------------------------------------------------------------------------------- 1 | this is other app stderr 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/other_logs/other_app.stdout.log: -------------------------------------------------------------------------------- 1 | this is other app stdout 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/fixture_dir/some_directory/sub_dir/other_sub_dir/.keep: -------------------------------------------------------------------------------- 1 | this is a .keep file 2 | -------------------------------------------------------------------------------- /fileutil/test_assets/symlink_target/app.stdout.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/symlink_target/app.stdout.log -------------------------------------------------------------------------------- /fileutil/test_assets/symlink_target/sub_dir/sub_app.stdout.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/fileutil/test_assets/symlink_target/sub_dir/sub_app.stdout.log -------------------------------------------------------------------------------- /httpclient/httpclient_suite_test.go: -------------------------------------------------------------------------------- 1 | package httpclient_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestHttpclient(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Httpclient Suite") 13 | } 14 | -------------------------------------------------------------------------------- /httpclient/mutual_tls_client.go: -------------------------------------------------------------------------------- 1 | package httpclient 2 | 3 | import ( 4 | "crypto/tls" 5 | "crypto/x509" 6 | "net" 7 | "net/http" 8 | "time" 9 | 10 | "github.com/pivotal-cf/paraphernalia/secure/tlsconfig" 11 | ) 12 | 13 | func NewMutualTLSClient(identity tls.Certificate, caCertPool *x509.CertPool, serverName string) *http.Client { 14 | tlsConfig := tlsconfig.Build( 15 | tlsconfig.WithIdentity(identity), 16 | tlsconfig.WithInternalServiceDefaults(), 17 | ) 18 | 19 | clientConfig := tlsConfig.Client(tlsconfig.WithAuthority(caCertPool)) 20 | clientConfig.BuildNameToCertificate() //nolint:staticcheck 21 | clientConfig.ServerName = serverName 22 | 23 | return &http.Client{ 24 | Transport: &http.Transport{ 25 | DialContext: (&net.Dialer{ 26 | Timeout: 30 * time.Second, 27 | KeepAlive: 30 * time.Second, 28 | DualStack: true, 29 | }).DialContext, 30 | MaxIdleConns: 100, 31 | IdleConnTimeout: 90 * time.Second, 32 | TLSHandshakeTimeout: 10 * time.Second, 33 | ExpectContinueTimeout: 1 * time.Second, 34 | TLSClientConfig: clientConfig, 35 | }, 36 | Timeout: 10 * time.Second, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /logger/file/file_logger.go: -------------------------------------------------------------------------------- 1 | package file 2 | 3 | import ( 4 | "os" 5 | 6 | bosherr "github.com/cloudfoundry/bosh-utils/errors" 7 | boshlog "github.com/cloudfoundry/bosh-utils/logger" 8 | boshsys "github.com/cloudfoundry/bosh-utils/system" 9 | ) 10 | 11 | const DefaultLogFileMode = os.FileMode(0666) 12 | 13 | // New returns a new logger (that writes to the specified file) & the open file handle 14 | // All log levels >= the specified level are written to the specified file. 15 | // User is responsible for closing the returned file handle, unless an error is returned. 16 | func New(level boshlog.LogLevel, filePath string, fileMode os.FileMode, fs boshsys.FileSystem) (boshlog.Logger, boshsys.File, error) { 17 | file, err := fs.OpenFile(filePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, fileMode) 18 | if err != nil { 19 | return nil, file, bosherr.WrapErrorf(err, "Failed to open log file '%s'", filePath) 20 | } 21 | 22 | return boshlog.NewWriterLogger(level, file), file, nil 23 | } 24 | -------------------------------------------------------------------------------- /logger/file/file_suite_test.go: -------------------------------------------------------------------------------- 1 | package file_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestLogger(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "File Logger Suite") 13 | } 14 | -------------------------------------------------------------------------------- /logger/logger_suite_test.go: -------------------------------------------------------------------------------- 1 | package logger_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestLogger(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Logger Suite") 13 | } 14 | -------------------------------------------------------------------------------- /main/main_suite_test.go: -------------------------------------------------------------------------------- 1 | package main_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | "github.com/onsi/gomega/gexec" 7 | 8 | "testing" 9 | ) 10 | 11 | var verifyMultidigestBinPath string 12 | 13 | func TestVerifyMultidigestMain(t *testing.T) { 14 | RegisterFailHandler(Fail) 15 | RunSpecs(t, "Verify Multidigest (main) Suite") 16 | } 17 | 18 | var _ = SynchronizedBeforeSuite(func() []byte { 19 | verifyMultidigestBin, err := gexec.Build("github.com/cloudfoundry/bosh-utils/main") 20 | Expect(err).NotTo(HaveOccurred()) 21 | 22 | return []byte(verifyMultidigestBin) 23 | }, func(data []byte) { 24 | verifyMultidigestBinPath = string(data) 25 | }) 26 | 27 | var _ = SynchronizedAfterSuite(func() {}, func() { 28 | gexec.CleanupBuildArtifacts() 29 | }) 30 | -------------------------------------------------------------------------------- /main/version.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | const VersionLabel = "[DEV BUILD]" 4 | -------------------------------------------------------------------------------- /property/list.go: -------------------------------------------------------------------------------- 1 | package property 2 | 3 | type List []Property 4 | -------------------------------------------------------------------------------- /property/map.go: -------------------------------------------------------------------------------- 1 | package property 2 | 3 | type Map map[string]Property 4 | 5 | func (m *Map) UnmarshalYAML(unmarshal func(interface{}) error) error { 6 | rawMap := map[interface{}]interface{}{} 7 | err := unmarshal(&rawMap) 8 | if err != nil { 9 | return err 10 | } 11 | 12 | *m, err = BuildMap(rawMap) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /property/map_test.go: -------------------------------------------------------------------------------- 1 | package property_test 2 | 3 | import ( 4 | . "github.com/cloudfoundry/bosh-utils/property" 5 | . "github.com/onsi/ginkgo/v2" 6 | . "github.com/onsi/gomega" 7 | "gopkg.in/yaml.v2" 8 | ) 9 | 10 | var _ = Describe("Map", func() { 11 | It("can be unmarshaled from yaml", func() { 12 | expectedMap := Map{"foo": Map{"bar": List{"baz", "asdf"}}} 13 | 14 | inputYAML := ` 15 | foo: 16 | bar: 17 | - baz 18 | - asdf 19 | ` 20 | target := Map{} 21 | err := yaml.Unmarshal([]byte(inputYAML), &target) 22 | Expect(err).ToNot(HaveOccurred()) 23 | Expect(target).To(Equal(expectedMap)) 24 | }) 25 | }) 26 | -------------------------------------------------------------------------------- /property/property.go: -------------------------------------------------------------------------------- 1 | package property 2 | 3 | // Property represents a constrained value which can be a Map, a List, or a primitive. 4 | // If the property is a Map, keys must be strings and values are properties. 5 | // These constraints are only enforced by the builder functions: Build, BuildMap, and BuildList. 6 | type Property interface{} 7 | -------------------------------------------------------------------------------- /property/property_suite_test.go: -------------------------------------------------------------------------------- 1 | package property_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestReg(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Property Suite") 13 | } 14 | -------------------------------------------------------------------------------- /retrystrategy/attempt_retry_strategy.go: -------------------------------------------------------------------------------- 1 | package retrystrategy 2 | 3 | import ( 4 | "time" 5 | 6 | boshlog "github.com/cloudfoundry/bosh-utils/logger" 7 | ) 8 | 9 | type attemptRetryStrategy struct { 10 | maxAttempts int 11 | delay time.Duration 12 | retryable Retryable 13 | logger boshlog.Logger 14 | logTag string 15 | } 16 | 17 | func NewAttemptRetryStrategy( 18 | maxAttempts int, 19 | delay time.Duration, 20 | retryable Retryable, 21 | logger boshlog.Logger, 22 | ) RetryStrategy { 23 | return &attemptRetryStrategy{ 24 | maxAttempts: maxAttempts, 25 | delay: delay, 26 | retryable: retryable, 27 | logger: logger, 28 | logTag: "attemptRetryStrategy", 29 | } 30 | } 31 | 32 | func (s *attemptRetryStrategy) Try() error { 33 | var err error 34 | var shouldRetry bool 35 | 36 | for i := 0; i < s.maxAttempts; i++ { 37 | s.logger.Debug(s.logTag, "Making attempt #%d for %T", i, s.retryable) 38 | 39 | shouldRetry, err = s.retryable.Attempt() 40 | if !shouldRetry { 41 | return err 42 | } 43 | 44 | time.Sleep(s.delay) 45 | } 46 | 47 | return err 48 | } 49 | -------------------------------------------------------------------------------- /retrystrategy/fakes/fake_retry_strategy.go: -------------------------------------------------------------------------------- 1 | package fakes 2 | 3 | type FakeRetryStrategy struct { 4 | TryCalled bool 5 | TryErr error 6 | } 7 | 8 | func NewFakeRetryStrategy() *FakeRetryStrategy { 9 | return &FakeRetryStrategy{} 10 | } 11 | 12 | func (s *FakeRetryStrategy) Try() error { 13 | s.TryCalled = true 14 | return s.TryErr 15 | } 16 | -------------------------------------------------------------------------------- /retrystrategy/retry_strategy.go: -------------------------------------------------------------------------------- 1 | package retrystrategy 2 | 3 | type RetryStrategy interface { 4 | Try() error 5 | } 6 | 7 | type Retryable interface { 8 | Attempt() (shouldRetry bool, err error) 9 | } 10 | 11 | type retryable struct { 12 | attemptFunc func() (bool, error) 13 | } 14 | 15 | func (r *retryable) Attempt() (bool, error) { 16 | return r.attemptFunc() 17 | } 18 | 19 | func NewRetryable(attemptFunc func() (bool, error)) Retryable { 20 | return &retryable{ 21 | attemptFunc: attemptFunc, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /retrystrategy/retrystrategy_suite_test.go: -------------------------------------------------------------------------------- 1 | package retrystrategy_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestRetrystrategy(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Retrystrategy Suite") 13 | } 14 | 15 | type simpleRetryable struct { 16 | attemptOutputs []attemptOutput 17 | Attempts int 18 | } 19 | 20 | type attemptOutput struct { 21 | ShouldRetry bool 22 | AttemptErr error 23 | } 24 | 25 | func newSimpleRetryable(attemptOutputs []attemptOutput) *simpleRetryable { 26 | return &simpleRetryable{ 27 | attemptOutputs: attemptOutputs, 28 | } 29 | } 30 | 31 | func (r *simpleRetryable) Attempt() (bool, error) { 32 | r.Attempts++ 33 | 34 | if len(r.attemptOutputs) > 0 { 35 | attemptOutput := r.attemptOutputs[0] 36 | r.attemptOutputs = r.attemptOutputs[1:] 37 | return attemptOutput.ShouldRetry, attemptOutput.AttemptErr 38 | } 39 | 40 | return true, nil 41 | } 42 | -------------------------------------------------------------------------------- /retrystrategy/unlimited_retry_strategy.go: -------------------------------------------------------------------------------- 1 | package retrystrategy 2 | 3 | import ( 4 | "time" 5 | 6 | boshlog "github.com/cloudfoundry/bosh-utils/logger" 7 | ) 8 | 9 | type unlimitedRetryStrategy struct { 10 | maxAttempts int //nolint:unused 11 | delay time.Duration 12 | retryable Retryable 13 | logger boshlog.Logger 14 | logTag string 15 | } 16 | 17 | func NewUnlimitedRetryStrategy( 18 | delay time.Duration, 19 | retryable Retryable, 20 | logger boshlog.Logger, 21 | ) RetryStrategy { 22 | return &unlimitedRetryStrategy{ 23 | delay: delay, 24 | retryable: retryable, 25 | logger: logger, 26 | logTag: "unlimitedRetryStrategy", 27 | } 28 | } 29 | 30 | func (s *unlimitedRetryStrategy) Try() error { 31 | var err error 32 | var shouldRetry bool 33 | for i := 0; ; i++ { 34 | s.logger.Debug(s.logTag, "Making attempt #%d", i) 35 | 36 | shouldRetry, err = s.retryable.Attempt() 37 | if !shouldRetry { 38 | return err 39 | } 40 | 41 | time.Sleep(s.delay) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/child_ignore_term/child_ignore_term.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func main() { 11 | fmt.Printf("child_pid=%d\n", os.Getpid()) 12 | 13 | sigCh := make(chan os.Signal, 1) 14 | signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGKILL) //nolint:staticcheck 15 | 16 | go func() { 17 | for { 18 | switch <-sigCh { 19 | case syscall.SIGTERM: 20 | fmt.Printf("Child received SIGTERM\n") 21 | case syscall.SIGKILL: 22 | fmt.Printf("Child received SIGKILL\n") 23 | } 24 | } 25 | }() 26 | 27 | select {} 28 | } 29 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/child_term/child_term.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func main() { 11 | fmt.Printf("child_pid=%d\n", os.Getpid()) 12 | 13 | sigTermCh := make(chan os.Signal, 1) 14 | signal.Notify(sigTermCh, syscall.SIGTERM) 15 | 16 | go func() { 17 | <-sigTermCh 18 | fmt.Printf("Child received SIGTERM") 19 | os.Exit(14) 20 | }() 21 | 22 | select {} 23 | } 24 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/exe_exits/exe_exits.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func main() { 11 | sigCh := make(chan os.Signal, 1) 12 | signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGKILL) //nolint:staticcheck 13 | 14 | go func() { 15 | for { 16 | switch <-sigCh { 17 | case syscall.SIGTERM: 18 | fmt.Printf("Exe received SIGTERM\n") 19 | case syscall.SIGKILL: 20 | fmt.Printf("Exe received SIGKILL\n") 21 | } 22 | } 23 | }() 24 | 25 | // Exit immediately 26 | os.Exit(0) 27 | } 28 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/false/false.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "os" 4 | 5 | func main() { 6 | os.Exit(1) 7 | } 8 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/parent_ignore_term/parent_ignore_term.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | "os/signal" 8 | "path/filepath" 9 | "syscall" 10 | ) 11 | 12 | func main() { 13 | fmt.Printf("parent_pid=%d\n", os.Getpid()) 14 | 15 | sigCh := make(chan os.Signal, 1) 16 | signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGKILL) //nolint:staticcheck 17 | 18 | go func() { 19 | for { 20 | switch <-sigCh { 21 | case syscall.SIGTERM: 22 | fmt.Printf("Parent received SIGTERM\n") 23 | case syscall.SIGKILL: 24 | fmt.Printf("Parent received SIGKILL\n") 25 | } 26 | } 27 | }() 28 | 29 | // Compiled by tests 30 | cmd := exec.Command(filepath.Join(filepath.Dir(os.Args[0]), "child_ignore_term")) 31 | cmd.Stdout = os.Stdout 32 | cmd.Stderr = os.Stderr 33 | cmd.Run() //nolint:errcheck 34 | 35 | // Keep on running even if child dies 36 | select {} 37 | } 38 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/parent_term/parent_term.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | "os/signal" 8 | "path/filepath" 9 | "syscall" 10 | ) 11 | 12 | func main() { 13 | fmt.Printf("parent_pid=%d\n", os.Getpid()) 14 | 15 | sigTermCh := make(chan os.Signal, 1) 16 | signal.Notify(sigTermCh, syscall.SIGTERM) 17 | 18 | go func() { 19 | <-sigTermCh 20 | fmt.Printf("Parent received SIGTERM") 21 | os.Exit(13) 22 | }() 23 | 24 | // Compiled by tests 25 | cmd := exec.Command(filepath.Join(filepath.Dir(os.Args[0]), "child_term")) 26 | cmd.Stdout = os.Stdout 27 | cmd.Stderr = os.Stderr 28 | cmd.Run() //nolint:errcheck 29 | 30 | // Keep on running even if child dies 31 | select {} 32 | } 33 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_fixtures/windows_exe/windows_exe.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/signal" 7 | "syscall" 8 | ) 9 | 10 | func main() { 11 | sigCh := make(chan os.Signal, 1) 12 | 13 | signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGKILL) //nolint:staticcheck 14 | 15 | done := make(chan struct{}) 16 | var exitStatus int 17 | go func() { 18 | defer close(done) 19 | sig := <-sigCh 20 | switch s := sig.String(); s { 21 | case "SIGTERM": 22 | fmt.Println("Received SIGTERM") 23 | exitStatus = 13 24 | case "SIGKILL": 25 | fmt.Println("Received SIGKILL") 26 | exitStatus = 27 27 | default: 28 | fmt.Printf("Received unhandled signal: %s\n", s) 29 | exitStatus = 17 30 | } 31 | }() 32 | 33 | <-done 34 | os.Exit(exitStatus) 35 | } 36 | -------------------------------------------------------------------------------- /system/exec_cmd_runner_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package system 5 | 6 | import ( 7 | "strings" 8 | ) 9 | 10 | // mergeEnv merges system and command environments variables. Command variables 11 | // override any system variable with the same key. 12 | func mergeEnv(sysEnv []string, cmdEnv map[string]string) []string { 13 | var env []string 14 | // cmdEnv has precedence and overwrites any duplicate vars 15 | for k, v := range cmdEnv { 16 | env = append(env, k+"="+v) 17 | } 18 | for _, s := range sysEnv { 19 | if n := strings.IndexByte(s, '='); n != -1 { 20 | k := s[:n] // key 21 | if _, found := cmdEnv[k]; !found { 22 | env = append(env, s) 23 | } 24 | } 25 | } 26 | return env 27 | } 28 | -------------------------------------------------------------------------------- /system/fakes/fakes_suite_test.go: -------------------------------------------------------------------------------- 1 | package fakes_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestSystem(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "System Fakes Suite") 13 | } 14 | -------------------------------------------------------------------------------- /system/test_assets/test_copy_dir_entries/bar/bar.txt: -------------------------------------------------------------------------------- 1 | bar 2 | -------------------------------------------------------------------------------- /system/test_assets/test_copy_dir_entries/bar/baz/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/system/test_assets/test_copy_dir_entries/bar/baz/.gitkeep -------------------------------------------------------------------------------- /system/test_assets/test_copy_dir_entries/foo.txt: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /tools/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | package tools 5 | 6 | import ( 7 | _ "github.com/maxbrunsfeld/counterfeiter/v6" 8 | ) 9 | 10 | // This file imports packages that are used when running go generate, or used 11 | // during the development process but not otherwise depended on by built code. 12 | -------------------------------------------------------------------------------- /uuid/fakes/fake_generator.go: -------------------------------------------------------------------------------- 1 | package fakes 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type FakeGenerator struct { 8 | GeneratedUUID string 9 | NextUUID int 10 | GenerateError error 11 | } 12 | 13 | func NewFakeGenerator() *FakeGenerator { 14 | return &FakeGenerator{} 15 | } 16 | 17 | func (gen *FakeGenerator) Generate() (uuid string, err error) { 18 | if gen.GeneratedUUID == "" && gen.GenerateError == nil { 19 | uuidString := fmt.Sprintf("fake-uuid-%d", gen.NextUUID) 20 | gen.NextUUID++ 21 | return uuidString, nil 22 | } 23 | return gen.GeneratedUUID, gen.GenerateError 24 | } 25 | -------------------------------------------------------------------------------- /uuid/generator_interface.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | type Generator interface { 4 | Generate() (uuid string, err error) 5 | } 6 | -------------------------------------------------------------------------------- /uuid/uuid_suite_test.go: -------------------------------------------------------------------------------- 1 | package uuid_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestUuid(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Uuid Suite") 13 | } 14 | -------------------------------------------------------------------------------- /uuid/uuid_v4_generator.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | bosherr "github.com/cloudfoundry/bosh-utils/errors" 5 | gouuid "github.com/nu7hatch/gouuid" 6 | ) 7 | 8 | type uuidV4Generator struct { 9 | } 10 | 11 | func NewGenerator() (gen Generator) { 12 | return uuidV4Generator{} 13 | } 14 | 15 | func (gen uuidV4Generator) Generate() (uuidStr string, err error) { 16 | uuid, err := gouuid.NewV4() 17 | if err != nil { 18 | err = bosherr.WrapError(err, "Generating V4 uuid") 19 | return 20 | } 21 | 22 | uuidStr = uuid.String() 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /uuid/uuid_v4_generator_test.go: -------------------------------------------------------------------------------- 1 | package uuid_test 2 | 3 | import ( 4 | "regexp" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | 9 | . "github.com/cloudfoundry/bosh-utils/uuid" 10 | ) 11 | 12 | func init() { 13 | Describe("Testing with Ginkgo", func() { 14 | It("generate", func() { 15 | 16 | generator := NewGenerator() 17 | 18 | uuid, err := generator.Generate() 19 | Expect(err).ToNot(HaveOccurred()) 20 | 21 | uuidFormat := "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" 22 | uuidRegexp, _ := regexp.Compile(uuidFormat) 23 | Expect(uuidRegexp.MatchString(uuid)).To(BeTrue()) 24 | }) 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. 2 | 3 | This project contains software that is Copyright (c) 2015 Pivotal Software, Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | 17 | This project may include a number of subcomponents with separate 18 | copyright notices and license terms. Your use of these subcomponents 19 | is subject to the terms and conditions of each subcomponent's license, 20 | as noted in the LICENSE file. 21 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/README.md: -------------------------------------------------------------------------------- 1 | # clock 2 | 3 | **Note**: This repository should be imported as `code.cloudfoundry.org/clock`. 4 | 5 | Provides a `Clock` interface, useful for injecting time dependencies in tests. 6 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/fakeclock/fake_ticker.go: -------------------------------------------------------------------------------- 1 | package fakeclock 2 | 3 | import ( 4 | "time" 5 | 6 | "code.cloudfoundry.org/clock" 7 | ) 8 | 9 | type fakeTicker struct { 10 | timer clock.Timer 11 | } 12 | 13 | func newFakeTicker(timer *fakeTimer) *fakeTicker { 14 | return &fakeTicker{ 15 | timer: timer, 16 | } 17 | } 18 | 19 | func (ft *fakeTicker) C() <-chan time.Time { 20 | return ft.timer.C() 21 | } 22 | 23 | func (ft *fakeTicker) Stop() { 24 | ft.timer.Stop() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/fakeclock/package.go: -------------------------------------------------------------------------------- 1 | package fakeclock // import "code.cloudfoundry.org/clock/fakeclock" 2 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/package.go: -------------------------------------------------------------------------------- 1 | package clock // import "code.cloudfoundry.org/clock" 2 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/ticker.go: -------------------------------------------------------------------------------- 1 | package clock 2 | 3 | import "time" 4 | 5 | type Ticker interface { 6 | C() <-chan time.Time 7 | Stop() 8 | } 9 | 10 | type realTicker struct { 11 | t *time.Ticker 12 | } 13 | 14 | func (t *realTicker) C() <-chan time.Time { 15 | return t.t.C 16 | } 17 | 18 | func (t *realTicker) Stop() { 19 | t.t.Stop() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/clock/timer.go: -------------------------------------------------------------------------------- 1 | package clock 2 | 3 | import "time" 4 | 5 | type Timer interface { 6 | C() <-chan time.Time 7 | Reset(d time.Duration) bool 8 | Stop() bool 9 | } 10 | 11 | type realTimer struct { 12 | t *time.Timer 13 | } 14 | 15 | func (t *realTimer) C() <-chan time.Time { 16 | return t.t.C 17 | } 18 | 19 | func (t *realTimer) Reset(d time.Duration) bool { 20 | return t.t.Reset(d) 21 | } 22 | 23 | func (t *realTimer) Stop() bool { 24 | return t.t.Stop() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/tlsconfig/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories 15 | vendor/ 16 | 17 | # Go workspace file 18 | go.work -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/tlsconfig/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @cloudfoundry/wg-app-runtime-platform-diego-approvers 2 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/tlsconfig/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | This project may include a number of subcomponents with separate 16 | copyright notices and license terms. Your use of these subcomponents 17 | is subject to the terms and conditions of each subcomponent's license, 18 | as noted in the LICENSE file. 19 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/tlsconfig/staticcheck.conf: -------------------------------------------------------------------------------- 1 | checks = ["all", "-ST1008","-ST1005","-ST1001","-ST1012","-ST1000","-ST1003","-ST1016","-ST1020","-ST1021","-ST1022"] 2 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/tlsconfig/verify.go: -------------------------------------------------------------------------------- 1 | package tlsconfig 2 | 3 | import ( 4 | "crypto/x509" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | const timeFormat = "2006-01-02 15:04:05 MST" 10 | 11 | func checkExpiration(cert *x509.Certificate) error { 12 | now := time.Now() 13 | 14 | if now.Before(cert.NotBefore) { 15 | return fmt.Errorf("certificate is not yet valid: validity starts at %s but current time is %s", cert.NotBefore.Format(timeFormat), now.Format(timeFormat)) 16 | } 17 | 18 | if now.After(cert.NotAfter) { 19 | return fmt.Errorf("certificate has expired: validity ended at %s but current time is %s", cert.NotAfter.Format(timeFormat), now.Format(timeFormat)) 20 | } 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/bmatcuk/doublestar/.gitignore: -------------------------------------------------------------------------------- 1 | # vi 2 | *~ 3 | *.swp 4 | *.swo 5 | 6 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 7 | *.o 8 | *.a 9 | *.so 10 | 11 | # Folders 12 | _obj 13 | _test 14 | 15 | # Architecture specific extensions/prefixes 16 | *.[568vq] 17 | [568vq].out 18 | 19 | *.cgo1.go 20 | *.cgo2.c 21 | _cgo_defun.c 22 | _cgo_gotypes.go 23 | _cgo_export.* 24 | 25 | _testmain.go 26 | 27 | *.exe 28 | *.test 29 | *.prof 30 | 31 | # test directory 32 | test/ 33 | -------------------------------------------------------------------------------- /vendor/github.com/bmatcuk/doublestar/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.12 5 | - 1.13 6 | - 1.14 7 | 8 | os: 9 | - linux 10 | - windows 11 | 12 | before_install: 13 | - go get -t -v ./... 14 | 15 | script: 16 | - go test -race -coverprofile=coverage.txt -covermode=atomic 17 | 18 | after_success: 19 | - bash <(curl -s https://codecov.io/bash) 20 | 21 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/go-socks5/.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 | .idea 24 | go.sum 25 | vendor 26 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/go-socks5/.golangci.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | linters: 4 | default: standard 5 | 6 | settings: 7 | errcheck: 8 | check-blank: true # assignment to blank identifier: `_ := someFunc()`. 9 | 10 | formatters: 11 | enable: 12 | - goimports 13 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/go-socks5/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.1 4 | - tip 5 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/go-socks5/credentials.go: -------------------------------------------------------------------------------- 1 | package socks5 2 | 3 | // CredentialStore is used to support user/pass authentication 4 | type CredentialStore interface { 5 | Valid(user, password string) bool 6 | } 7 | 8 | // StaticCredentials enables using a map directly as a credential store 9 | type StaticCredentials map[string]string 10 | 11 | func (s StaticCredentials) Valid(user, password string) bool { 12 | pass, ok := s[user] 13 | if !ok { 14 | return false 15 | } 16 | return password == pass 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/go-socks5/resolver.go: -------------------------------------------------------------------------------- 1 | package socks5 2 | 3 | import ( 4 | "net" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // NameResolver is used to implement custom name resolution 10 | type NameResolver interface { 11 | Resolve(ctx context.Context, name string) (context.Context, net.IP, error) 12 | } 13 | 14 | // DNSResolver uses the system DNS to resolve host names 15 | type DNSResolver struct{} 16 | 17 | func (d DNSResolver) Resolve(ctx context.Context, name string) (context.Context, net.IP, error) { 18 | addr, err := net.ResolveIPAddr("ip", name) 19 | if err != nil { 20 | return ctx, nil, err 21 | } 22 | return ctx, addr.IP, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/socks5-proxy/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/socks5-proxy/.golangci.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | linters: 4 | default: standard 5 | 6 | settings: 7 | errcheck: 8 | check-blank: true # assignment to blank identifier: `_ := someFunc()`. 9 | 10 | formatters: 11 | enable: 12 | - goimports 13 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/socks5-proxy/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-Present CloudFoundry.org Foundation, Inc. All Rights Reserved. 2 | 3 | This project is licensed to you under the Apache License, Version 2.0 (the "License"). 4 | You may not use this project except in compliance with the License. 5 | 6 | This project may include a number of subcomponents with separate copyright notices 7 | and license terms. Your use of these subcomponents is subject to the terms and 8 | conditions of the subcomponent's license, as noted in the LICENSE file. 9 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/socks5-proxy/README.md: -------------------------------------------------------------------------------- 1 | # socks5-proxy 2 | This is a go library for starting a socks5 proxy server via SSH. 3 | 4 | It is intended to be used as a library by Golang CLIs that need to proxy via an SSH jumpbox, which is a common configuration for BOSH operators, so several CLIs in Cloud Foundry could benefit from its use. 5 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry/socks5-proxy/ssh_client_config.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/crypto/ssh" 7 | ) 8 | 9 | func NewSSHClientConfig(user string, hostKeyCallback ssh.HostKeyCallback, authMethods ...ssh.AuthMethod) *ssh.ClientConfig { 10 | return &ssh.ClientConfig{ 11 | Timeout: 30 * time.Second, 12 | User: user, 13 | HostKeyCallback: hostKeyCallback, 14 | Auth: authMethods, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /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/go-logr/logr/.golangci.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | run: 4 | timeout: 1m 5 | tests: true 6 | 7 | linters: 8 | default: none 9 | enable: # please keep this alphabetized 10 | - asasalint 11 | - asciicheck 12 | - copyloopvar 13 | - dupl 14 | - errcheck 15 | - forcetypeassert 16 | - goconst 17 | - gocritic 18 | - govet 19 | - ineffassign 20 | - misspell 21 | - musttag 22 | - revive 23 | - staticcheck 24 | - unused 25 | 26 | issues: 27 | max-issues-per-linter: 0 28 | max-same-issues: 10 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-logr/logr/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## v1.0.0-rc1 4 | 5 | This is the first logged release. Major changes (including breaking changes) 6 | have occurred since earlier tags. 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-logr/logr/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Logr is open to pull-requests, provided they fit within the intended scope of 4 | the project. Specifically, this library aims to be VERY small and minimalist, 5 | with no external dependencies. 6 | 7 | ## Compatibility 8 | 9 | This project intends to follow [semantic versioning](http://semver.org) and 10 | is very strict about compatibility. Any proposed changes MUST follow those 11 | rules. 12 | 13 | ## Performance 14 | 15 | As a logging library, logr must be as light-weight as possible. Any proposed 16 | code change must include results of running the [benchmark](./benchmark) 17 | before and after the change. 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-logr/logr/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | If you have discovered a security vulnerability in this project, please report it 4 | privately. **Do not disclose it as a public issue.** This gives us time to work with you 5 | to fix the issue before public exposure, reducing the chance that the exploit will be 6 | used before a patch is released. 7 | 8 | You may submit the report in the following ways: 9 | 10 | - send an email to go-logr-security@googlegroups.com 11 | - send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new) 12 | 13 | Please provide the following information in your report: 14 | 15 | - A description of the vulnerability and its impact 16 | - How to reproduce the issue 17 | 18 | We ask that you give us 90 days to work on a fix before public exposure. 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-logr/logr/discard.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 The logr Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package logr 18 | 19 | // Discard returns a Logger that discards all messages logged to it. It can be 20 | // used whenever the caller is not interested in the logs. Logger instances 21 | // produced by this function always compare as equal. 22 | func Discard() Logger { 23 | return New(nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | insert_final_newline = true 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | indent_style = tab 10 | indent_size = 8 11 | 12 | [*.{md,yml,yaml,json}] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | /.glide 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/Taskfile.yml: -------------------------------------------------------------------------------- 1 | # https://taskfile.dev 2 | 3 | version: '3' 4 | 5 | tasks: 6 | default: 7 | cmds: 8 | - task: test 9 | 10 | test: 11 | cmds: 12 | - go test -v . 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/crypto.go: -------------------------------------------------------------------------------- 1 | package sprig 2 | 3 | import ( 4 | "crypto/sha1" 5 | "crypto/sha256" 6 | "encoding/hex" 7 | "fmt" 8 | "hash/adler32" 9 | ) 10 | 11 | func sha256sum(input string) string { 12 | hash := sha256.Sum256([]byte(input)) 13 | return hex.EncodeToString(hash[:]) 14 | } 15 | 16 | func sha1sum(input string) string { 17 | hash := sha1.Sum([]byte(input)) 18 | return hex.EncodeToString(hash[:]) 19 | } 20 | 21 | func adler32sum(input string) string { 22 | hash := adler32.Checksum([]byte(input)) 23 | return fmt.Sprintf("%d", hash) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package sprig provides template functions for Go. 3 | 4 | This package contains a number of utility functions for working with data 5 | inside of Go `html/template` and `text/template` files. 6 | 7 | To add these functions, use the `template.Funcs()` method: 8 | 9 | t := templates.New("foo").Funcs(sprig.FuncMap()) 10 | 11 | Note that you should add the function map before you parse any template files. 12 | 13 | In several cases, Sprig reverses the order of arguments from the way they 14 | appear in the standard library. This is to make it easier to pipe 15 | arguments into functions. 16 | 17 | See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions. 18 | */ 19 | package sprig 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/network.go: -------------------------------------------------------------------------------- 1 | package sprig 2 | 3 | import ( 4 | "math/rand" 5 | "net" 6 | ) 7 | 8 | func getHostByName(name string) string { 9 | addrs, _ := net.LookupHost(name) 10 | //TODO: add error handing when release v3 comes out 11 | return addrs[rand.Intn(len(addrs))] 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-task/slim-sprig/v3/reflect.go: -------------------------------------------------------------------------------- 1 | package sprig 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | // typeIs returns true if the src is the type named in target. 9 | func typeIs(target string, src interface{}) bool { 10 | return target == typeOf(src) 11 | } 12 | 13 | func typeIsLike(target string, src interface{}) bool { 14 | t := typeOf(src) 15 | return target == t || "*"+target == t 16 | } 17 | 18 | func typeOf(src interface{}) string { 19 | return fmt.Sprintf("%T", src) 20 | } 21 | 22 | func kindIs(target string, src interface{}) bool { 23 | return target == kindOf(src) 24 | } 25 | 26 | func kindOf(src interface{}) string { 27 | return reflect.ValueOf(src).Kind().String() 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.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 !cmp_debug 6 | // +build !cmp_debug 7 | 8 | package diff 9 | 10 | var debug debugger 11 | 12 | type debugger struct{} 13 | 14 | func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { 15 | return f 16 | } 17 | func (debugger) Update() {} 18 | func (debugger) Finish() {} 19 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/flags/flags.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 flags 6 | 7 | // Deterministic controls whether the output of Diff should be deterministic. 8 | // This is only used for testing. 9 | var Deterministic bool 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/value/pointer.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 value 6 | 7 | import ( 8 | "reflect" 9 | "unsafe" 10 | ) 11 | 12 | // Pointer is an opaque typed pointer and is guaranteed to be comparable. 13 | type Pointer struct { 14 | p unsafe.Pointer 15 | t reflect.Type 16 | } 17 | 18 | // PointerOf returns a Pointer from v, which must be a 19 | // reflect.Ptr, reflect.Slice, or reflect.Map. 20 | func PointerOf(v reflect.Value) Pointer { 21 | // The proper representation of a pointer is unsafe.Pointer, 22 | // which is necessary if the GC ever uses a moving collector. 23 | return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} 24 | } 25 | 26 | // IsNil reports whether the pointer is nil. 27 | func (p Pointer) IsNil() bool { 28 | return p.p == nil 29 | } 30 | 31 | // Uintptr returns the pointer as a uintptr. 32 | func (p Pointer) Uintptr() uintptr { 33 | return uintptr(p.p) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/google/pprof/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of pprof authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | # Names should be added to this file as: 5 | # Name or Organization 6 | # The email address is not required for organizations. 7 | Google Inc. -------------------------------------------------------------------------------- /vendor/github.com/google/pprof/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # https://developers.google.com/open-source/cla/individual 7 | # https://developers.google.com/open-source/cla/corporate 8 | # 9 | # Names should be added to this file as: 10 | # Name 11 | Raul Silvera 12 | Tipp Moseley 13 | Hyoun Kyu Cho 14 | Martin Spier 15 | Taco de Wolff 16 | Andrew Hunter 17 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/arg.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // Arg represents a positional argument on the command line. 8 | type Arg struct { 9 | // The name of the positional argument (used in the help) 10 | Name string 11 | 12 | // A description of the positional argument (used in the help) 13 | Description string 14 | 15 | // The minimal number of required positional arguments 16 | Required int 17 | 18 | // The maximum number of required positional arguments 19 | RequiredMaximum int 20 | 21 | value reflect.Value 22 | tag multiTag 23 | } 24 | 25 | func (a *Arg) isRemaining() bool { 26 | return a.value.Type().Kind() == reflect.Slice 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/check_crosscompile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | echo '# linux arm7' 6 | GOARM=7 GOARCH=arm GOOS=linux go build 7 | echo '# linux arm5' 8 | GOARM=5 GOARCH=arm GOOS=linux go build 9 | echo '# windows 386' 10 | GOARCH=386 GOOS=windows go build 11 | echo '# windows amd64' 12 | GOARCH=amd64 GOOS=windows go build 13 | echo '# darwin' 14 | GOARCH=amd64 GOOS=darwin go build 15 | echo '# freebsd' 16 | GOARCH=amd64 GOOS=freebsd go build 17 | echo '# aix ppc64' 18 | GOARCH=ppc64 GOOS=aix go build 19 | echo '# solaris amd64' 20 | GOARCH=amd64 GOOS=solaris go build 21 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/termsize.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !plan9 && !appengine && !wasm && !aix 2 | // +build !windows,!plan9,!appengine,!wasm,!aix 3 | 4 | package flags 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func getTerminalColumns() int { 11 | ws, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ) 12 | if err != nil { 13 | return 80 14 | } 15 | return int(ws.Col) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 || appengine || wasm || aix 2 | // +build plan9 appengine wasm aix 3 | 4 | package flags 5 | 6 | func getTerminalColumns() int { 7 | return 80 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.iml 25 | .idea 26 | .envrc 27 | 28 | /counterfeiter 29 | integration/testdata/output 30 | *.profile 31 | *.bench 32 | /.vscode 33 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/.golangci.yaml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-dirs: 3 | - fixtures -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/arguments/files.go: -------------------------------------------------------------------------------- 1 | package arguments 2 | 3 | import "os" 4 | 5 | type Evaler func(string) (string, error) 6 | type Stater func(string) (os.FileInfo, error) 7 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/cache.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import "golang.org/x/tools/go/packages" 4 | 5 | type Cache struct { 6 | packageMap map[string]interface{} 7 | } 8 | 9 | type FakeCache struct{} 10 | 11 | func (c *FakeCache) Load(packagePath string) ([]*packages.Package, bool) { return nil, false } 12 | func (c *FakeCache) Store(packagePath string, packages []*packages.Package) {} 13 | 14 | type Cacher interface { 15 | Load(packagePath string) ([]*packages.Package, bool) 16 | Store(packagePath string, packages []*packages.Package) 17 | } 18 | 19 | func (c *Cache) Load(packagePath string) ([]*packages.Package, bool) { 20 | p, ok := c.packageMap[packagePath] 21 | if !ok { 22 | return nil, false 23 | } 24 | packages, ok := p.([]*packages.Package) 25 | return packages, ok 26 | } 27 | 28 | func (c *Cache) Store(packagePath string, packages []*packages.Package) { 29 | if c.packageMap == nil { 30 | c.packageMap = map[string]interface{}{} 31 | } 32 | c.packageMap[packagePath] = packages 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/ctx.go: -------------------------------------------------------------------------------- 1 | //go:build go1.14 2 | 3 | package generator 4 | 5 | import "go/build" 6 | 7 | func getBuildContext(workingDir string) build.Context { 8 | ctx := build.Default 9 | ctx.Dir = workingDir 10 | return ctx 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/ctx_old.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.14 2 | 3 | package generator 4 | 5 | import "go/build" 6 | 7 | func getBuildContext(workingDir string) build.Context { 8 | ctx := build.Default 9 | return ctx 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/function_loader.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import ( 4 | "errors" 5 | "go/types" 6 | ) 7 | 8 | func (f *Fake) loadMethodForFunction() error { 9 | t, ok := f.Target.Type().(*types.Named) 10 | if !ok { 11 | return errors.New("target is not a named type") 12 | } 13 | sig, ok := t.Underlying().(*types.Signature) 14 | if !ok { 15 | return errors.New("target does not have an underlying function signature") 16 | } 17 | f.addTypesForMethod(sig) 18 | f.Function = methodForSignature(sig, f.TargetName, f.Imports) 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/maxbrunsfeld/counterfeiter/v6/generator/package_loader.go: -------------------------------------------------------------------------------- 1 | package generator 2 | 3 | import ( 4 | "go/types" 5 | 6 | "golang.org/x/tools/go/packages" 7 | ) 8 | 9 | type rawMethod struct { 10 | Func *types.Func 11 | Signature *types.Signature 12 | } 13 | 14 | // packageMethodSet identifies the functions that are exported from a given 15 | // package. 16 | func packageMethodSet(p *packages.Package) []*rawMethod { 17 | if p == nil || p.Types == nil || p.Types.Scope() == nil { 18 | return nil 19 | } 20 | var result []*rawMethod 21 | scope := p.Types.Scope() 22 | for _, name := range scope.Names() { 23 | obj := scope.Lookup(name) 24 | if !obj.Exported() { 25 | continue // skip unexported names 26 | } 27 | fun, ok := obj.(*types.Func) 28 | if !ok { 29 | continue 30 | } 31 | sig, ok := obj.Type().(*types.Signature) 32 | if !ok { 33 | continue 34 | } 35 | result = append(result, &rawMethod{ 36 | Func: fun, 37 | Signature: sig, 38 | }) 39 | } 40 | 41 | return result 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/nu7hatch/gouuid/.gitignore: -------------------------------------------------------------------------------- 1 | _obj 2 | _test 3 | *.6 4 | *.out 5 | _testmain.go 6 | \#* 7 | .\#* 8 | *.log 9 | _cgo* 10 | *.o 11 | *.a 12 | -------------------------------------------------------------------------------- /vendor/github.com/nu7hatch/gouuid/README.md: -------------------------------------------------------------------------------- 1 | # Pure Go UUID implementation 2 | 3 | This package provides immutable UUID structs and the functions 4 | NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 5 | and 5 UUIDs as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt). 6 | 7 | ## Installation 8 | 9 | Use the `go` tool: 10 | 11 | $ go get github.com/nu7hatch/gouuid 12 | 13 | ## Usage 14 | 15 | See [documentation and examples](http://godoc.org/github.com/nu7hatch/gouuid) 16 | for more information. 17 | 18 | ## Copyright 19 | 20 | Copyright (C) 2011 by Krzysztof Kowalik . See [COPYING](https://github.com/nu7hatch/gouuid/tree/master/COPYING) 21 | file for details. 22 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | TODO 3 | tmp/**/* 4 | *.coverprofile 5 | .vscode 6 | .idea/ 7 | *.log 8 | *.test -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Ginkgo 2 | 3 | Your contributions to Ginkgo are essential for its long-term maintenance and improvement. 4 | 5 | - Please **open an issue first** - describe what problem you are trying to solve and give the community a forum for input and feedback ahead of investing time in writing code! 6 | - Ensure adequate test coverage: 7 | - When adding to the Ginkgo library, add unit and/or integration tests (under the `integration` folder). 8 | - When adding to the Ginkgo CLI, note that there are very few unit tests. Please add an integration test. 9 | - Run `make` or: 10 | - Install ginkgo locally via `go install ./...` 11 | - Make sure all the tests succeed via `ginkgo -r -p` 12 | - Vet your changes via `go vet ./...` 13 | - Update the documentation. Ginkgo uses `godoc` comments and documentation in `docs/index.md`. You can run `bundle && bundle exec jekyll serve` in the `docs` directory to preview your changes. 14 | 15 | Thanks for supporting Ginkgo! 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/Makefile: -------------------------------------------------------------------------------- 1 | # default task since it's first 2 | .PHONY: all 3 | all: vet test 4 | 5 | .PHONY: test 6 | test: 7 | go run github.com/onsi/ginkgo/v2/ginkgo -r -p -randomize-all -keep-going 8 | 9 | .PHONY: vet 10 | vet: 11 | go vet ./... 12 | 13 | .PHONY: update-deps 14 | update-deps: 15 | go get -u ./... 16 | go mod tidy -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/RELEASING.md: -------------------------------------------------------------------------------- 1 | A Ginkgo release is a tagged git sha and a GitHub release. To cut a release: 2 | 3 | 1. Ensure CHANGELOG.md is up to date. 4 | - Use 5 | ```bash 6 | LAST_VERSION=$(git tag --sort=version:refname | tail -n1) 7 | CHANGES=$(git log --pretty=format:'- %s [%h]' HEAD...$LAST_VERSION) 8 | echo -e "## NEXT\n\n$CHANGES\n\n### Features\n\n### Fixes\n\n### Maintenance\n\n$(cat CHANGELOG.md)" > CHANGELOG.md 9 | ``` 10 | to update the changelog 11 | - Categorize the changes into 12 | - Breaking Changes (requires a major version) 13 | - New Features (minor version) 14 | - Fixes (fix version) 15 | - Maintenance (which in general should not be mentioned in `CHANGELOG.md` as they have no user impact) 16 | 1. Update `VERSION` in `types/version.go` 17 | 1. Commit, push, and release: 18 | ``` 19 | git commit -m "vM.m.p" 20 | git push 21 | gh release create "vM.m.p" 22 | git fetch --tags origin master 23 | ``` -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go: -------------------------------------------------------------------------------- 1 | package generators 2 | 3 | var specText = `{{.BuildTags}} 4 | package {{.Package}} 5 | 6 | import ( 7 | {{.GinkgoImport}} 8 | {{.GomegaImport}} 9 | 10 | {{if .ImportPackage}}"{{.PackageImportPath}}"{{end}} 11 | ) 12 | 13 | var _ = {{.GinkgoPackage}}Describe("{{.Subject}}", func() { 14 | 15 | }) 16 | ` 17 | 18 | var agoutiSpecText = `{{.BuildTags}} 19 | package {{.Package}} 20 | 21 | import ( 22 | {{.GinkgoImport}} 23 | {{.GomegaImport}} 24 | "github.com/sclevine/agouti" 25 | . "github.com/sclevine/agouti/matchers" 26 | 27 | {{if .ImportPackage}}"{{.PackageImportPath}}"{{end}} 28 | ) 29 | 30 | var _ = {{.GinkgoPackage}}Describe("{{.Subject}}", func() { 31 | var page *agouti.Page 32 | 33 | {{.GinkgoPackage}}BeforeEach(func() { 34 | var err error 35 | page, err = agoutiDriver.NewPage() 36 | {{.GomegaPackage}}Expect(err).NotTo({{.GomegaPackage}}HaveOccurred()) 37 | }) 38 | 39 | {{.GinkgoPackage}}AfterEach(func() { 40 | {{.GomegaPackage}}Expect(page.Destroy()).To({{.GomegaPackage}}Succeed()) 41 | }) 42 | }) 43 | ` 44 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/delta.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import "sort" 4 | 5 | type Delta struct { 6 | ModifiedPackages []string 7 | 8 | NewSuites []*Suite 9 | RemovedSuites []*Suite 10 | modifiedSuites []*Suite 11 | } 12 | 13 | type DescendingByDelta []*Suite 14 | 15 | func (a DescendingByDelta) Len() int { return len(a) } 16 | func (a DescendingByDelta) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 17 | func (a DescendingByDelta) Less(i, j int) bool { return a[i].Delta() > a[j].Delta() } 18 | 19 | func (d Delta) ModifiedSuites() []*Suite { 20 | sort.Sort(DescendingByDelta(d.modifiedSuites)) 21 | return d.modifiedSuites 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/ginkgo_cli_dependencies.go: -------------------------------------------------------------------------------- 1 | //go:build ginkgoclidependencies 2 | // +build ginkgoclidependencies 3 | 4 | package ginkgo 5 | 6 | import ( 7 | _ "github.com/onsi/ginkgo/v2/ginkgo" 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/counter.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | func MakeIncrementingIndexCounter() func() (int, error) { 4 | idx := -1 5 | return func() (int, error) { 6 | idx += 1 7 | return idx, nil 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/global/init.go: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/v2/internal" 5 | ) 6 | 7 | var Suite *internal.Suite 8 | var Failer *internal.Failer 9 | var backupSuite *internal.Suite 10 | 11 | func init() { 12 | InitializeGlobals() 13 | } 14 | 15 | func InitializeGlobals() { 16 | Failer = internal.NewFailer() 17 | Suite = internal.NewSuite() 18 | } 19 | 20 | func PushClone() error { 21 | var err error 22 | backupSuite, err = Suite.Clone() 23 | return err 24 | } 25 | 26 | func PopClone() { 27 | Suite = backupSuite 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_unix.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd || openbsd || netbsd || dragonfly || darwin || linux || solaris 2 | // +build freebsd openbsd netbsd dragonfly darwin linux solaris 3 | 4 | package interrupt_handler 5 | 6 | import ( 7 | "os" 8 | "os/signal" 9 | "syscall" 10 | ) 11 | 12 | func SwallowSigQuit() { 13 | c := make(chan os.Signal, 1024) 14 | signal.Notify(c, syscall.SIGQUIT) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/interrupt_handler/sigquit_swallower_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package interrupt_handler 5 | 6 | func SwallowSigQuit() { 7 | //noop 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_wasm.go: -------------------------------------------------------------------------------- 1 | //go:build wasm 2 | 3 | package internal 4 | 5 | func NewOutputInterceptor() OutputInterceptor { 6 | return &NoopOutputInterceptor{} 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/output_interceptor_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package internal 4 | 5 | func NewOutputInterceptor() OutputInterceptor { 6 | return NewOSGlobalReassigningOutputInterceptor() 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/progress_report_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd || openbsd || netbsd || darwin || dragonfly 2 | // +build freebsd openbsd netbsd darwin dragonfly 3 | 4 | package internal 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | var PROGRESS_SIGNALS = []os.Signal{syscall.SIGINFO, syscall.SIGUSR1} 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/progress_report_unix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || solaris 2 | // +build linux solaris 3 | 4 | package internal 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | var PROGRESS_SIGNALS = []os.Signal{syscall.SIGUSR1} 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/progress_report_wasm.go: -------------------------------------------------------------------------------- 1 | //go:build wasm 2 | 3 | package internal 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | var PROGRESS_SIGNALS = []os.Signal{syscall.SIGUSR1} 11 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/progress_report_win.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package internal 5 | 6 | import "os" 7 | 8 | var PROGRESS_SIGNALS = []os.Signal{} 9 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/internal/report_entry.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/onsi/ginkgo/v2/types" 7 | ) 8 | 9 | type ReportEntry = types.ReportEntry 10 | 11 | func NewReportEntry(name string, cl types.CodeLocation, args ...any) (ReportEntry, error) { 12 | out := ReportEntry{ 13 | Visibility: types.ReportEntryVisibilityAlways, 14 | Name: name, 15 | Location: cl, 16 | Time: time.Now(), 17 | } 18 | var didSetValue = false 19 | for _, arg := range args { 20 | switch x := arg.(type) { 21 | case types.ReportEntryVisibility: 22 | out.Visibility = x 23 | case types.CodeLocation: 24 | out.Location = x 25 | case Offset: 26 | out.Location = types.NewCodeLocation(2 + int(x)) 27 | case time.Time: 28 | out.Time = x 29 | default: 30 | if didSetValue { 31 | return ReportEntry{}, types.GinkgoErrors.TooManyReportEntryValues(out.Location, arg) 32 | } 33 | out.Value = types.WrapEntryValue(arg) 34 | didSetValue = true 35 | } 36 | } 37 | 38 | return out, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/types/enum_support.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import "encoding/json" 4 | 5 | type EnumSupport struct { 6 | toString map[uint]string 7 | toEnum map[string]uint 8 | maxEnum uint 9 | } 10 | 11 | func NewEnumSupport(toString map[uint]string) EnumSupport { 12 | toEnum, maxEnum := map[string]uint{}, uint(0) 13 | for k, v := range toString { 14 | toEnum[v] = k 15 | if maxEnum < k { 16 | maxEnum = k 17 | } 18 | } 19 | return EnumSupport{toString: toString, toEnum: toEnum, maxEnum: maxEnum} 20 | } 21 | 22 | func (es EnumSupport) String(e uint) string { 23 | if e > es.maxEnum { 24 | return es.toString[0] 25 | } 26 | return es.toString[e] 27 | } 28 | 29 | func (es EnumSupport) UnmarshJSON(b []byte) (uint, error) { 30 | var dec string 31 | if err := json.Unmarshal(b, &dec); err != nil { 32 | return 0, err 33 | } 34 | out := es.toEnum[dec] // if we miss we get 0 which is what we want anyway 35 | return out, nil 36 | } 37 | 38 | func (es EnumSupport) MarshJSON(e uint) ([]byte, error) { 39 | if e == 0 || e > es.maxEnum { 40 | return json.Marshal(nil) 41 | } 42 | return json.Marshal(es.toString[e]) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/v2/types/version.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const VERSION = "2.23.4" 4 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.test 3 | . 4 | .idea 5 | gomega.iml 6 | TODO 7 | .vscode -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Gomega 2 | 3 | Your contributions to Gomega are essential for its long-term maintenance and improvement. To make a contribution: 4 | 5 | - Please **open an issue first** - describe what problem you are trying to solve and give the community a forum for input and feedback ahead of investing time in writing code! 6 | - Ensure adequate test coverage: 7 | - Make sure to add appropriate unit tests 8 | - Please run all tests locally (`ginkgo -r -p`) and make sure they go green before submitting the PR 9 | - Please run following linter locally `go vet ./...` and make sure output does not contain any warnings 10 | - Update the documentation. In addition to standard `godoc` comments Gomega has extensive documentation on the `gh-pages` branch. If relevant, please submit a docs PR to that branch alongside your code PR. 11 | 12 | If you're a committer, check out RELEASING.md to learn how to cut a release. 13 | 14 | Thanks for supporting Gomega! 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/README.md: -------------------------------------------------------------------------------- 1 | ![Gomega: Ginkgo's Preferred Matcher Library](http://onsi.github.io/gomega/images/gomega.png) 2 | 3 | [![test](https://github.com/onsi/gomega/actions/workflows/test.yml/badge.svg)](https://github.com/onsi/gomega/actions/workflows/test.yml) 4 | 5 | Jump straight to the [docs](http://onsi.github.io/gomega/) to learn about Gomega, including a list of [all available matchers](http://onsi.github.io/gomega/#provided-matchers). 6 | 7 | If you have a question, comment, bug report, feature request, etc. please open a GitHub issue. 8 | 9 | ## [Ginkgo](http://github.com/onsi/ginkgo): a BDD Testing Framework for Golang 10 | 11 | Learn more about Ginkgo [here](http://onsi.github.io/ginkgo/) 12 | 13 | ## Community Matchers 14 | 15 | A collection of community matchers is available on the [wiki](https://github.com/onsi/gomega/wiki). 16 | 17 | ## License 18 | 19 | Gomega is MIT-Licensed 20 | 21 | The `ConsistOf` matcher uses [goraph](https://github.com/amitkgupta/goraph) which is embedded in the source to simplify distribution. goraph has an MIT license. 22 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/RELEASING.md: -------------------------------------------------------------------------------- 1 | A Gomega release is a tagged sha and a GitHub release. To cut a release: 2 | 3 | 1. Ensure CHANGELOG.md is up to date. 4 | - Use 5 | ```bash 6 | LAST_VERSION=$(git tag --sort=version:refname | tail -n1) 7 | CHANGES=$(git log --pretty=format:'- %s [%h]' HEAD...$LAST_VERSION) 8 | echo -e "## NEXT\n\n$CHANGES\n\n### Features\n\n### Fixes\n\n### Maintenance\n\n$(cat CHANGELOG.md)" > CHANGELOG.md 9 | ``` 10 | to update the changelog 11 | - Categorize the changes into 12 | - Breaking Changes (requires a major version) 13 | - New Features (minor version) 14 | - Fixes (fix version) 15 | - Maintenance (which in general should not be mentioned in `CHANGELOG.md` as they have no user impact) 16 | 1. Update GOMEGA_VERSION in `gomega_dsl.go` 17 | 1. Commit, push, and release: 18 | ``` 19 | git commit -m "vM.m.p" 20 | git push 21 | gh release create "vM.m.p" 22 | git fetch --tags origin master 23 | ``` -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/vetoptdesc.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/types" 7 | ) 8 | 9 | // vetOptionalDescription vets the optional description args: if it finds any 10 | // Gomega matcher at the beginning it panics. This allows for rendering Gomega 11 | // matchers as part of an optional Description, as long as they're not in the 12 | // first slot. 13 | func vetOptionalDescription(assertion string, optionalDescription ...any) { 14 | if len(optionalDescription) == 0 { 15 | return 16 | } 17 | if _, isGomegaMatcher := optionalDescription[0].(types.GomegaMatcher); isGomegaMatcher { 18 | panic(fmt.Sprintf("%s has a GomegaMatcher as the first element of optionalDescription.\n\t"+ 19 | "Do you mean to use And/Or/SatisfyAll/SatisfyAny to combine multiple matchers?", 20 | assertion)) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/attributes_slice.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "encoding/xml" 5 | "strings" 6 | ) 7 | 8 | type attributesSlice []xml.Attr 9 | 10 | func (attrs attributesSlice) Len() int { return len(attrs) } 11 | func (attrs attributesSlice) Less(i, j int) bool { 12 | return strings.Compare(attrs[i].Name.Local, attrs[j].Name.Local) == -1 13 | } 14 | func (attrs attributesSlice) Swap(i, j int) { attrs[i], attrs[j] = attrs[j], attrs[i] } 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go: -------------------------------------------------------------------------------- 1 | // untested sections: 3 2 | 3 | package matchers 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | 9 | "github.com/onsi/gomega/format" 10 | ) 11 | 12 | type BeAnExistingFileMatcher struct { 13 | expected any 14 | } 15 | 16 | func (matcher *BeAnExistingFileMatcher) Match(actual any) (success bool, err error) { 17 | actualFilename, ok := actual.(string) 18 | if !ok { 19 | return false, fmt.Errorf("BeAnExistingFileMatcher matcher expects a file path") 20 | } 21 | 22 | if _, err = os.Stat(actualFilename); err != nil { 23 | switch { 24 | case os.IsNotExist(err): 25 | return false, nil 26 | default: 27 | return false, err 28 | } 29 | } 30 | 31 | return true, nil 32 | } 33 | 34 | func (matcher *BeAnExistingFileMatcher) FailureMessage(actual any) (message string) { 35 | return format.Message(actual, "to exist") 36 | } 37 | 38 | func (matcher *BeAnExistingFileMatcher) NegatedFailureMessage(actual any) (message string) { 39 | return format.Message(actual, "not to exist") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_false_matcher.go: -------------------------------------------------------------------------------- 1 | // untested sections: 2 2 | 3 | package matchers 4 | 5 | import ( 6 | "fmt" 7 | 8 | "github.com/onsi/gomega/format" 9 | ) 10 | 11 | type BeFalseMatcher struct { 12 | Reason string 13 | } 14 | 15 | func (matcher *BeFalseMatcher) Match(actual any) (success bool, err error) { 16 | if !isBool(actual) { 17 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 18 | } 19 | 20 | return actual == false, nil 21 | } 22 | 23 | func (matcher *BeFalseMatcher) FailureMessage(actual any) (message string) { 24 | if matcher.Reason == "" { 25 | return format.Message(actual, "to be false") 26 | } else { 27 | return matcher.Reason 28 | } 29 | } 30 | 31 | func (matcher *BeFalseMatcher) NegatedFailureMessage(actual any) (message string) { 32 | if matcher.Reason == "" { 33 | return format.Message(actual, "not to be false") 34 | } else { 35 | return fmt.Sprintf(`Expected not false but got false\nNegation of "%s" failed`, matcher.Reason) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go: -------------------------------------------------------------------------------- 1 | // untested sections: 2 2 | 3 | package matchers 4 | 5 | import "github.com/onsi/gomega/format" 6 | 7 | type BeNilMatcher struct { 8 | } 9 | 10 | func (matcher *BeNilMatcher) Match(actual any) (success bool, err error) { 11 | return isNil(actual), nil 12 | } 13 | 14 | func (matcher *BeNilMatcher) FailureMessage(actual any) (message string) { 15 | return format.Message(actual, "to be nil") 16 | } 17 | 18 | func (matcher *BeNilMatcher) NegatedFailureMessage(actual any) (message string) { 19 | return format.Message(actual, "not to be nil") 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_true_matcher.go: -------------------------------------------------------------------------------- 1 | // untested sections: 2 2 | 3 | package matchers 4 | 5 | import ( 6 | "fmt" 7 | 8 | "github.com/onsi/gomega/format" 9 | ) 10 | 11 | type BeTrueMatcher struct { 12 | Reason string 13 | } 14 | 15 | func (matcher *BeTrueMatcher) Match(actual any) (success bool, err error) { 16 | if !isBool(actual) { 17 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 18 | } 19 | 20 | return actual.(bool), nil 21 | } 22 | 23 | func (matcher *BeTrueMatcher) FailureMessage(actual any) (message string) { 24 | if matcher.Reason == "" { 25 | return format.Message(actual, "to be true") 26 | } else { 27 | return matcher.Reason 28 | } 29 | } 30 | 31 | func (matcher *BeTrueMatcher) NegatedFailureMessage(actual any) (message string) { 32 | if matcher.Reason == "" { 33 | return format.Message(actual, "not to be true") 34 | } else { 35 | return fmt.Sprintf(`Expected not true but got true\nNegation of "%s" failed`, matcher.Reason) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "reflect" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type BeZeroMatcher struct { 10 | } 11 | 12 | func (matcher *BeZeroMatcher) Match(actual any) (success bool, err error) { 13 | if actual == nil { 14 | return true, nil 15 | } 16 | zeroValue := reflect.Zero(reflect.TypeOf(actual)).Interface() 17 | 18 | return reflect.DeepEqual(zeroValue, actual), nil 19 | 20 | } 21 | 22 | func (matcher *BeZeroMatcher) FailureMessage(actual any) (message string) { 23 | return format.Message(actual, "to be zero-valued") 24 | } 25 | 26 | func (matcher *BeZeroMatcher) NegatedFailureMessage(actual any) (message string) { 27 | return format.Message(actual, "not to be zero-valued") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go: -------------------------------------------------------------------------------- 1 | // untested sections: 2 2 | 3 | package matchers 4 | 5 | import ( 6 | "fmt" 7 | 8 | "github.com/onsi/gomega/format" 9 | ) 10 | 11 | type HaveCapMatcher struct { 12 | Count int 13 | } 14 | 15 | func (matcher *HaveCapMatcher) Match(actual any) (success bool, err error) { 16 | length, ok := capOf(actual) 17 | if !ok { 18 | return false, fmt.Errorf("HaveCap matcher expects a array/channel/slice. Got:\n%s", format.Object(actual, 1)) 19 | } 20 | 21 | return length == matcher.Count, nil 22 | } 23 | 24 | func (matcher *HaveCapMatcher) FailureMessage(actual any) (message string) { 25 | return fmt.Sprintf("Expected\n%s\nto have capacity %d", format.Object(actual, 1), matcher.Count) 26 | } 27 | 28 | func (matcher *HaveCapMatcher) NegatedFailureMessage(actual any) (message string) { 29 | return fmt.Sprintf("Expected\n%s\nnot to have capacity %d", format.Object(actual, 1), matcher.Count) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_len_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type HaveLenMatcher struct { 10 | Count int 11 | } 12 | 13 | func (matcher *HaveLenMatcher) Match(actual any) (success bool, err error) { 14 | length, ok := lengthOf(actual) 15 | if !ok { 16 | return false, fmt.Errorf("HaveLen matcher expects a string/array/map/channel/slice/iterator. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return length == matcher.Count, nil 20 | } 21 | 22 | func (matcher *HaveLenMatcher) FailureMessage(actual any) (message string) { 23 | return fmt.Sprintf("Expected\n%s\nto have length %d", format.Object(actual, 1), matcher.Count) 24 | } 25 | 26 | func (matcher *HaveLenMatcher) NegatedFailureMessage(actual any) (message string) { 27 | return fmt.Sprintf("Expected\n%s\nnot to have length %d", format.Object(actual, 1), matcher.Count) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go: -------------------------------------------------------------------------------- 1 | // untested sections: 2 2 | 3 | package matchers 4 | 5 | import ( 6 | "fmt" 7 | 8 | "github.com/onsi/gomega/format" 9 | ) 10 | 11 | type HaveOccurredMatcher struct { 12 | } 13 | 14 | func (matcher *HaveOccurredMatcher) Match(actual any) (success bool, err error) { 15 | // is purely nil? 16 | if actual == nil { 17 | return false, nil 18 | } 19 | 20 | // must be an 'error' type 21 | if !isError(actual) { 22 | return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1)) 23 | } 24 | 25 | // must be non-nil (or a pointer to a non-nil) 26 | return !isNil(actual), nil 27 | } 28 | 29 | func (matcher *HaveOccurredMatcher) FailureMessage(actual any) (message string) { 30 | return fmt.Sprintf("Expected an error to have occurred. Got:\n%s", format.Object(actual, 1)) 31 | } 32 | 33 | func (matcher *HaveOccurredMatcher) NegatedFailureMessage(actual any) (message string) { 34 | return fmt.Sprintf("Unexpected error:\n%s\n%s", format.Object(actual, 1), "occurred") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/not.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/types" 5 | ) 6 | 7 | type NotMatcher struct { 8 | Matcher types.GomegaMatcher 9 | } 10 | 11 | func (m *NotMatcher) Match(actual any) (bool, error) { 12 | success, err := m.Matcher.Match(actual) 13 | if err != nil { 14 | return false, err 15 | } 16 | return !success, nil 17 | } 18 | 19 | func (m *NotMatcher) FailureMessage(actual any) (message string) { 20 | return m.Matcher.NegatedFailureMessage(actual) // works beautifully 21 | } 22 | 23 | func (m *NotMatcher) NegatedFailureMessage(actual any) (message string) { 24 | return m.Matcher.FailureMessage(actual) // works beautifully 25 | } 26 | 27 | func (m *NotMatcher) MatchMayChangeInTheFuture(actual any) bool { 28 | return types.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | type Node struct { 4 | ID int 5 | Value any 6 | } 7 | 8 | type NodeOrderedSet []Node 9 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/util/util.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "math" 4 | 5 | func Odd(n int) bool { 6 | return math.Mod(float64(n), 2.0) == 1.0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/pivotal-cf/paraphernalia/secure/tlsconfig/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["config.go"], 6 | importpath = "github.com/pivotal-cf/paraphernalia/secure/tlsconfig", 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | go_test( 11 | name = "go_default_xtest", 12 | size = "small", 13 | srcs = [ 14 | "config_test.go", 15 | "tlsconfig_suite_test.go", 16 | ], 17 | importpath = "github.com/pivotal-cf/paraphernalia/secure/tlsconfig_test", 18 | deps = [ 19 | ":go_default_library", 20 | "//test/certtest:go_default_library", 21 | "@com_github_onsi_ginkgo//:go_default_library", 22 | "@com_github_onsi_gomega//:go_default_library", 23 | ], 24 | ) 25 | -------------------------------------------------------------------------------- /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/go.uber.org/automaxprocs/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: 80..100 3 | round: down 4 | precision: 2 5 | 6 | status: 7 | project: # measuring the overall project coverage 8 | default: # context, you can create multiple ones with custom titles 9 | enabled: yes # must be yes|true to enable this status 10 | target: 90% # specify the target coverage for each commit status 11 | # option: "auto" (must increase from parent commit or pull request base) 12 | # option: "X%" a static target percentage to hit 13 | if_not_found: success # if parent is not found report status as success, error, or failure 14 | if_ci_failed: error # if ci fails report status as success, error, or failure 15 | -------------------------------------------------------------------------------- /vendor/go.uber.org/automaxprocs/.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 | vendor 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | *.pprof 27 | *.out 28 | *.log 29 | coverage.txt 30 | 31 | /bin 32 | cover.out 33 | cover.html 34 | -------------------------------------------------------------------------------- /vendor/go.uber.org/automaxprocs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc && !purego 6 | 7 | package chacha20 8 | 9 | const bufSize = 256 10 | 11 | //go:noescape 12 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) 13 | 14 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 15 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (!arm64 && !s390x && !ppc64 && !ppc64le) || !gc || purego 6 | 7 | package chacha20 8 | 9 | const bufSize = blockSize 10 | 11 | func (s *Cipher) xorKeyStreamBlocks(dst, src []byte) { 12 | s.xorKeyStreamBlocksGeneric(dst, src) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.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 gc && !purego && (ppc64 || ppc64le) 6 | 7 | package chacha20 8 | 9 | const bufSize = 256 10 | 11 | //go:noescape 12 | func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) 13 | 14 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 15 | chaCha20_ctr32_vsx(&dst[0], &src[0], len(src), &c.key, &c.counter) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/chacha20/chacha_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc && !purego 6 | 7 | package chacha20 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var haveAsm = cpu.S390X.HasVX 12 | 13 | const bufSize = 256 14 | 15 | // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only 16 | // be called when the vector facility is available. Implementation in asm_s390x.s. 17 | // 18 | //go:noescape 19 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) 20 | 21 | func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { 22 | if cpu.S390X.HasVX { 23 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) 24 | } else { 25 | c.xorKeyStreamBlocksGeneric(dst, src) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !s390x) || !gc || purego 6 | 7 | package poly1305 8 | 9 | type mac struct{ macGeneric } 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | 16 | [PROTOCOL]: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=HEAD 17 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 18 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 19 | 20 | This package does not fall under the stability promise of the Go language itself, 21 | so its API may be changed when pressing needs arise. 22 | */ 23 | package ssh 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | type direct struct{} 13 | 14 | // Direct implements Dialer by making network connections directly using net.Dial or net.DialContext. 15 | var Direct = direct{} 16 | 17 | var ( 18 | _ Dialer = Direct 19 | _ ContextDialer = Direct 20 | ) 21 | 22 | // Dial directly invokes net.Dial with the supplied parameters. 23 | func (direct) Dial(network, addr string) (net.Conn, error) { 24 | return net.Dial(network, addr) 25 | } 26 | 27 | // DialContext instantiates a net.Dialer and invokes its DialContext receiver with the supplied parameters. 28 | func (direct) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { 29 | var d net.Dialer 30 | return d.DialContext(ctx, network, addr) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/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/cpu/asm_darwin_x86_gc.s: -------------------------------------------------------------------------------- 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 darwin && amd64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_sysctl(SB) 11 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 12 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 13 | 14 | TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 15 | JMP libc_sysctlbyname(SB) 16 | GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 17 | DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_aix.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 6 | 7 | package cpu 8 | 9 | const ( 10 | // getsystemcfg constants 11 | _SC_IMPL = 2 12 | _IMPL_POWER8 = 0x10000 13 | _IMPL_POWER9 = 0x20000 14 | ) 15 | 16 | func archInit() { 17 | impl := getsystemcfg(_SC_IMPL) 18 | if impl&_IMPL_POWER8 != 0 { 19 | PPC64.IsPOWER8 = true 20 | } 21 | if impl&_IMPL_POWER9 != 0 { 22 | PPC64.IsPOWER8 = true 23 | PPC64.IsPOWER9 = true 24 | } 25 | 26 | Initialized = true 27 | } 28 | 29 | func getsystemcfg(label int) (n uint64) { 30 | r0, _ := callgetsystemcfg(label) 31 | n = uint64(r0) 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm64.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 | // func getisar0() uint64 10 | TEXT ·getisar0(SB),NOSPLIT,$0-8 11 | // get Instruction Set Attributes 0 into x0 12 | // mrs x0, ID_AA64ISAR0_EL1 = d5380600 13 | WORD $0xd5380600 14 | MOVD R0, ret+0(FP) 15 | RET 16 | 17 | // func getisar1() uint64 18 | TEXT ·getisar1(SB),NOSPLIT,$0-8 19 | // get Instruction Set Attributes 1 into x0 20 | // mrs x0, ID_AA64ISAR1_EL1 = d5380620 21 | WORD $0xd5380620 22 | MOVD R0, ret+0(FP) 23 | RET 24 | 25 | // func getpfr0() uint64 26 | TEXT ·getpfr0(SB),NOSPLIT,$0-8 27 | // get Processor Feature Register 0 into x0 28 | // mrs x0, ID_AA64PFR0_EL1 = d5380400 29 | WORD $0xd5380400 30 | MOVD R0, ret+0(FP) 31 | RET 32 | 33 | // func getzfr0() uint64 34 | TEXT ·getzfr0(SB),NOSPLIT,$0-8 35 | // get SVE Feature Register 0 into x0 36 | // mrs x0, ID_AA64ZFR0_EL1 = d5380480 37 | WORD $0xd5380480 38 | MOVD R0, ret+0(FP) 39 | RET 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_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 gc 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 10 | func getisar1() uint64 11 | func getpfr0() uint64 12 | func getzfr0() uint64 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_s390x.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 gc 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return true } 12 | 13 | // The following feature detection functions are defined in cpu_s390x.s. 14 | // They are likely to be expensive to call so the results should be cached. 15 | func stfle() facilityList 16 | func kmQuery() queryResult 17 | func kmcQuery() queryResult 18 | func kmctrQuery() queryResult 19 | func kmaQuery() queryResult 20 | func kimdQuery() queryResult 21 | func klmdQuery() queryResult 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.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 (386 || amd64 || amd64p32) && gc 6 | 7 | package cpu 8 | 9 | // cpuid is implemented in cpu_gc_x86.s for gc compiler 10 | // and in cpu_gccgo.c for gccgo. 11 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 12 | 13 | // xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler 14 | // and in cpu_gccgo.c for gccgo. 15 | func xgetbv() (eax, edx uint32) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.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 (386 || amd64 || amd64p32) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 10 | TEXT ·cpuid(SB), NOSPLIT, $0-24 11 | MOVL eaxArg+0(FP), AX 12 | MOVL ecxArg+4(FP), CX 13 | CPUID 14 | MOVL AX, eax+8(FP) 15 | MOVL BX, ebx+12(FP) 16 | MOVL CX, ecx+16(FP) 17 | MOVL DX, edx+20(FP) 18 | RET 19 | 20 | // func xgetbv() (eax, edx uint32) 21 | TEXT ·xgetbv(SB), NOSPLIT, $0-8 22 | MOVL $0, CX 23 | XGETBV 24 | MOVL AX, eax+0(FP) 25 | MOVL DX, edx+4(FP) 26 | RET 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_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 gccgo 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 { return 0 } 10 | func getisar1() uint64 { return 0 } 11 | func getpfr0() uint64 { return 0 } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.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 gccgo 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return false } 12 | 13 | // TODO(mundaym): the following feature detection functions are currently 14 | // stubs. See https://golang.org/cl/162887 for how to fix this. 15 | // They are likely to be expensive to call so the results should be cached. 16 | func stfle() facilityList { panic("not implemented for gccgo") } 17 | func kmQuery() queryResult { panic("not implemented for gccgo") } 18 | func kmcQuery() queryResult { panic("not implemented for gccgo") } 19 | func kmctrQuery() queryResult { panic("not implemented for gccgo") } 20 | func kmaQuery() queryResult { panic("not implemented for gccgo") } 21 | func kimdQuery() queryResult { panic("not implemented for gccgo") } 22 | func klmdQuery() queryResult { panic("not implemented for gccgo") } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.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 (386 || amd64 || amd64p32) && gccgo 6 | 7 | package cpu 8 | 9 | //extern gccgoGetCpuidCount 10 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 11 | 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 13 | var a, b, c, d uint32 14 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 15 | return a, b, c, d 16 | } 17 | 18 | //extern gccgoXgetbv 19 | func gccgoXgetbv(eax, edx *uint32) 20 | 21 | func xgetbv() (eax, edx uint32) { 22 | var a, d uint32 23 | gccgoXgetbv(&a, &d) 24 | return a, d 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux.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 !386 && !amd64 && !amd64p32 && !arm64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | if err := readHWCAP(); err != nil { 11 | return 12 | } 13 | doinit() 14 | Initialized = true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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 cpu 6 | 7 | // HWCAP bits. These are exposed by the Linux kernel. 8 | const ( 9 | hwcap_LOONGARCH_LSX = 1 << 4 10 | hwcap_LOONGARCH_LASX = 1 << 5 11 | ) 12 | 13 | func doinit() { 14 | // TODO: Features that require kernel support like LSX and LASX can 15 | // be detected here once needed in std library or by the compiler. 16 | Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX) 17 | Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX) 18 | } 19 | 20 | func hwcIsSet(hwc uint, val uint) bool { 21 | return hwc&val != 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.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 linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | // HWCAP bits. These are exposed by the Linux kernel 5.4. 10 | const ( 11 | // CPU features 12 | hwcap_MIPS_MSA = 1 << 1 13 | ) 14 | 15 | func doinit() { 16 | // HWCAP feature bits 17 | MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA) 18 | } 19 | 20 | func isSet(hwc uint, value uint) bool { 21 | return hwc&value != 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_noinit.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 linux && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_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 && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | // HWCAP/HWCAP2 bits. These are exposed by the kernel. 10 | const ( 11 | // ISA Level 12 | _PPC_FEATURE2_ARCH_2_07 = 0x80000000 13 | _PPC_FEATURE2_ARCH_3_00 = 0x00800000 14 | 15 | // CPU features 16 | _PPC_FEATURE2_DARN = 0x00200000 17 | _PPC_FEATURE2_SCV = 0x00100000 18 | ) 19 | 20 | func doinit() { 21 | // HWCAP2 feature bits 22 | PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) 23 | PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) 24 | PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) 25 | PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) 26 | } 27 | 28 | func isSet(hwc uint, value uint) bool { 29 | return hwc&value != 0 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_s390x.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 cpu 6 | 7 | const ( 8 | // bit mask values from /usr/include/bits/hwcap.h 9 | hwcap_ZARCH = 2 10 | hwcap_STFLE = 4 11 | hwcap_MSA = 8 12 | hwcap_LDISP = 16 13 | hwcap_EIMM = 32 14 | hwcap_DFP = 64 15 | hwcap_ETF3EH = 256 16 | hwcap_VX = 2048 17 | hwcap_VXE = 8192 18 | ) 19 | 20 | func initS390Xbase() { 21 | // test HWCAP bit vector 22 | has := func(featureMask uint) bool { 23 | return hwCap&featureMask == featureMask 24 | } 25 | 26 | // mandatory 27 | S390X.HasZARCH = has(hwcap_ZARCH) 28 | 29 | // optional 30 | S390X.HasSTFLE = has(hwcap_STFLE) 31 | S390X.HasLDISP = has(hwcap_LDISP) 32 | S390X.HasEIMM = has(hwcap_EIMM) 33 | S390X.HasETF3EH = has(hwcap_ETF3EH) 34 | S390X.HasDFP = has(hwcap_DFP) 35 | S390X.HasMSA = has(hwcap_MSA) 36 | S390X.HasVX = has(hwcap_VX) 37 | if S390X.HasVX { 38 | S390X.HasVXE = has(hwcap_VXE) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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 | #include "textflag.h" 6 | 7 | // func get_cpucfg(reg uint32) uint32 8 | TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0 9 | MOVW reg+0(FP), R5 10 | // CPUCFG R5, R4 = 0x00006ca4 11 | WORD $0x00006ca4 12 | MOVW R4, ret+8(FP) 13 | RET 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.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 mips64 || mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "msa", Feature: &MIPS64X.HasMSA}, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.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 mips || mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.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 | #include "textflag.h" 6 | 7 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 8 | JMP libc_sysctl(SB) 9 | 10 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 11 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm.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 !linux && arm 6 | 7 | package cpu 8 | 9 | func archInit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_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 !linux && !netbsd && !openbsd && arm64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_mips64x.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 !linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.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 !aix && !linux && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | PPC64.IsPOWER8 = true 11 | Initialized = true 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_riscv64.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 && riscv64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_x86.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 386 || amd64p32 || (amd64 && (!darwin || !gc)) 6 | 7 | package cpu 8 | 9 | func darwinSupportsAVX512() bool { 10 | panic("only implemented for gc && amd64 && darwin") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_ppc64x.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 ppc64 || ppc64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "darn", Feature: &PPC64.HasDARN}, 14 | {Name: "scv", Feature: &PPC64.HasSCV}, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_wasm.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 wasm 6 | 7 | package cpu 8 | 9 | // We're compiling the cpu package for an unknown (software-abstracted) CPU. 10 | // Make CacheLinePad an empty struct and hope that the usual struct alignment 11 | // rules are good enough. 12 | 13 | const cacheLineSize = 0 14 | 15 | func initOptions() {} 16 | 17 | func archInit() {} 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_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 | package cpu 6 | 7 | func archInit() { 8 | doinit() 9 | Initialized = true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_zos_s390x.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 | package cpu 6 | 7 | func initS390Xbase() { 8 | // get the facilities list 9 | facilities := stfle() 10 | 11 | // mandatory 12 | S390X.HasZARCH = facilities.Has(zarch) 13 | S390X.HasSTFLE = facilities.Has(stflef) 14 | S390X.HasLDISP = facilities.Has(ldisp) 15 | S390X.HasEIMM = facilities.Has(eimm) 16 | 17 | // optional 18 | S390X.HasETF3EH = facilities.Has(etf3eh) 19 | S390X.HasDFP = facilities.Has(dfp) 20 | S390X.HasMSA = facilities.Has(msa) 21 | S390X.HasVX = facilities.Has(vx) 22 | if S390X.HasVX { 23 | S390X.HasVXE = facilities.Has(vxe) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_big.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 armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_little.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 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv.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 | package cpu 6 | 7 | // getAuxvFn is non-nil on Go 1.21+ (via runtime_auxv_go121.go init) 8 | // on platforms that use auxv. 9 | var getAuxvFn func() []uintptr 10 | 11 | func getAuxv() []uintptr { 12 | if getAuxvFn == nil { 13 | return nil 14 | } 15 | return getAuxvFn() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv_go121.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 go1.21 6 | 7 | package cpu 8 | 9 | import ( 10 | _ "unsafe" // for linkname 11 | ) 12 | 13 | //go:linkname runtime_getAuxv runtime.getAuxv 14 | func runtime_getAuxv() []uintptr 15 | 16 | func init() { 17 | getAuxvFn = runtime_getAuxv 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.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 | // Recreate a getsystemcfg syscall handler instead of 6 | // using the one provided by x/sys/unix to avoid having 7 | // the dependency between them. (See golang.org/issue/32102) 8 | // Moreover, this file will be used during the building of 9 | // gccgo's libgo and thus must not used a CGo method. 10 | 11 | //go:build aix && gccgo 12 | 13 | package cpu 14 | 15 | import ( 16 | "syscall" 17 | ) 18 | 19 | //extern getsystemcfg 20 | func gccgoGetsystemcfg(label uint32) (r uint64) 21 | 22 | func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) { 23 | r1 = uintptr(gccgoGetsystemcfg(uint32(label))) 24 | e1 = syscall.GetErrno() 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /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/auxv_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Auxv() ([][2]uintptr, error) { 12 | return nil, syscall.ENOTSUP 13 | } 14 | -------------------------------------------------------------------------------- /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_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_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/encoding/japanese/all.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 japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.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 simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /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/tools/go/ast/astutil/util.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 astutil 6 | 7 | import "go/ast" 8 | 9 | // Unparen returns e with any enclosing parentheses stripped. 10 | // Deprecated: use [ast.Unparen]. 11 | // 12 | //go:fix inline 13 | func Unparen(e ast.Expr) ast.Expr { return ast.Unparen(e) } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/types/typeutil/imports.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 typeutil 6 | 7 | import "go/types" 8 | 9 | // Dependencies returns all dependencies of the specified packages. 10 | // 11 | // Dependent packages appear in topological order: if package P imports 12 | // package Q, Q appears earlier than P in the result. 13 | // The algorithm follows import statements in the order they 14 | // appear in the source code, so the result is a total order. 15 | func Dependencies(pkgs ...*types.Package) []*types.Package { 16 | var result []*types.Package 17 | seen := make(map[*types.Package]bool) 18 | var visit func(pkgs []*types.Package) 19 | visit = func(pkgs []*types.Package) { 20 | for _, p := range pkgs { 21 | if !seen[p] { 22 | seen[p] = true 23 | visit(p.Imports()) 24 | result = append(result, p) 25 | } 26 | } 27 | } 28 | visit(pkgs) 29 | return result 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/doc.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 event provides a set of packages that cover the main 6 | // concepts of telemetry in an implementation agnostic way. 7 | package event 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/keys/standard.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 | package keys 6 | 7 | var ( 8 | // Msg is a key used to add message strings to label lists. 9 | Msg = NewString("message", "a readable message") 10 | // Label is a key used to indicate an event adds labels to the context. 11 | Label = NewTag("label", "a label context marker") 12 | // Start is used for things like traces that have a name. 13 | Start = NewString("start", "span start") 14 | // Metric is a key used to indicate an event records metrics. 15 | End = NewTag("end", "a span end marker") 16 | // Metric is a key used to indicate an event records metrics. 17 | Detach = NewTag("detach", "a span detach marker") 18 | // Err is a key used to add error values to label lists. 19 | Err = NewError("error", "an error that occurred") 20 | // Metric is a key used to indicate an event records metrics. 21 | Metric = NewTag("metric", "a metric event marker") 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/keys/util.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 | package keys 6 | 7 | import ( 8 | "sort" 9 | "strings" 10 | ) 11 | 12 | // Join returns a canonical join of the keys in S: 13 | // a sorted comma-separated string list. 14 | func Join[S ~[]T, T ~string](s S) string { 15 | strs := make([]string, 0, len(s)) 16 | for _, v := range s { 17 | strs = append(strs, string(v)) 18 | } 19 | sort.Strings(strs) 20 | return strings.Join(strs, ",") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/support.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 | package gcimporter 6 | 7 | import ( 8 | "bufio" 9 | "io" 10 | "strconv" 11 | "strings" 12 | ) 13 | 14 | // Copy of $GOROOT/src/cmd/internal/archive.ReadHeader. 15 | func readArchiveHeader(b *bufio.Reader, name string) int { 16 | // architecture-independent object file output 17 | const HeaderSize = 60 18 | 19 | var buf [HeaderSize]byte 20 | if _, err := io.ReadFull(b, buf[:]); err != nil { 21 | return -1 22 | } 23 | aname := strings.Trim(string(buf[0:16]), " ") 24 | if !strings.HasPrefix(aname, name) { 25 | return -1 26 | } 27 | asize := strings.Trim(string(buf[48:58]), " ") 28 | i, _ := strconv.Atoi(asize) 29 | return i 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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 !unix 6 | 7 | package gocommand 8 | 9 | import "os" 10 | 11 | // sigStuckProcess is the signal to send to kill a hanging subprocess. 12 | // On Unix we send SIGQUIT, but on non-Unix we only have os.Kill. 13 | var sigStuckProcess = os.Kill 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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 unix 6 | 7 | package gocommand 8 | 9 | import "syscall" 10 | 11 | // Sigstuckprocess is the signal to send to kill a hanging subprocess. 12 | // Send SIGQUIT to get a stack trace. 13 | var sigStuckProcess = syscall.SIGQUIT 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/modindex/types.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 | package modindex 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // some special types to avoid confusions 12 | 13 | // distinguish various types of directory names. It's easy to get confused. 14 | type Abspath string // absolute paths 15 | type Relpath string // paths with GOMODCACHE prefix removed 16 | 17 | func toRelpath(cachedir Abspath, s string) Relpath { 18 | if strings.HasPrefix(s, string(cachedir)) { 19 | if s == string(cachedir) { 20 | return Relpath("") 21 | } 22 | return Relpath(s[len(cachedir)+1:]) 23 | } 24 | return Relpath(s) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/packagesinternal/packages.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 | // Package packagesinternal exposes internal-only fields from go/packages. 6 | package packagesinternal 7 | 8 | var GetDepsErrors = func(p any) []*PackageError { return nil } 9 | 10 | type PackageError struct { 11 | ImportStack []string // shortest path from package named on command line to this one 12 | Pos string // position of error (if present, file:line:col) 13 | Err string // the error itself 14 | } 15 | 16 | var TypecheckCgo int 17 | var DepsErrors int // must be set as a LoadMode to call GetDepsErrors 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/flags.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 | package pkgbits 6 | 7 | const ( 8 | flagSyncMarkers = 1 << iota // file format contains sync markers 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/reloc.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 | package pkgbits 6 | 7 | // A RelocKind indicates a particular section within a unified IR export. 8 | type RelocKind int32 9 | 10 | // An Index represents a bitstream element index within a particular 11 | // section. 12 | type Index int32 13 | 14 | // A relocEnt (relocation entry) is an entry in an element's local 15 | // reference table. 16 | // 17 | // TODO(mdempsky): Rename this too. 18 | type RelocEnt struct { 19 | Kind RelocKind 20 | Idx Index 21 | } 22 | 23 | // Reserved indices within the meta relocation section. 24 | const ( 25 | PublicRootIdx Index = 0 26 | PrivateRootIdx Index = 1 27 | ) 28 | 29 | const ( 30 | RelocString RelocKind = iota 31 | RelocMeta 32 | RelocPosBase 33 | RelocPkg 34 | RelocName 35 | RelocType 36 | RelocObj 37 | RelocObjExt 38 | RelocObjDict 39 | RelocBody 40 | 41 | numRelocs = iota 42 | ) 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/support.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 | package pkgbits 6 | 7 | import "fmt" 8 | 9 | func assert(b bool) { 10 | if !b { 11 | panic("assertion failed") 12 | } 13 | } 14 | 15 | func panicf(format string, args ...any) { 16 | panic(fmt.Errorf(format, args...)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/encoding/prototext/doc.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 prototext marshals and unmarshals protocol buffer messages as the 6 | // textproto format. 7 | package prototext 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.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 | // Package editiondefaults contains the binary representation of the editions 6 | // defaults. 7 | package editiondefaults 8 | 9 | import _ "embed" 10 | 11 | //go:embed editions_defaults.binpb 12 | var Defaults []byte 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudfoundry/bosh-utils/7acb169d5b5fa815677e7461f0f048b725cf0a53/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.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 !protolegacy 6 | // +build !protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = false 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.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 protolegacy 6 | // +build protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = true 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/doc.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 genid contains constants for declarations in descriptor.proto 6 | // and the well-known types. 7 | package genid 8 | 9 | import "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/empty_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" 14 | 15 | // Names for google.protobuf.Empty. 16 | const ( 17 | Empty_message_name protoreflect.Name = "Empty" 18 | Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" 14 | 15 | // Names for google.protobuf.FieldMask. 16 | const ( 17 | FieldMask_message_name protoreflect.Name = "FieldMask" 18 | FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" 19 | ) 20 | 21 | // Field names for google.protobuf.FieldMask. 22 | const ( 23 | FieldMask_Paths_field_name protoreflect.Name = "paths" 24 | 25 | FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" 26 | ) 27 | 28 | // Field numbers for google.protobuf.FieldMask. 29 | const ( 30 | FieldMask_Paths_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/goname.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 genid 6 | 7 | // Go names of implementation-specific struct fields in generated messages. 8 | const ( 9 | State_goname = "state" 10 | 11 | SizeCache_goname = "sizeCache" 12 | SizeCacheA_goname = "XXX_sizecache" 13 | 14 | UnknownFields_goname = "unknownFields" 15 | UnknownFieldsA_goname = "XXX_unrecognized" 16 | 17 | ExtensionFields_goname = "extensionFields" 18 | ExtensionFieldsA_goname = "XXX_InternalExtensions" 19 | ExtensionFieldsB_goname = "XXX_extensions" 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/map_entry.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 genid 6 | 7 | import "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field names and numbers for synthetic map entry messages. 10 | const ( 11 | MapEntry_Key_field_name protoreflect.Name = "key" 12 | MapEntry_Value_field_name protoreflect.Name = "value" 13 | 14 | MapEntry_Key_field_number protoreflect.FieldNumber = 1 15 | MapEntry_Value_field_number protoreflect.FieldNumber = 2 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/name.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 | package genid 6 | 7 | const ( 8 | NoUnkeyedLiteral_goname = "noUnkeyedLiteral" 9 | NoUnkeyedLiteralA_goname = "XXX_NoUnkeyedLiteral" 10 | 11 | BuilderSuffix_goname = "_builder" 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/wrappers.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 genid 6 | 7 | import "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field name and number for messages in wrappers.proto. 10 | const ( 11 | WrapperValue_Value_field_name protoreflect.Name = "value" 12 | WrapperValue_Value_field_number protoreflect.FieldNumber = 1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.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 impl 6 | 7 | // When using unsafe pointers, we can just treat enum values as int32s. 8 | 9 | var ( 10 | coderEnumNoZero = coderInt32NoZero 11 | coderEnum = coderInt32 12 | coderEnumPtr = coderInt32Ptr 13 | coderEnumSlice = coderInt32Slice 14 | coderEnumPackedSlice = coderInt32PackedSlice 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/enum.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 impl 6 | 7 | import ( 8 | "reflect" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | type EnumInfo struct { 14 | GoReflectType reflect.Type // int32 kind 15 | Desc protoreflect.EnumDescriptor 16 | } 17 | 18 | func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum { 19 | return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum) 20 | } 21 | func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc } 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/protolazy/pointer_unsafe.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 | package protolazy 6 | 7 | import ( 8 | "sync/atomic" 9 | "unsafe" 10 | ) 11 | 12 | func atomicLoadIndex(p **[]IndexEntry) *[]IndexEntry { 13 | return (*[]IndexEntry)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) 14 | } 15 | func atomicStoreIndex(p **[]IndexEntry, v *[]IndexEntry) { 16 | atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_methods.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 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build !protoreflect 7 | // +build !protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = true 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return m.ProtoMethods() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_reflect.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 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build protoreflect 7 | // +build protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = false 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoiface/legacy.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 protoiface 6 | 7 | type MessageV1 interface { 8 | Reset() 9 | String() string 10 | ProtoMessage() 11 | } 12 | 13 | type ExtensionRangeV1 struct { 14 | Start, End int32 // both inclusive 15 | } 16 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "1.14.x" 15 | - "tip" 16 | 17 | go_import_path: gopkg.in/yaml.v2 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /vendor/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 | -------------------------------------------------------------------------------- /work/work_suite_test.go: -------------------------------------------------------------------------------- 1 | package work_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestWork(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Work Suite") 13 | } 14 | --------------------------------------------------------------------------------