├── .circleci ├── README.md ├── config.yml └── coverage.sh ├── .codeclimate.yml ├── .dockerignore ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── .goreleaser.yml ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.md ├── Makefile ├── README.md ├── appveyor.yml ├── build ├── Dockerfile ├── dmg │ ├── osx-create-dmg.sh │ └── osx-dmg-background.png └── msi │ ├── AppIcon.ico │ ├── compliance-masonry.wxs │ ├── ocbanner.png │ └── ocdialog.png ├── cmd ├── compliance-masonry │ └── compliance-masonry.go └── masonry │ ├── masonry.go │ ├── masonry_suite_test.go │ └── masonry_test.go ├── docs ├── assets │ ├── data_flow.png │ ├── workflow.png │ └── workflow.svg ├── development.md ├── gitbook.md ├── masonry-for-the-compliance-literate.md └── usage.md ├── examples ├── example.go ├── example_test.go ├── exampleplugin_suite_test.go └── opencontrol.yaml ├── go.mod ├── go.sum ├── internal ├── constants │ └── constants.go └── utils │ └── masonryutil.go ├── pkg ├── cli │ ├── clierrors │ │ └── errors.go │ ├── diff │ │ ├── diff.go │ │ ├── diff_suite_test.go │ │ ├── diff_test.go │ │ ├── inventory.go │ │ └── inventory_test.go │ ├── docs │ │ ├── docs.go │ │ ├── docs_suite_test.go │ │ ├── docs_test.go │ │ └── gitbook │ │ │ ├── gitbook.go │ │ │ ├── gitbookCertification.go │ │ │ ├── gitbookCertification_test.go │ │ │ ├── gitbookComponents.go │ │ │ ├── gitbookComponents_test.go │ │ │ ├── gitbookSummaries.go │ │ │ ├── gitbookSummaries_test.go │ │ │ └── gitbook_test.go │ ├── export │ │ ├── export.go │ │ ├── exportFormat.go │ │ ├── export_config.go │ │ ├── export_flatten.go │ │ ├── export_outputFormat.go │ │ ├── export_suite_test.go │ │ ├── export_test.go │ │ └── export_utility.go │ ├── get │ │ ├── get.go │ │ └── resources │ │ │ ├── downloader.go │ │ │ ├── downloader_test.go │ │ │ ├── getter.go │ │ │ ├── getter_test.go │ │ │ ├── mocks │ │ │ ├── Downloader.go │ │ │ └── Getter.go │ │ │ └── resources_suite_test.go │ ├── info │ │ ├── info.go │ │ ├── info_suite_test.go │ │ └── info_test.go │ ├── validate │ │ └── validate.go │ └── version │ │ └── version.go ├── cmd │ └── masonry │ │ ├── cmd.go │ │ ├── masonry.go │ │ └── template.go ├── lib │ ├── README.md │ ├── certifications.go │ ├── certifications │ │ ├── certification.go │ │ ├── certification_test.go │ │ └── versions │ │ │ └── 1_0_0 │ │ │ ├── certification.go │ │ │ └── certification_test.go │ ├── common │ │ ├── certification.go │ │ ├── component.go │ │ ├── control.go │ │ ├── errors.go │ │ ├── mocks │ │ │ ├── Certification.go │ │ │ ├── Component.go │ │ │ ├── Control.go │ │ │ ├── OpenControl.go │ │ │ ├── RemoteSource.go │ │ │ ├── Satisfies.go │ │ │ ├── Section.go │ │ │ ├── Standard.go │ │ │ └── Workspace.go │ │ ├── opencontrol.go │ │ ├── references.go │ │ ├── references_test.go │ │ ├── standard.go │ │ ├── verifications.go │ │ ├── verifications_test.go │ │ └── workspace.go │ ├── components.go │ ├── components │ │ ├── README.md │ │ ├── component.go │ │ ├── component_test.go │ │ ├── parse.go │ │ ├── parse_test.go │ │ └── versions │ │ │ ├── 2_0_0 │ │ │ ├── component.go │ │ │ └── component_test.go │ │ │ ├── 3_0_0 │ │ │ ├── component.go │ │ │ └── component_test.go │ │ │ └── 3_1_0 │ │ │ ├── component.go │ │ │ └── component_test.go │ ├── components_test.go │ ├── opencontrol │ │ ├── README.md │ │ ├── mocks │ │ │ └── SchemaParser.go │ │ ├── opencontrol.go │ │ ├── opencontrol_suite_test.go │ │ ├── opencontrol_test.go │ │ ├── parse.go │ │ ├── parse_test.go │ │ └── versions │ │ │ └── 1.0.0 │ │ │ ├── 1.0.0_suite_test.go │ │ │ ├── opencontrol.go │ │ │ └── opencontrol_test.go │ ├── result │ │ ├── justifications.go │ │ └── justifications_test.go │ ├── standards.go │ ├── standards │ │ ├── standard.go │ │ ├── standard_test.go │ │ └── versions │ │ │ └── 1_0_0 │ │ │ ├── standard.go │ │ │ └── standard_test.go │ ├── standards_test.go │ ├── workspace.go │ └── workspace_test.go └── tests │ └── test_masonry.go ├── test └── fixtures │ ├── component_fixtures │ ├── common │ │ ├── EC2BrokenControl │ │ │ └── component.yaml │ │ ├── EC2UnsupportedVersion │ │ │ └── component.yaml │ │ ├── EC2VersionNotSemver │ │ │ └── component.yaml │ │ └── EC2_InvalidFieldTypeForVersion2_0 │ │ │ └── component.yaml │ ├── v2_0_0 │ │ ├── EC2 │ │ │ └── component.yaml │ │ └── EC2WithKey │ │ │ └── component.yaml │ ├── v3_0_0 │ │ ├── EC2 │ │ │ └── component.yaml │ │ └── EC2WithKey │ │ │ └── component.yaml │ └── v3_1_0 │ │ ├── EC2 │ │ └── component.yaml │ │ └── EC2WithKey │ │ └── component.yaml │ ├── exports_fixtures │ ├── complete_export │ │ ├── README.md │ │ ├── SUMMARY.md │ │ ├── components │ │ │ └── EC2.md │ │ └── standards │ │ │ ├── NIST-800-53-AC-2.md │ │ │ ├── NIST-800-53-AC-6.md │ │ │ ├── NIST-800-53-AC.md │ │ │ ├── NIST-800-53-CM-2.md │ │ │ ├── NIST-800-53-CM.md │ │ │ ├── PCI-DSS-MAY-2015-1.1.1.md │ │ │ ├── PCI-DSS-MAY-2015-1.1.md │ │ │ ├── PCI-DSS-MAY-2015-1.md │ │ │ ├── PCI-DSS-MAY-2015-2.1.md │ │ │ └── PCI-DSS-MAY-2015-2.md │ ├── complete_export_with_markdown │ │ ├── README.md │ │ ├── SUMMARY.md │ │ ├── components │ │ │ └── EC2.md │ │ ├── standards │ │ │ ├── NIST-800-53-AC-2.md │ │ │ ├── NIST-800-53-AC-6.md │ │ │ ├── NIST-800-53-AC.md │ │ │ ├── NIST-800-53-CM-2.md │ │ │ ├── NIST-800-53-CM.md │ │ │ ├── PCI-DSS-MAY-2015-1.1.1.md │ │ │ ├── PCI-DSS-MAY-2015-1.1.md │ │ │ ├── PCI-DSS-MAY-2015-1.md │ │ │ ├── PCI-DSS-MAY-2015-2.1.md │ │ │ └── PCI-DSS-MAY-2015-2.md │ │ └── system_documentation │ │ │ └── about-the-ssp.md │ └── gitbook_exports │ │ ├── components_readme.md │ │ ├── general_readme.md │ │ ├── standards │ │ ├── NIST-800-53-AC.md │ │ ├── NIST-800-53-CM.md │ │ ├── PCI-DSS-MAY-2015-1.md │ │ └── PCI-DSS-MAY-2015-2.md │ │ └── standards_readme.md │ ├── opencontrol_fixtures │ ├── certifications │ │ └── LATO.yaml │ ├── components │ │ └── EC2 │ │ │ ├── artifact-ec2-1.png │ │ │ └── component.yaml │ └── standards │ │ ├── NIST-800-53.yaml │ │ └── PCI-DSS-MAY-2015.yaml │ ├── opencontrol_fixtures_complete │ ├── certifications │ │ └── LATO.yaml │ ├── components │ │ └── EC2 │ │ │ ├── artifact-ec2-1.png │ │ │ └── component.yaml │ └── standards │ │ ├── NIST-800-53.yaml │ │ └── PCI-DSS-MAY-2015.yaml │ ├── opencontrol_fixtures_with_markdown │ ├── certifications │ │ └── LATO.yaml │ ├── components │ │ └── EC2 │ │ │ ├── artifact-ec2-1.png │ │ │ └── component.yaml │ ├── markdowns │ │ ├── SUMMARY.md │ │ └── system_documentation │ │ │ └── about-the-ssp.md │ └── standards │ │ ├── NIST-800-53.yaml │ │ └── PCI-DSS-MAY-2015.yaml │ └── standards_fixtures │ └── BrokenStandard │ └── NIST-800-53.yaml ├── tools ├── certifications │ └── certifications.go ├── constants │ └── constants.go ├── fs │ ├── fs.go │ └── mocks │ │ └── Util.go ├── mapset │ ├── map.go │ ├── map_test.go │ └── mapset_suite_test.go └── vcs │ ├── manager.go │ ├── manager_test.go │ ├── mocks │ └── RepoManager.go │ └── vcs_suite_test.go ├── validate └── validate.go ├── vendor ├── github.com │ ├── Masterminds │ │ └── vcs │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── bzr.go │ │ │ ├── errors.go │ │ │ ├── git.go │ │ │ ├── glide.yaml │ │ │ ├── hg.go │ │ │ ├── repo.go │ │ │ ├── svn.go │ │ │ ├── vcs_local_lookup.go │ │ │ └── vcs_remote_lookup.go │ ├── blang │ │ └── semver │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ ├── json.go │ │ │ ├── package.json │ │ │ ├── range.go │ │ │ ├── semver.go │ │ │ ├── sort.go │ │ │ └── sql.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── fatih │ │ └── set │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── set.go │ │ │ ├── set_nots.go │ │ │ └── set_ts.go │ ├── fsnotify │ │ └── fsnotify │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── fen.go │ │ │ ├── fsnotify.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── inotify.go │ │ │ ├── inotify_poller.go │ │ │ ├── kqueue.go │ │ │ ├── open_mode_bsd.go │ │ │ ├── open_mode_darwin.go │ │ │ └── windows.go │ ├── fvbommel │ │ └── sortorder │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── natsort.go │ ├── inconshreveable │ │ └── mousetrap │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── trap_others.go │ │ │ ├── trap_windows.go │ │ │ └── trap_windows_1.4.go │ ├── nxadm │ │ └── tail │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGES.md │ │ │ ├── Dockerfile │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── ratelimiter │ │ │ ├── Licence │ │ │ ├── leakybucket.go │ │ │ ├── memory.go │ │ │ └── storage.go │ │ │ ├── tail.go │ │ │ ├── tail_posix.go │ │ │ ├── tail_windows.go │ │ │ ├── util │ │ │ └── util.go │ │ │ ├── watch │ │ │ ├── filechanges.go │ │ │ ├── inotify.go │ │ │ ├── inotify_tracker.go │ │ │ ├── polling.go │ │ │ └── watch.go │ │ │ └── winfile │ │ │ └── winfile.go │ ├── onsi │ │ ├── ginkgo │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── RELEASING.md │ │ │ ├── config │ │ │ │ └── config.go │ │ │ ├── extensions │ │ │ │ └── table │ │ │ │ │ ├── table.go │ │ │ │ │ └── table_entry.go │ │ │ ├── ginkgo_dsl.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── internal │ │ │ │ ├── codelocation │ │ │ │ │ └── code_location.go │ │ │ │ ├── containernode │ │ │ │ │ └── container_node.go │ │ │ │ ├── failer │ │ │ │ │ └── failer.go │ │ │ │ ├── global │ │ │ │ │ └── init.go │ │ │ │ ├── leafnodes │ │ │ │ │ ├── benchmarker.go │ │ │ │ │ ├── interfaces.go │ │ │ │ │ ├── it_node.go │ │ │ │ │ ├── measure_node.go │ │ │ │ │ ├── runner.go │ │ │ │ │ ├── setup_nodes.go │ │ │ │ │ ├── suite_nodes.go │ │ │ │ │ ├── synchronized_after_suite_node.go │ │ │ │ │ └── synchronized_before_suite_node.go │ │ │ │ ├── remote │ │ │ │ │ ├── aggregator.go │ │ │ │ │ ├── forwarding_reporter.go │ │ │ │ │ ├── output_interceptor.go │ │ │ │ │ ├── output_interceptor_darwin.go │ │ │ │ │ ├── output_interceptor_dragonfly.go │ │ │ │ │ ├── output_interceptor_freebsd.go │ │ │ │ │ ├── output_interceptor_linux.go │ │ │ │ │ ├── output_interceptor_linux_mips64le.go │ │ │ │ │ ├── output_interceptor_netbsd.go │ │ │ │ │ ├── output_interceptor_openbsd.go │ │ │ │ │ ├── output_interceptor_solaris.go │ │ │ │ │ ├── output_interceptor_unix.go │ │ │ │ │ ├── output_interceptor_win.go │ │ │ │ │ └── server.go │ │ │ │ ├── spec │ │ │ │ │ ├── spec.go │ │ │ │ │ └── specs.go │ │ │ │ ├── spec_iterator │ │ │ │ │ ├── index_computer.go │ │ │ │ │ ├── parallel_spec_iterator.go │ │ │ │ │ ├── serial_spec_iterator.go │ │ │ │ │ ├── sharded_parallel_spec_iterator.go │ │ │ │ │ └── spec_iterator.go │ │ │ │ ├── specrunner │ │ │ │ │ ├── random_id.go │ │ │ │ │ └── spec_runner.go │ │ │ │ ├── suite │ │ │ │ │ └── suite.go │ │ │ │ ├── testingtproxy │ │ │ │ │ └── testing_t_proxy.go │ │ │ │ └── writer │ │ │ │ │ ├── fake_writer.go │ │ │ │ │ └── writer.go │ │ │ ├── reporters │ │ │ │ ├── default_reporter.go │ │ │ │ ├── fake_reporter.go │ │ │ │ ├── junit_reporter.go │ │ │ │ ├── reporter.go │ │ │ │ ├── stenographer │ │ │ │ │ ├── console_logging.go │ │ │ │ │ ├── fake_stenographer.go │ │ │ │ │ ├── stenographer.go │ │ │ │ │ └── support │ │ │ │ │ │ ├── go-colorable │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── colorable_others.go │ │ │ │ │ │ ├── colorable_windows.go │ │ │ │ │ │ └── noncolorable.go │ │ │ │ │ │ └── go-isatty │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── isatty_appengine.go │ │ │ │ │ │ ├── isatty_bsd.go │ │ │ │ │ │ ├── isatty_linux.go │ │ │ │ │ │ ├── isatty_solaris.go │ │ │ │ │ │ └── isatty_windows.go │ │ │ │ └── teamcity_reporter.go │ │ │ └── types │ │ │ │ ├── code_location.go │ │ │ │ ├── synchronization.go │ │ │ │ └── types.go │ │ └── gomega │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── 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 │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── gomega_dsl.go │ │ │ ├── internal │ │ │ ├── assertion │ │ │ │ └── assertion.go │ │ │ ├── asyncassertion │ │ │ │ └── async_assertion.go │ │ │ ├── oraclematcher │ │ │ │ └── oracle_matcher.go │ │ │ └── testingtsupport │ │ │ │ └── testing_t_support.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_element_of_matcher.go │ │ │ ├── be_empty_matcher.go │ │ │ ├── be_equivalent_to_matcher.go │ │ │ ├── be_false_matcher.go │ │ │ ├── be_identical_to.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_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 │ │ │ ├── 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 │ │ │ ├── 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 │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ ├── spf13 │ │ ├── cobra │ │ │ ├── .gitignore │ │ │ ├── .mailmap │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE.txt │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── args.go │ │ │ ├── bash_completions.go │ │ │ ├── bash_completions.md │ │ │ ├── cobra.go │ │ │ ├── command.go │ │ │ ├── command_notwin.go │ │ │ ├── command_win.go │ │ │ ├── custom_completions.go │ │ │ ├── fish_completions.go │ │ │ ├── fish_completions.md │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── powershell_completions.go │ │ │ ├── powershell_completions.md │ │ │ ├── projects_using_cobra.md │ │ │ ├── shell_completions.go │ │ │ ├── shell_completions.md │ │ │ ├── zsh_completions.go │ │ │ └── zsh_completions.md │ │ └── pflag │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bool.go │ │ │ ├── bool_slice.go │ │ │ ├── bytes.go │ │ │ ├── count.go │ │ │ ├── duration.go │ │ │ ├── duration_slice.go │ │ │ ├── flag.go │ │ │ ├── float32.go │ │ │ ├── float32_slice.go │ │ │ ├── float64.go │ │ │ ├── float64_slice.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── golangflag.go │ │ │ ├── int.go │ │ │ ├── int16.go │ │ │ ├── int32.go │ │ │ ├── int32_slice.go │ │ │ ├── int64.go │ │ │ ├── int64_slice.go │ │ │ ├── int8.go │ │ │ ├── int_slice.go │ │ │ ├── ip.go │ │ │ ├── ip_slice.go │ │ │ ├── ipmask.go │ │ │ ├── ipnet.go │ │ │ ├── string.go │ │ │ ├── string_array.go │ │ │ ├── string_slice.go │ │ │ ├── string_to_int.go │ │ │ ├── string_to_int64.go │ │ │ ├── string_to_string.go │ │ │ ├── uint.go │ │ │ ├── uint16.go │ │ │ ├── uint32.go │ │ │ ├── uint64.go │ │ │ ├── uint8.go │ │ │ └── uint_slice.go │ ├── stretchr │ │ ├── objx │ │ │ ├── .codeclimate.yml │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── Taskfile.yml │ │ │ ├── accessors.go │ │ │ ├── constants.go │ │ │ ├── conversions.go │ │ │ ├── doc.go │ │ │ ├── map.go │ │ │ ├── mutations.go │ │ │ ├── security.go │ │ │ ├── tests.go │ │ │ ├── type_specific_codegen.go │ │ │ └── value.go │ │ └── testify │ │ │ ├── LICENSE │ │ │ ├── assert │ │ │ ├── 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 │ │ │ └── mock │ │ │ ├── doc.go │ │ │ └── mock.go │ └── tg │ │ └── gosortmap │ │ ├── LICENSE │ │ ├── README.md │ │ └── sortmap.go ├── golang.org │ └── x │ │ ├── net │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── html │ │ │ ├── atom │ │ │ ├── atom.go │ │ │ └── table.go │ │ │ ├── charset │ │ │ └── charset.go │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── doctype.go │ │ │ ├── entity.go │ │ │ ├── escape.go │ │ │ ├── foreign.go │ │ │ ├── node.go │ │ │ ├── parse.go │ │ │ ├── render.go │ │ │ └── token.go │ │ ├── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── internal │ │ │ └── unsafeheader │ │ │ │ └── unsafeheader.go │ │ └── unix │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── affinity_linux.go │ │ │ ├── aliases.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_freebsd_arm64.s │ │ │ ├── asm_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_riscv64.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_openbsd_arm64.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── 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 │ │ │ ├── dirent.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── env_unix.go │ │ │ ├── errors_freebsd_386.go │ │ │ ├── errors_freebsd_amd64.go │ │ │ ├── errors_freebsd_arm.go │ │ │ ├── errors_freebsd_arm64.go │ │ │ ├── fcntl.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── fdset.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ioctl.go │ │ │ ├── mkall.sh │ │ │ ├── mkerrors.sh │ │ │ ├── pagesize_unix.go │ │ │ ├── pledge_openbsd.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── sockcmsg_dragonfly.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── sockcmsg_unix_other.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_aix.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_aix_ppc64.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.1_12.go │ │ │ ├── syscall_darwin.1_13.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_386.1_11.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.1_11.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm.1_11.go │ │ │ ├── syscall_darwin_arm.go │ │ │ ├── syscall_darwin_arm64.1_11.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_illumos.go │ │ │ ├── syscall_linux.go │ │ │ ├── syscall_linux_386.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_mips64x.go │ │ │ ├── syscall_linux_mipsx.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_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── timestruct.go │ │ │ ├── unveil_openbsd.go │ │ │ ├── xattr_bsd.go │ │ │ ├── zerrors_aix_ppc.go │ │ │ ├── zerrors_aix_ppc64.go │ │ │ ├── zerrors_darwin_386.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm.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_linux.go │ │ │ ├── zerrors_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.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_solaris_amd64.go │ │ │ ├── zptrace_armnn_linux.go │ │ │ ├── zptrace_linux_arm64.go │ │ │ ├── zptrace_mipsnn_linux.go │ │ │ ├── zptrace_mipsnnle_linux.go │ │ │ ├── zptrace_x86_linux.go │ │ │ ├── zsyscall_aix_ppc.go │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ ├── zsyscall_darwin_386.1_11.go │ │ │ ├── zsyscall_darwin_386.1_13.go │ │ │ ├── zsyscall_darwin_386.1_13.s │ │ │ ├── zsyscall_darwin_386.go │ │ │ ├── zsyscall_darwin_386.s │ │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ │ ├── zsyscall_darwin_amd64.1_13.go │ │ │ ├── zsyscall_darwin_amd64.1_13.s │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ ├── zsyscall_darwin_arm.1_11.go │ │ │ ├── zsyscall_darwin_arm.1_13.go │ │ │ ├── zsyscall_darwin_arm.1_13.s │ │ │ ├── zsyscall_darwin_arm.go │ │ │ ├── zsyscall_darwin_arm.s │ │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ │ ├── zsyscall_darwin_arm64.1_13.go │ │ │ ├── zsyscall_darwin_arm64.1_13.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_illumos_amd64.go │ │ │ ├── zsyscall_linux.go │ │ │ ├── zsyscall_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.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_amd64.go │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysctl_openbsd_arm64.go │ │ │ ├── zsysnum_darwin_386.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm.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_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.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 │ │ │ ├── ztypes_aix_ppc.go │ │ │ ├── ztypes_aix_ppc64.go │ │ │ ├── ztypes_darwin_386.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm.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_linux.go │ │ │ ├── ztypes_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.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_solaris_amd64.go │ │ ├── text │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── 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 │ │ │ ├── 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 │ │ │ ├── tag │ │ │ │ └── tag.go │ │ │ └── utf8internal │ │ │ │ └── utf8internal.go │ │ ├── language │ │ │ ├── coverage.go │ │ │ ├── doc.go │ │ │ ├── go1_1.go │ │ │ ├── go1_2.go │ │ │ ├── language.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── runes │ │ │ ├── cond.go │ │ │ └── runes.go │ │ └── transform │ │ │ └── transform.go │ │ └── xerrors │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README │ │ ├── adaptor.go │ │ ├── codereview.cfg │ │ ├── doc.go │ │ ├── errors.go │ │ ├── fmt.go │ │ ├── format.go │ │ ├── frame.go │ │ ├── go.mod │ │ ├── internal │ │ └── internal.go │ │ └── wrap.go ├── gopkg.in │ ├── tomb.v1 │ │ ├── LICENSE │ │ ├── README.md │ │ └── tomb.go │ └── yaml.v2 │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── go.mod │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go └── modules.txt ├── version └── version.go └── win32-LICENSE.rtf /.circleci/README.md: -------------------------------------------------------------------------------- 1 | ## Circle CI Scripts 2 | 3 | Call these scripts from the root of the repository 4 | - `./.circleci/coverage.sh # example` 5 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: /go/src/github.com/opencontrol/compliance-masonry 5 | docker: 6 | - image: golang:1.15 7 | steps: 8 | - checkout 9 | 10 | - run: 11 | name: Build the compliance-masonry program 12 | command: go build cmd/compliance-masonry/compliance-masonry.go 13 | - run: 14 | name: Build the masonry program 15 | command: go build cmd/masonry/masonry.go 16 | - run: 17 | name: Run tests 18 | command: ./.circleci/coverage.sh 19 | - deploy: 20 | name: goreleaser 21 | command: | 22 | if [[ ! -z ${CIRCLE_TAG} ]]; then 23 | echo "TAG: ${CIRCLE_TAG}" 24 | curl -sL https://git.io/goreleaser | bash 25 | fi 26 | 27 | deployment: 28 | trigger_tag: 29 | tag: /.*/ 30 | -------------------------------------------------------------------------------- /.circleci/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | set -e 5 | 6 | cov_file=/tmp/coverage.txt 7 | 8 | # Get the list of packages. 9 | pkgs=`go list ./...` 10 | 11 | echo "mode: count" > $cov_file 12 | for pkg in $pkgs 13 | do 14 | go test -v -covermode=count $pkg -coverprofile=tmp.cov 15 | if [ -f tmp.cov ] 16 | then 17 | cat tmp.cov | tail -n +2 >> $cov_file 18 | rm tmp.cov 19 | fi 20 | done 21 | 22 | go tool cover -func $cov_file 23 | 24 | mv $cov_file . && bash <(curl -s https://codecov.io/bash) 25 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | plugins: 3 | fixme: 4 | enabled: true 5 | gofmt: 6 | enabled: true 7 | golint: 8 | enabled: true 9 | exclude_paths: 10 | # Ginkgo/Gomega style aren't compatible 11 | - "**_test.go" 12 | govet: 13 | enabled: true 14 | ratings: 15 | paths: 16 | - "**.go" 17 | exclude_paths: 18 | - test/ 19 | - vendor/ 20 | - "**/mocks/" 21 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .circleci/ 2 | docs/ 3 | examples/ 4 | test/ 5 | .codeclimate.yml 6 | .git 7 | .gitignore 8 | .goxc.json 9 | appveyor.yml 10 | CONTRIBUTING.md 11 | release.sh 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: gomod 5 | directory: "/" 6 | schedule: 7 | interval: daily 8 | open-pull-requests-limit: 10 9 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: build 3 | on: [push, pull_request] 4 | jobs: 5 | build: 6 | runs-on: ${{ matrix.os }} 7 | strategy: 8 | fail-fast: false 9 | matrix: 10 | os: [ubuntu-latest, macos-latest, windows-latest] 11 | steps: 12 | - name: Set up Go 13 | uses: actions/setup-go@v2 14 | id: go 15 | 16 | - name: Check out code into the Go module directory 17 | uses: actions/checkout@v2 18 | 19 | - name: Build compliance-masonry and masonry 20 | run: go build -o ./ ./cmd/... 21 | 22 | - name: Run tests 23 | run: | 24 | go test -covermode=count -coverprofile="coverage.txt" ./... 25 | go tool cover -func coverage.txt 26 | 27 | - name: Upload coverage to Codecov 28 | uses: codecov/codecov-action@v1 29 | if: matrix.os == 'ubuntu-latest' 30 | with: 31 | file: ./coverage.txt 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /compliance-masonry 2 | /masonry 3 | /coverage.txt 4 | /dist 5 | *.swp 6 | *.out 7 | /_output 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | env: 4 | - VERSION_TAG=$(echo $TRAVIS_TAG | cut -d"v" -f2) 5 | 6 | matrix: 7 | include: 8 | - os: osx 9 | osx_image: xcode9.4 10 | language: go 11 | go: 12 | - 1.15 13 | script: 14 | - make build 15 | - cd _output && mkdir -p compliance-masonry.app/Contents/MacOS/ 16 | - cp -p masonry compliance-masonry.app/Contents/MacOS/ 17 | - ../build/dmg/osx-create-dmg.sh 18 | deploy: 19 | provider: releases 20 | api_key: $GITHUB_TOKEN 21 | file: compliance-masonry-$VERSION_TAG.dmg 22 | skip_cleanup: true 23 | on: 24 | tags: true 25 | -------------------------------------------------------------------------------- /build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.8-alpine 2 | RUN apk add --no-cache git openssh 3 | WORKDIR /go/src/github.com/opencontrol/compliance-masonry 4 | ADD . . 5 | RUN go install 6 | ENTRYPOINT ["/go/bin/compliance-masonry"] 7 | -------------------------------------------------------------------------------- /build/dmg/osx-dmg-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/build/dmg/osx-dmg-background.png -------------------------------------------------------------------------------- /build/msi/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/build/msi/AppIcon.ico -------------------------------------------------------------------------------- /build/msi/ocbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/build/msi/ocbanner.png -------------------------------------------------------------------------------- /build/msi/ocdialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/build/msi/ocdialog.png -------------------------------------------------------------------------------- /cmd/masonry/masonry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package main 6 | 7 | import ( 8 | "os" 9 | 10 | "github.com/opencontrol/compliance-masonry/pkg/cmd/masonry" 11 | ) 12 | 13 | func main() { 14 | if err := masonry.Run(); err != nil { 15 | os.Exit(1) 16 | } 17 | os.Exit(0) 18 | } 19 | -------------------------------------------------------------------------------- /cmd/masonry/masonry_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package main_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestMasonryGo(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "ComplianceMasonryGo Suite") 17 | } 18 | -------------------------------------------------------------------------------- /cmd/masonry/masonry_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package main_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | "github.com/opencontrol/compliance-masonry/pkg/tests" 11 | ) 12 | 13 | var usage = ` 14 | Usage: 15 | masonry [global-options] COMMAND [command-options] 16 | 17 | Commands: 18 | ` 19 | 20 | var _ = Describe("Masonry CLI", func() { 21 | Describe("When the CLI is run with no commands", func() { 22 | It("should list the available commands", func() { 23 | output := masonry_test.Masonry() 24 | Eventually(output.Out.Contents).Should(ContainSubstring(usage)) 25 | }) 26 | }) 27 | }) 28 | -------------------------------------------------------------------------------- /docs/assets/data_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/docs/assets/data_flow.png -------------------------------------------------------------------------------- /docs/assets/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/docs/assets/workflow.png -------------------------------------------------------------------------------- /examples/example.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package main 6 | 7 | import ( 8 | "fmt" 9 | "github.com/opencontrol/compliance-masonry/pkg/lib" 10 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 11 | "io" 12 | "os" 13 | ) 14 | 15 | type plugin struct { 16 | common.Workspace 17 | } 18 | 19 | func simpleDataExtract(p plugin) string { 20 | selectJustifications := p.GetAllVerificationsWith("NIST-800-53", "CM-2") 21 | if len(selectJustifications) == 0 { 22 | return "no data" 23 | } 24 | return selectJustifications[0].SatisfiesData.GetImplementationStatus() 25 | } 26 | 27 | func run(workspacePath, certPath string, writer io.Writer) { 28 | workspace, _ := lib.LoadData(workspacePath, certPath) 29 | sampleData := simpleDataExtract(plugin{workspace}) 30 | fmt.Fprint(writer, sampleData) 31 | } 32 | 33 | func main() { 34 | // in reality you would check the number of args. 35 | run(os.Args[1], os.Args[2], os.Stdout) 36 | } 37 | -------------------------------------------------------------------------------- /examples/exampleplugin_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package main_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestExampleplugin(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Exampleplugin Suite") 17 | } 18 | -------------------------------------------------------------------------------- /examples/opencontrol.yaml: -------------------------------------------------------------------------------- 1 | schema_version: "1.0.0" 2 | name: test-opencontrol-yaml 3 | metadata: 4 | description: "This opencontrol YAML is just used for showing various levels of testing. For more details refer to example_test.go" 5 | dependencies: 6 | standards: 7 | - url: https://github.com/opencontrol/standards 8 | revision: master 9 | certifications: 10 | - url: https://github.com/opencontrol/certifications 11 | revision: master 12 | systems: 13 | - url: https://github.com/opencontrol/aws-compliance 14 | revision: master 15 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/opencontrol/compliance-masonry 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/Masterminds/vcs v1.13.1 7 | github.com/blang/semver v1.1.1-0.20200524153540-4487282d7812 8 | github.com/davecgh/go-spew v1.1.1 // indirect 9 | github.com/fatih/set v0.2.1 10 | github.com/fvbommel/sortorder v1.0.1 11 | github.com/onsi/ginkgo v1.14.1-0.20200812193004-f49cf5da3a2f 12 | github.com/onsi/gomega v1.10.2-0.20200811195334-990941a380b2 13 | github.com/spf13/cobra v1.0.1-0.20200823174541-9ed1d713d619 14 | github.com/spf13/pflag v1.0.6-0.20200504143853-81378bbcd8a1 // indirect 15 | github.com/stretchr/objx v0.1.1 // indirect 16 | github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709 17 | github.com/tg/gosortmap v0.0.0-20190425101757-4b9ddc7c3a61 18 | golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect 19 | golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 // indirect 20 | golang.org/x/text v0.3.4-0.20200821135104-79eda68eebff // indirect 21 | gopkg.in/yaml.v2 v2.3.1-0.20200602174213-b893565b90ca 22 | ) 23 | -------------------------------------------------------------------------------- /internal/constants/constants.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package constants 6 | 7 | const ( 8 | // FileReadWrite handle Read/Write File Permissions 9 | FileReadWrite = 0600 10 | 11 | // FileReadWriteExec handle Read/Write/Write Execute Permissions 12 | FileReadWriteExec = 0700 13 | 14 | // DirReadWriteExec handle directory 755 permissions 15 | DirReadWriteExec = 0755 16 | ) 17 | -------------------------------------------------------------------------------- /internal/utils/masonryutil.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package masonryutil 6 | 7 | import ( 8 | "io/ioutil" 9 | "os" 10 | "strings" 11 | ) 12 | 13 | // replaceParentheses removes parenthesis in strings 14 | func replaceParentheses(text string) string { 15 | return strings.Replace(strings.Replace(text, "(", "", -1), ")", "", -1) 16 | } 17 | 18 | // replaceSpace changes whitepspace to underscore in strings 19 | func replaceSpaceUnderscore(text string) string { 20 | return strings.Replace(text, " ", "_", -1) 21 | } 22 | 23 | // FileNameHandler creates a standardized filename 24 | func FileNameHandler(fileName string) string { 25 | normalizedFileName := replaceParentheses(fileName) 26 | normalizedFileName = replaceSpaceUnderscore(normalizedFileName) 27 | 28 | return normalizedFileName 29 | } 30 | 31 | // FileWriter handles all file writing for Compliance Masonry 32 | func FileWriter(filePath string, fileText []byte, filePerms os.FileMode) { 33 | err := ioutil.WriteFile(filePath, fileText, filePerms) 34 | if err != nil { 35 | panic(err) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pkg/cli/diff/diff_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package diff_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestDiff(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Diff Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cli/docs/docs_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package docs_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestDocs(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Docs Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cli/export/export_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package export_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestExport(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Export Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cli/get/resources/downloader.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package resources 6 | 7 | import ( 8 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 9 | "github.com/opencontrol/compliance-masonry/tools/vcs" 10 | ) 11 | 12 | //go:generate mockery -name Downloader 13 | 14 | // Downloader is a generic interface for how to download entries. 15 | type Downloader interface { 16 | DownloadRepo(common.RemoteSource, string) error 17 | } 18 | 19 | // NewVCSDownloader is a constructor for downloading entries using VCS methods. 20 | func NewVCSDownloader() Downloader { 21 | return vcsEntryDownloader{vcs.Manager{}} 22 | } 23 | 24 | type vcsEntryDownloader struct { 25 | manager vcs.RepoManager 26 | } 27 | 28 | // DownloadEntry is a implementation for downloading entries using VCS methods. 29 | func (v vcsEntryDownloader) DownloadRepo(entry common.RemoteSource, destination string) error { 30 | err := v.manager.Clone(entry.GetURL(), entry.GetRevision(), destination) 31 | if err != nil { 32 | return err 33 | } 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /pkg/cli/get/resources/mocks/Downloader.go: -------------------------------------------------------------------------------- 1 | // Code generated by mockery v1.0.0. DO NOT EDIT. 2 | package mocks 3 | 4 | import common "github.com/opencontrol/compliance-masonry/pkg/lib/common" 5 | import mock "github.com/stretchr/testify/mock" 6 | 7 | // Downloader is an autogenerated mock type for the Downloader type 8 | type Downloader struct { 9 | mock.Mock 10 | } 11 | 12 | // DownloadRepo provides a mock function with given fields: _a0, _a1 13 | func (_m *Downloader) DownloadRepo(_a0 common.RemoteSource, _a1 string) error { 14 | ret := _m.Called(_a0, _a1) 15 | 16 | var r0 error 17 | if rf, ok := ret.Get(0).(func(common.RemoteSource, string) error); ok { 18 | r0 = rf(_a0, _a1) 19 | } else { 20 | r0 = ret.Error(0) 21 | } 22 | 23 | return r0 24 | } 25 | -------------------------------------------------------------------------------- /pkg/cli/get/resources/resources_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package resources 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestResources(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Resources Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cli/info/info_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package info_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestInfo(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Info Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/cli/validate/validate.go: -------------------------------------------------------------------------------- 1 | package validate 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/opencontrol/compliance-masonry/validate" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // NewCmdValidate validates the current masonry 11 | func NewCmdValidate(out io.Writer) *cobra.Command { 12 | cmd := &cobra.Command{ 13 | Use: "validate", 14 | Short: "Validates the current opencontrol masonry repository. Use get command to create opencontrol masonry repository.", 15 | Run: func(cmd *cobra.Command, args []string) { 16 | validate.Validate() 17 | }, 18 | } 19 | return cmd 20 | } 21 | -------------------------------------------------------------------------------- /pkg/cli/version/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package version 6 | 7 | import ( 8 | "io" 9 | 10 | "github.com/opencontrol/compliance-masonry/version" 11 | "github.com/spf13/cobra" 12 | ) 13 | 14 | // NewCmdVersion prints out the version 15 | func NewCmdVersion(out io.Writer) *cobra.Command { 16 | cmd := &cobra.Command{ 17 | Use: "version", 18 | Short: "Display version", 19 | Run: func(cmd *cobra.Command, args []string) { 20 | version.PrintVersion() 21 | }, 22 | } 23 | return cmd 24 | } 25 | -------------------------------------------------------------------------------- /pkg/cmd/masonry/masonry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package masonry 6 | 7 | import ( 8 | "os" 9 | ) 10 | 11 | // Run the Masonry Command structure 12 | func Run() error { 13 | cmd := NewMasonryCommand(os.Stdin, os.Stdout, os.Stderr) 14 | return cmd.Execute() 15 | } 16 | -------------------------------------------------------------------------------- /pkg/lib/certifications.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package lib 6 | 7 | import ( 8 | "github.com/opencontrol/compliance-masonry/pkg/lib/certifications" 9 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 10 | ) 11 | 12 | // LoadCertification struct loads certifications into a Certification struct 13 | // and add it to the main object. 14 | func (ws *localWorkspace) LoadCertification(certificationFile string) error { 15 | cert, err := certifications.Load(certificationFile) 16 | if err != nil { 17 | return err 18 | } 19 | ws.certification = cert 20 | return nil 21 | } 22 | 23 | func (ws *localWorkspace) GetCertification() common.Certification { 24 | return ws.certification 25 | } 26 | -------------------------------------------------------------------------------- /pkg/lib/common/certification.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | //go:generate mockery -name Certification 8 | 9 | // Certification is the interface for getting all the attributes for a given certification. 10 | // Schema info: https://github.com/opencontrol/schemas#certifications 11 | // 12 | // GetKey returns the the unique key that represents the name of the certification. 13 | // 14 | // GetSortedStandards returns the list of sorted standard keys. 15 | // 16 | // GetControlKeysFor returns the list of control keys for a given standard key. 17 | type Certification interface { 18 | GetKey() string 19 | GetSortedStandards() []string 20 | GetControlKeysFor(standardKey string) []string 21 | } 22 | -------------------------------------------------------------------------------- /pkg/lib/common/control.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | //go:generate mockery -name Control 8 | 9 | // Control is the interface for getting all the attributes for a given control. 10 | // Schema info: https://github.com/opencontrol/schemas#standards-documentation 11 | // 12 | // GetName returns the string representation of the control. 13 | // 14 | // GetFamily returns which family the control belongs to. 15 | type Control interface { 16 | GetName() string 17 | GetFamily() string 18 | GetDescription() string 19 | } 20 | -------------------------------------------------------------------------------- /pkg/lib/common/errors.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrNoDataToParse represents the case that there is no data to be found to be parsed (either nil or empty). 11 | ErrNoDataToParse = errors.New("No data to parse") 12 | // ErrUnknownSchemaVersion is thrown when the schema version is unknown to the parser. 13 | ErrUnknownSchemaVersion = errors.New("Unknown schema version") 14 | // ErrCantParseSemver is thrown when the semantic versioning can not be parsed. 15 | ErrCantParseSemver = errors.New("Can't parse semantic versioning of schema_version") 16 | // ErrReadFile is raised when a file can not be read 17 | ErrReadFile = errors.New("Unable to read the file") 18 | // ErrCertificationSchema is raised a certification cannot be parsed 19 | ErrCertificationSchema = errors.New("Unable to parse certification") 20 | // ErrStandardSchema is raised a standard cannot be parsed 21 | ErrStandardSchema = errors.New("Unable to parse standard") 22 | ) 23 | -------------------------------------------------------------------------------- /pkg/lib/common/mocks/Section.go: -------------------------------------------------------------------------------- 1 | // Code generated by mockery v1.0.0. DO NOT EDIT. 2 | package mocks 3 | 4 | import mock "github.com/stretchr/testify/mock" 5 | 6 | // Section is an autogenerated mock type for the Section type 7 | type Section struct { 8 | mock.Mock 9 | } 10 | 11 | // GetKey provides a mock function with given fields: 12 | func (_m *Section) GetKey() string { 13 | ret := _m.Called() 14 | 15 | var r0 string 16 | if rf, ok := ret.Get(0).(func() string); ok { 17 | r0 = rf() 18 | } else { 19 | r0 = ret.Get(0).(string) 20 | } 21 | 22 | return r0 23 | } 24 | 25 | // GetText provides a mock function with given fields: 26 | func (_m *Section) GetText() string { 27 | ret := _m.Called() 28 | 29 | var r0 string 30 | if rf, ok := ret.Get(0).(func() string); ok { 31 | r0 = rf() 32 | } else { 33 | r0 = ret.Get(0).(string) 34 | } 35 | 36 | return r0 37 | } 38 | -------------------------------------------------------------------------------- /pkg/lib/common/standard.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | //go:generate mockery -name Standard -testonly 8 | 9 | // Standard is the container of all the information for a particular Standard. 10 | // Schema info: https://github.com/opencontrol/schemas#standards-documentation 11 | // 12 | // GetName returns the name 13 | // 14 | // GetControls returns all controls associated with the standard 15 | // 16 | // GetControl returns a particular control 17 | // 18 | // GetSortedControls returns a list of sorted controls 19 | type Standard interface { 20 | GetName() string 21 | GetControls() map[string]Control 22 | GetControl(string) Control 23 | GetSortedControls() []string 24 | } 25 | -------------------------------------------------------------------------------- /pkg/lib/common/verifications.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | import ( 8 | "github.com/fvbommel/sortorder" 9 | ) 10 | 11 | // Verification struct holds data for a specific component and verification 12 | // This is an internal data structure that helps map standards and controls to components 13 | type Verification struct { 14 | ComponentKey string 15 | SatisfiesData Satisfies 16 | } 17 | 18 | // Verifications is a slice of type Verifications 19 | type Verifications []Verification 20 | 21 | // Len returns the length of the GeneralReferences slice 22 | func (slice Verifications) Len() int { 23 | return len(slice) 24 | } 25 | 26 | // Less returns true if a GeneralReference is less than another reference 27 | func (slice Verifications) Less(i, j int) bool { 28 | return sortorder.NaturalLess(slice[i].ComponentKey, slice[j].ComponentKey) 29 | } 30 | 31 | // Swap swaps the two GeneralReferences 32 | func (slice Verifications) Swap(i, j int) { 33 | slice[i], slice[j] = slice[j], slice[i] 34 | } 35 | -------------------------------------------------------------------------------- /pkg/lib/common/workspace.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package common 6 | 7 | //go:generate mockery -name Workspace -testonly 8 | 9 | // Workspace represents all the information such as components, standards, and certification as well as 10 | // the result information such as the justifications. 11 | type Workspace interface { 12 | LoadComponents(string) []error 13 | LoadStandards(string) []error 14 | LoadCertification(string) error 15 | GetCertification() Certification 16 | GetAllComponents() []Component 17 | GetComponent(componentKey string) (Component, bool) 18 | GetAllStandards() []Standard 19 | GetStandard(standardKey string) (Standard, bool) 20 | GetAllVerificationsWith(standardKey string, controlKey string) Verifications 21 | } 22 | -------------------------------------------------------------------------------- /pkg/lib/components/component_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package components 6 | 7 | import "testing" 8 | 9 | type keyTest struct { 10 | input string 11 | expected string 12 | } 13 | 14 | var keyTests = []keyTest{ 15 | // Check that the key is extracted by using the local directory 16 | {".", "."}, 17 | // Check that the key is extracted from the component directory 18 | {"system/component", "component"}, 19 | // Check that the key is extracted by using the system directory 20 | {"system", "system"}, 21 | } 22 | 23 | func TestGetKey(t *testing.T) { 24 | for _, example := range keyTests { 25 | actual := getKey(example.input) 26 | // Check that the actual key is the expected key 27 | if actual != example.expected { 28 | t.Errorf("Expected: `%s`, Actual: `%s`", example.expected, actual) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pkg/lib/opencontrol/mocks/SchemaParser.go: -------------------------------------------------------------------------------- 1 | package mocks 2 | 3 | import ( 4 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 5 | "github.com/stretchr/testify/mock" 6 | ) 7 | 8 | // SchemaParser is an autogenerated mock type for the SchemaParser type 9 | type SchemaParser struct { 10 | mock.Mock 11 | } 12 | 13 | // Parse provides a mock function with given fields: data 14 | func (_m *SchemaParser) Parse(data []byte) (common.OpenControl, error) { 15 | ret := _m.Called(data) 16 | 17 | var r0 common.OpenControl 18 | if rf, ok := ret.Get(0).(func([]byte) common.OpenControl); ok { 19 | r0 = rf(data) 20 | } else { 21 | r0 = ret.Get(0).(common.OpenControl) 22 | } 23 | 24 | var r1 error 25 | if rf, ok := ret.Get(1).(func([]byte) error); ok { 26 | r1 = rf(data) 27 | } else { 28 | r1 = ret.Error(1) 29 | } 30 | 31 | return r0, r1 32 | } 33 | -------------------------------------------------------------------------------- /pkg/lib/opencontrol/opencontrol.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package opencontrol 6 | 7 | import ( 8 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 9 | ) 10 | 11 | //go:generate mockery -name SchemaParser -testonly 12 | 13 | // Base is the common struct that all schemas must have. 14 | type Base struct { 15 | // SchemaVersion contains the schema version. 16 | SchemaVersion string `yaml:"schema_version"` 17 | } 18 | 19 | // GetSchemaVersion is a simple getter function of the schema version. 20 | func (b Base) GetSchemaVersion() string { 21 | return b.SchemaVersion 22 | } 23 | 24 | // SchemaParser is a generic interface that knows how parse different schema_versions. 25 | type SchemaParser interface { 26 | Parse(data []byte) (common.OpenControl, error) 27 | } 28 | -------------------------------------------------------------------------------- /pkg/lib/opencontrol/opencontrol_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package opencontrol_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestCommon(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Opencontrol Versions Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/lib/opencontrol/opencontrol_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package opencontrol 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | "github.com/onsi/ginkgo/extensions/table" 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | var _ = Describe("Base", func() { 14 | 15 | Describe("Retrieving the schema version", func() { 16 | table.DescribeTable("GetSchemaVersion", func(b Base, expectedVersion string) { 17 | assert.Equal(GinkgoT(), b.GetSchemaVersion(), expectedVersion) 18 | }, 19 | table.Entry("Empty / new base struct", Base{}, ""), 20 | table.Entry("regular base struct", Base{SchemaVersion: "1.0.0"}, "1.0.0"), 21 | ) 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /pkg/lib/opencontrol/versions/1.0.0/1.0.0_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package schema_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func Test1_0_0(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "1.0.0 Suite") 17 | } 18 | -------------------------------------------------------------------------------- /pkg/lib/standards/standard.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package standards 6 | 7 | import ( 8 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 9 | v1_0_0 "github.com/opencontrol/compliance-masonry/pkg/lib/standards/versions/1_0_0" 10 | "gopkg.in/yaml.v2" 11 | "io/ioutil" 12 | ) 13 | 14 | // Load will read the file at the given path and attempt to return a standard object. 15 | func Load(path string) (common.Standard, error) { 16 | var standard v1_0_0.Standard 17 | standardData, err := ioutil.ReadFile(path) 18 | if err != nil { 19 | return nil, common.ErrReadFile 20 | } 21 | err = yaml.Unmarshal(standardData, &standard) 22 | if err != nil { 23 | return nil, common.ErrStandardSchema 24 | } 25 | return standard, nil 26 | } 27 | -------------------------------------------------------------------------------- /pkg/lib/standards_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package lib 6 | 7 | import ( 8 | "github.com/opencontrol/compliance-masonry/pkg/lib/common" 9 | "github.com/opencontrol/compliance-masonry/pkg/lib/common/mocks" 10 | "github.com/stretchr/testify/assert" 11 | "testing" 12 | ) 13 | 14 | func TestGetStandard(t *testing.T) { 15 | // Setup map 16 | m := newStandards() 17 | // Get nil component. 18 | standard, found := m.get("test") 19 | assert.False(t, found) 20 | assert.Nil(t, standard) 21 | // Create mock component 22 | newStandard := new(mocks.Standard) 23 | newStandard.On("GetName").Return("test") 24 | // Test add method 25 | m.add(newStandard) 26 | // Try to retrieve the component again. 27 | standard, found = m.get("test") 28 | assert.True(t, found) 29 | assert.Equal(t, standard.GetName(), "test") 30 | } 31 | 32 | func TestBadLoadStandard(t *testing.T) { 33 | // Setup map 34 | m := newStandards() 35 | ws := localWorkspace{standards: m} 36 | err := ws.LoadStandard("fake.file") 37 | assert.NotNil(t, err) 38 | assert.Equal(t, common.ErrStandardSchema, err) 39 | } 40 | -------------------------------------------------------------------------------- /pkg/tests/test_masonry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package masonry_test 6 | 7 | import ( 8 | "bufio" 9 | "os/exec" 10 | "strings" 11 | 12 | . "github.com/onsi/ginkgo" 13 | . "github.com/onsi/gomega" 14 | "github.com/onsi/gomega/gexec" 15 | ) 16 | 17 | // Masonry is used to launch tests on the CLI 18 | func Masonry(args ...string) *gexec.Session { 19 | RegisterFailHandler(Fail) 20 | path, err := gexec.Build("github.com/opencontrol/compliance-masonry/cmd/masonry") 21 | Expect(err).NotTo(HaveOccurred()) 22 | cmd := exec.Command(path, args...) 23 | stdin, err := cmd.StdinPipe() 24 | Expect(err).ToNot(HaveOccurred()) 25 | buffer := bufio.NewWriter(stdin) 26 | _, _ = buffer.WriteString(strings.Join(args, " ")) 27 | _ = buffer.Flush() 28 | session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) 29 | Expect(err).NotTo(HaveOccurred()) 30 | session.Wait() 31 | gexec.CleanupBuildArtifacts() 32 | return session 33 | } 34 | -------------------------------------------------------------------------------- /test/fixtures/component_fixtures/common/EC2UnsupportedVersion/component.yaml: -------------------------------------------------------------------------------- 1 | documentation_complete: false 2 | name: Amazon Elastic Compute Cloud 3 | references: 4 | - name: Reference 5 | path: http://VerificationURL.com 6 | type: URL 7 | satisfies: 8 | - control_key: CM-2 9 | covered_by: 10 | - verification_key: EC2_Verification_1 11 | - component_key: UAA 12 | system_key: CloudFoundry 13 | verification_key: UAA_Verification_1 14 | implementation_status: partial 15 | narrative: Justification in narrative form 16 | standard_key: NIST-800-53 17 | schema_version: 1.0.0 18 | verifications: 19 | - key: EC2_Verification_2 20 | name: EC2 Governor 2 21 | path: artifact-ec2-1.png 22 | type: Image 23 | - key: EC2_Verification_1 24 | name: EC2 Verification 1 25 | path: http://VerificationURL.com 26 | type: URL -------------------------------------------------------------------------------- /test/fixtures/component_fixtures/common/EC2VersionNotSemver/component.yaml: -------------------------------------------------------------------------------- 1 | documentation_complete: false 2 | name: Amazon Elastic Compute Cloud 3 | references: 4 | - name: Reference 5 | path: http://VerificationURL.com 6 | type: URL 7 | satisfies: 8 | - control_key: CM-2 9 | covered_by: 10 | - verification_key: EC2_Verification_1 11 | - component_key: UAA 12 | system_key: CloudFoundry 13 | verification_key: UAA_Verification_1 14 | implementation_status: partial 15 | narrative: Justification in narrative form 16 | standard_key: NIST-800-53 17 | schema_version: 1.0 18 | verifications: 19 | - key: EC2_Verification_2 20 | name: EC2 Governor 2 21 | path: artifact-ec2-1.png 22 | type: Image 23 | - key: EC2_Verification_1 24 | name: EC2 Verification 1 25 | path: http://VerificationURL.com 26 | type: URL -------------------------------------------------------------------------------- /test/fixtures/component_fixtures/common/EC2_InvalidFieldTypeForVersion2_0/component.yaml: -------------------------------------------------------------------------------- 1 | documentation_complete: false 2 | name: Amazon Elastic Compute Cloud 3 | references: 4 | - name: Reference 5 | path: http://VerificationURL.com 6 | type: URL 7 | satisfies: 8 | - control_key: CM-2 9 | covered_by: "wrong" 10 | implementation_status: partial 11 | narrative: "Justification in narrative form for CM-2" 12 | standard_key: NIST-800-53 13 | schema_version: 2.0 14 | verifications: 15 | - key: EC2_Verification_2 16 | name: EC2 Governor 2 17 | path: artifact-ec2-1.png 18 | type: Image 19 | - key: EC2_Verification_1 20 | name: EC2 Verification 1 21 | path: http://VerificationURL.com 22 | type: URL -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/README.md: -------------------------------------------------------------------------------- 1 | ## Standards 2 | * [AC](standards/NIST-800-53-AC.md) 3 | * [AC-2](standards/NIST-800-53-AC-2.md) 4 | * [AC-6](standards/NIST-800-53-AC-6.md) 5 | * [CM](standards/NIST-800-53-CM.md) 6 | * [CM-2](standards/NIST-800-53-CM-2.md) 7 | * [1](standards/PCI-DSS-MAY-2015-1.md) 8 | * [1.1](standards/PCI-DSS-MAY-2015-1.1.md) 9 | * [1.1.1](standards/PCI-DSS-MAY-2015-1.1.1.md) 10 | * [2](standards/PCI-DSS-MAY-2015-2.md) 11 | * [2.1](standards/PCI-DSS-MAY-2015-2.1.md) 12 | 13 | ## Components 14 | * [Amazon Elastic Compute Cloud](components/EC2.md) 15 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/SUMMARY.md: -------------------------------------------------------------------------------- 1 | ## Standards 2 | * [AC](standards/NIST-800-53-AC.md) 3 | * [AC-2](standards/NIST-800-53-AC-2.md) 4 | * [AC-6](standards/NIST-800-53-AC-6.md) 5 | * [CM](standards/NIST-800-53-CM.md) 6 | * [CM-2](standards/NIST-800-53-CM-2.md) 7 | * [1](standards/PCI-DSS-MAY-2015-1.md) 8 | * [1.1](standards/PCI-DSS-MAY-2015-1.1.md) 9 | * [1.1.1](standards/PCI-DSS-MAY-2015-1.1.1.md) 10 | * [2](standards/PCI-DSS-MAY-2015-2.md) 11 | * [2.1](standards/PCI-DSS-MAY-2015-2.1.md) 12 | 13 | ## Components 14 | * [Amazon Elastic Compute Cloud](components/EC2.md) 15 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/components/EC2.md: -------------------------------------------------------------------------------- 1 | # Amazon Elastic Compute Cloud 2 | ## References 3 | * [Reference](http://VerificationURL.com) 4 | ## Verifications 5 | * [EC2 Governor 2](artifact-ec2-1.png) 6 | * [EC2 Verification 1](http://VerificationURL.com) 7 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC-6.md: -------------------------------------------------------------------------------- 1 | # NIST-800-53-AC-6 2 | ## Least Privilege 3 | #### Description 4 | 'The organization employs the principle of least privilege, allowing only 5 | authorized accesses for users (or processes acting on behalf of users) which 6 | are necessary to accomplish assigned tasks in accordance with organizational 7 | missions and business functions.' 8 | 9 | No information found for the combination of standard NIST-800-53 and control AC-6 10 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-AC.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-AC 2 | * [AC-2: Account Management](NIST-800-53-AC-2.md) 3 | * [AC-6: Least Privilege](NIST-800-53-AC-6.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM-2.md: -------------------------------------------------------------------------------- 1 | # NIST-800-53-CM-2 2 | ## Baseline Configuration 3 | #### Description 4 | 'The organization develops, documents, and maintains under configuration 5 | control, a current baseline configuration of the information system.' 6 | 7 | #### Amazon Elastic Compute Cloud 8 | 9 | ##### Responsible Role: AWS Staff 10 | 11 | ##### Control Origin: shared 12 | 13 | ##### a 14 | Justification in narrative form A for CM-2 15 | 16 | ##### b 17 | Justification in narrative form B for CM-2 18 | Covered By: 19 | * [Amazon Elastic Compute Cloud - EC2 Verification 1](../components/EC2.md) 20 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/NIST-800-53-CM.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-CM 2 | * [CM-2: Baseline Configuration](NIST-800-53-CM-2.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-1.1.1 2 | ## A formal process for approving and testing all network connections and changes to the firewall and router configurations 3 | 4 | No information found for the combination of standard PCI-DSS-MAY-2015 and control 1.1.1 5 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-1.1 2 | ## Establish and implement firewall and router configuration standards. 3 | 4 | #### Amazon Elastic Compute Cloud 5 | 6 | ##### Responsible Role: AWS Staff 7 | 8 | ##### Parameters: 9 | 10 | ###### a 11 | Parameter A for 1.1 12 | 13 | ###### b 14 | Parameter B for 1.1 15 | 16 | ##### Control Origin: inherited 17 | 18 | No narrative found for the combination of standard PCI-DSS-MAY-2015 and control 1.1 19 | Covered By: 20 | * [Amazon Elastic Compute Cloud - EC2 Verification 1](../components/EC2.md) 21 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-1.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-1 2 | * [1.1: Establish and implement firewall and router configuration standards.](PCI-DSS-MAY-2015-1.1.md) 3 | * [1.1.1: A formal process for approving and testing all network connections and changes to the firewall and router configurations](PCI-DSS-MAY-2015-1.1.1.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-2.1 2 | ## Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network. 3 | 4 | #### Amazon Elastic Compute Cloud 5 | 6 | ##### Responsible Role: AWS Staff 7 | 8 | ##### Control Origin: inherited 9 | Justification in narrative form for 2.1 10 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export/standards/PCI-DSS-MAY-2015-2.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-2 2 | * [2.1: Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network.](PCI-DSS-MAY-2015-2.1.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/README.md: -------------------------------------------------------------------------------- 1 | ## Standards 2 | * [AC](standards/NIST-800-53-AC.md) 3 | * [AC-2](standards/NIST-800-53-AC-2.md) 4 | * [AC-6](standards/NIST-800-53-AC-6.md) 5 | * [CM](standards/NIST-800-53-CM.md) 6 | * [CM-2](standards/NIST-800-53-CM-2.md) 7 | * [1](standards/PCI-DSS-MAY-2015-1.md) 8 | * [1.1](standards/PCI-DSS-MAY-2015-1.1.md) 9 | * [1.1.1](standards/PCI-DSS-MAY-2015-1.1.1.md) 10 | * [2](standards/PCI-DSS-MAY-2015-2.md) 11 | * [2.1](standards/PCI-DSS-MAY-2015-2.1.md) 12 | 13 | ## Components 14 | * [Amazon Elastic Compute Cloud](components/EC2.md) 15 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/SUMMARY.md: -------------------------------------------------------------------------------- 1 | This is an SSP 2 | ## Standards 3 | * [AC](standards/NIST-800-53-AC.md) 4 | * [AC-2](standards/NIST-800-53-AC-2.md) 5 | * [AC-6](standards/NIST-800-53-AC-6.md) 6 | * [CM](standards/NIST-800-53-CM.md) 7 | * [CM-2](standards/NIST-800-53-CM-2.md) 8 | * [1](standards/PCI-DSS-MAY-2015-1.md) 9 | * [1.1](standards/PCI-DSS-MAY-2015-1.1.md) 10 | * [1.1.1](standards/PCI-DSS-MAY-2015-1.1.1.md) 11 | * [2](standards/PCI-DSS-MAY-2015-2.md) 12 | * [2.1](standards/PCI-DSS-MAY-2015-2.1.md) 13 | 14 | ## Components 15 | * [Amazon Elastic Compute Cloud](components/EC2.md) 16 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/components/EC2.md: -------------------------------------------------------------------------------- 1 | # Amazon Elastic Compute Cloud 2 | ## References 3 | * [Reference](http://VerificationURL.com) 4 | ## Verifications 5 | * [EC2 Governor 2](artifact-ec2-1.png) 6 | * [EC2 Verification 1](http://VerificationURL.com) 7 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-2.md: -------------------------------------------------------------------------------- 1 | # NIST-800-53-AC-2 2 | ## Account Management 3 | 4 | No information found for the combination of standard NIST-800-53 and control AC-2 5 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC-6.md: -------------------------------------------------------------------------------- 1 | # NIST-800-53-AC-6 2 | ## Least Privilege 3 | 4 | No information found for the combination of standard NIST-800-53 and control AC-6 5 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-AC.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-AC 2 | * [AC-2: Account Management](NIST-800-53-AC-2.md) 3 | * [AC-6: Least Privilege](NIST-800-53-AC-6.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM-2.md: -------------------------------------------------------------------------------- 1 | # NIST-800-53-CM-2 2 | ## Baseline Configuration 3 | 4 | #### Amazon Elastic Compute Cloud 5 | 6 | ##### Responsible Role: AWS Staff 7 | 8 | ##### Control Origin: shared 9 | 10 | ##### a 11 | Justification in narrative form A for CM-2 12 | 13 | ##### b 14 | Justification in narrative form B for CM-2 15 | Covered By: 16 | * [Amazon Elastic Compute Cloud - EC2 Verification 1](../components/EC2.md) 17 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/NIST-800-53-CM.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-CM 2 | * [CM-2: Baseline Configuration](NIST-800-53-CM-2.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-1.1.1 2 | ## A formal process for approving and testing all network connections and changes to the firewall and router configurations 3 | 4 | No information found for the combination of standard PCI-DSS-MAY-2015 and control 1.1.1 5 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-1.1 2 | ## Establish and implement firewall and router configuration standards. 3 | 4 | #### Amazon Elastic Compute Cloud 5 | 6 | ##### Responsible Role: AWS Staff 7 | 8 | ##### Parameters: 9 | 10 | ###### a 11 | Parameter A for 1.1 12 | 13 | ###### b 14 | Parameter B for 1.1 15 | 16 | ##### Control Origin: inherited 17 | 18 | No narrative found for the combination of standard PCI-DSS-MAY-2015 and control 1.1 19 | Covered By: 20 | * [Amazon Elastic Compute Cloud - EC2 Verification 1](../components/EC2.md) 21 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-1.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-1 2 | * [1.1: Establish and implement firewall and router configuration standards.](PCI-DSS-MAY-2015-1.1.md) 3 | * [1.1.1: A formal process for approving and testing all network connections and changes to the firewall and router configurations](PCI-DSS-MAY-2015-1.1.1.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.1.md: -------------------------------------------------------------------------------- 1 | # PCI-DSS-MAY-2015-2.1 2 | ## Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network. 3 | 4 | #### Amazon Elastic Compute Cloud 5 | 6 | ##### Responsible Role: AWS Staff 7 | 8 | ##### Control Origin: inherited 9 | Justification in narrative form for 2.1 10 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/standards/PCI-DSS-MAY-2015-2.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-2 2 | * [2.1: Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network.](PCI-DSS-MAY-2015-2.1.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/complete_export_with_markdown/system_documentation/about-the-ssp.md: -------------------------------------------------------------------------------- 1 | About the System Security Plan 2 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/components_readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## Components 3 | * [Amazon Elastic Compute Cloud](components/EC2.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/general_readme.md: -------------------------------------------------------------------------------- 1 | ## Standards 2 | * [AC-2](standards/NIST-800-53-AC-2.md) 3 | * [AC-6](standards/NIST-800-53-AC-6.md) 4 | * [CM-2](standards/NIST-800-53-CM-2.md) 5 | * [1.1](standards/PCI-DSS-MAY-2015-1.1.md) 6 | * [1.1.1](standards/PCI-DSS-MAY-2015-1.1.1.md) 7 | * [2.1](standards/PCI-DSS-MAY-2015-2.1.md) 8 | 9 | ## Components 10 | * [Amazon Elastic Compute Cloud](components/EC2.md) 11 | * [User Account and Authentication (UAA) Server](components/UAA.md) 12 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-AC.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-AC 2 | * [AC-2: Account Management](NIST-800-53-AC-2.md) 3 | * [AC-6: Least Privilege](NIST-800-53-AC-6.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/standards/NIST-800-53-CM.md: -------------------------------------------------------------------------------- 1 | ## NIST-800-53-CM 2 | * [CM-2: Baseline Configuration](NIST-800-53-CM-2.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-1.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-1 2 | * [1.1: Establish and implement firewall and router configuration standards.](PCI-DSS-MAY-2015-1.1.md) 3 | * [1.1.1: A formal process for approving and testing all network connections and changes to the firewall and router configurations](PCI-DSS-MAY-2015-1.1.1.md) 4 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/standards/PCI-DSS-MAY-2015-2.md: -------------------------------------------------------------------------------- 1 | ## PCI-DSS-MAY-2015-2 2 | * [2.1: Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network.](PCI-DSS-MAY-2015-2.1.md) 3 | -------------------------------------------------------------------------------- /test/fixtures/exports_fixtures/gitbook_exports/standards_readme.md: -------------------------------------------------------------------------------- 1 | ## Standards 2 | * [AC](standards/NIST-800-53-AC.md) 3 | * [AC-2: Account Management](standards/NIST-800-53-AC-2.md) 4 | * [AC-6: Least Privilege](standards/NIST-800-53-AC-6.md) 5 | * [CM](standards/NIST-800-53-CM.md) 6 | * [CM-2: Baseline Configuration](standards/NIST-800-53-CM-2.md) 7 | * [1](standards/PCI-DSS-MAY-2015-1.md) 8 | * [1.1: Establish and implement firewall and router configuration standards.](standards/PCI-DSS-MAY-2015-1.1.md) 9 | * [1.1.1: A formal process for approving and testing all network connections and changes to the firewall and router configurations](standards/PCI-DSS-MAY-2015-1.1.1.md) 10 | * [2](standards/PCI-DSS-MAY-2015-2.md) 11 | * [2.1: Always change vendor-supplied defaults and remove or disable unnecessary default accounts before installing a system on the network.](standards/PCI-DSS-MAY-2015-2.1.md) 12 | -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures/certifications/LATO.yaml: -------------------------------------------------------------------------------- 1 | name: LATO 2 | standards: 3 | NIST-800-53: 4 | AC-2: {} 5 | AC-6: {} 6 | CM-2: {} 7 | PCI-DSS-MAY-2015: 8 | 1.1: {} 9 | 1.1.1: {} 10 | 2.1: {} 11 | -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/test/fixtures/opencontrol_fixtures/components/EC2/artifact-ec2-1.png -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_complete/certifications/LATO.yaml: -------------------------------------------------------------------------------- 1 | name: LATO 2 | standards: 3 | NIST-800-53: 4 | AC-2: {} 5 | AC-6: {} 6 | CM-2: {} 7 | PCI-DSS-MAY-2015: 8 | 1.1: {} 9 | 1.1.1: {} 10 | 2.1: {} 11 | -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/test/fixtures/opencontrol_fixtures_complete/components/EC2/artifact-ec2-1.png -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_with_markdown/certifications/LATO.yaml: -------------------------------------------------------------------------------- 1 | name: LATO 2 | standards: 3 | NIST-800-53: 4 | AC-2: {} 5 | AC-6: {} 6 | CM-2: {} 7 | PCI-DSS-MAY-2015: 8 | 1.1: {} 9 | 1.1.1: {} 10 | 2.1: {} 11 | -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/test/fixtures/opencontrol_fixtures_with_markdown/components/EC2/artifact-ec2-1.png -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_with_markdown/markdowns/SUMMARY.md: -------------------------------------------------------------------------------- 1 | This is an SSP 2 | -------------------------------------------------------------------------------- /test/fixtures/opencontrol_fixtures_with_markdown/markdowns/system_documentation/about-the-ssp.md: -------------------------------------------------------------------------------- 1 | About the System Security Plan 2 | -------------------------------------------------------------------------------- /test/fixtures/standards_fixtures/BrokenStandard/NIST-800-53.yaml: -------------------------------------------------------------------------------- 1 | broken non 2 | -------------------------------------------------------------------------------- /tools/mapset/map_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package mapset 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/ginkgo/extensions/table" 10 | "github.com/stretchr/testify/assert" 11 | ) 12 | 13 | var _ = Describe("Map", func() { 14 | var ( 15 | m = Init() 16 | ) 17 | DescribeTable("Reserve", func(key, value string, expectedError error, expectedSuccess bool, expectedValue string) { 18 | res := m.Reserve(key, value) 19 | assert.Equal(GinkgoT(), expectedError, res.Error) 20 | assert.Equal(GinkgoT(), expectedSuccess, res.Success) 21 | assert.Equal(GinkgoT(), expectedValue, res.Value) 22 | }, 23 | Entry("Regular reservation", "key1", "value", nil, true, "value"), 24 | Entry("Repeat reservation", "key1", "value", nil, false, "value"), 25 | Entry("no key", "", "value", ErrEmptyInput, false, ""), 26 | Entry("no value", "key1", "", ErrEmptyInput, false, ""), 27 | ) 28 | 29 | }) 30 | -------------------------------------------------------------------------------- /tools/mapset/mapset_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package mapset_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestMapset(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Mapset Suite") 17 | } 18 | -------------------------------------------------------------------------------- /tools/vcs/mocks/RepoManager.go: -------------------------------------------------------------------------------- 1 | // Code generated by mockery v1.0.0. DO NOT EDIT. 2 | package mocks 3 | 4 | import mock "github.com/stretchr/testify/mock" 5 | 6 | // RepoManager is an autogenerated mock type for the RepoManager type 7 | type RepoManager struct { 8 | mock.Mock 9 | } 10 | 11 | // Clone provides a mock function with given fields: url, revision, dir 12 | func (_m *RepoManager) Clone(url string, revision string, dir string) error { 13 | ret := _m.Called(url, revision, dir) 14 | 15 | var r0 error 16 | if rf, ok := ret.Get(0).(func(string, string, string) error); ok { 17 | r0 = rf(url, revision, dir) 18 | } else { 19 | r0 = ret.Error(0) 20 | } 21 | 22 | return r0 23 | } 24 | -------------------------------------------------------------------------------- /tools/vcs/vcs_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package vcs_test 6 | 7 | import ( 8 | . "github.com/onsi/ginkgo" 9 | . "github.com/onsi/gomega" 10 | 11 | "testing" 12 | ) 13 | 14 | func TestVcs(t *testing.T) { 15 | RegisterFailHandler(Fail) 16 | RunSpecs(t, "Vcs Suite") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/vcs/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/vcs/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: setup 2 | setup: 3 | go get -u gopkg.in/alecthomas/gometalinter.v1 4 | gometalinter.v1 --install 5 | 6 | .PHONY: test 7 | test: validate lint 8 | @echo "==> Running tests" 9 | go test -v 10 | 11 | .PHONY: validate 12 | validate: 13 | # misspell finds the work adresář (used in bzr.go) as a mispelling of 14 | # address. It finds adres. An issue has been filed at 15 | # https://github.com/client9/misspell/issues/99. In the meantime adding 16 | # adres to the ignore list. 17 | @echo "==> Running static validations" 18 | @gometalinter.v1 \ 19 | --disable-all \ 20 | --linter "misspell:misspell -i adres -j 1 {path}/*.go:PATH:LINE:COL:MESSAGE" \ 21 | --enable deadcode \ 22 | --severity deadcode:error \ 23 | --enable gofmt \ 24 | --enable gosimple \ 25 | --enable ineffassign \ 26 | --enable misspell \ 27 | --enable vet \ 28 | --tests \ 29 | --vendor \ 30 | --deadline 60s \ 31 | ./... || exit_code=1 32 | 33 | .PHONY: lint 34 | lint: 35 | @echo "==> Running linters" 36 | @gometalinter.v1 \ 37 | --disable-all \ 38 | --enable golint \ 39 | --vendor \ 40 | --deadline 60s \ 41 | ./... || : 42 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/vcs/appveyor.yml: -------------------------------------------------------------------------------- 1 | 2 | version: build-{build}.{branch} 3 | 4 | clone_folder: C:\gopath\src\github.com\Masterminds\vcs 5 | shallow_clone: true 6 | 7 | environment: 8 | GOPATH: C:\gopath 9 | 10 | platform: 11 | - x64 12 | 13 | install: 14 | - go version 15 | - go env 16 | - choco install -y bzr 17 | - set PATH=C:\Program Files (x86)\Bazaar;%PATH% 18 | - bzr --version 19 | 20 | build_script: 21 | - go install -v ./... 22 | 23 | test_script: 24 | - go test -v 25 | 26 | deploy: off 27 | -------------------------------------------------------------------------------- /vendor/github.com/Masterminds/vcs/glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/Masterminds/vcs 2 | homepage: https://github.com/Masterminds/vcs 3 | license: MIT 4 | owners: 5 | - name: Matt Farina 6 | email: matt@mattfarina.com 7 | homepage: https://www.mattfarina.com/ 8 | import: [] 9 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | matrix: 3 | include: 4 | - go: 1.4.x 5 | - go: 1.5.x 6 | - go: 1.6.x 7 | - go: 1.7.x 8 | - go: 1.8.x 9 | - go: 1.9.x 10 | - go: 1.10.x 11 | - go: 1.11.x 12 | - go: 1.12.x 13 | - go: tip 14 | allow_failures: 15 | - go: tip 16 | install: 17 | - go get golang.org/x/tools/cmd/cover 18 | - go get github.com/mattn/goveralls 19 | script: 20 | - echo "Test and track coverage" ; $HOME/gopath/bin/goveralls -package "." -service=travis-ci 21 | -repotoken=$COVERALLS_TOKEN 22 | - echo "Build examples" ; cd examples && go build 23 | - echo "Check if gofmt'd" ; diff -u <(echo -n) <(gofmt -d -s .) 24 | env: 25 | global: 26 | secure: HroGEAUQpVq9zX1b1VIkraLiywhGbzvNnTZq2TMxgK7JHP8xqNplAeF1izrR2i4QLL9nsY+9WtYss4QuPvEtZcVHUobw6XnL6radF7jS1LgfYZ9Y7oF+zogZ2I5QUMRLGA7rcxQ05s7mKq3XZQfeqaNts4bms/eZRefWuaFZbkw= 27 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/blang/semver 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/json.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // MarshalJSON implements the encoding/json.Marshaler interface. 8 | func (v Version) MarshalJSON() ([]byte, error) { 9 | return json.Marshal(v.String()) 10 | } 11 | 12 | // UnmarshalJSON implements the encoding/json.Unmarshaler interface. 13 | func (v *Version) UnmarshalJSON(data []byte) (err error) { 14 | var versionString string 15 | 16 | if err = json.Unmarshal(data, &versionString); err != nil { 17 | return 18 | } 19 | 20 | *v, err = Parse(versionString) 21 | 22 | return 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "blang", 3 | "bugs": { 4 | "URL": "https://github.com/blang/semver/issues", 5 | "url": "https://github.com/blang/semver/issues" 6 | }, 7 | "gx": { 8 | "dvcsimport": "github.com/blang/semver" 9 | }, 10 | "gxVersion": "0.10.0", 11 | "language": "go", 12 | "license": "MIT", 13 | "name": "semver", 14 | "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", 15 | "version": "3.6.1" 16 | } 17 | 18 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/sort.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | // Versions represents multiple versions. 8 | type Versions []Version 9 | 10 | // Len returns length of version collection 11 | func (s Versions) Len() int { 12 | return len(s) 13 | } 14 | 15 | // Swap swaps two versions inside the collection by its indices 16 | func (s Versions) Swap(i, j int) { 17 | s[i], s[j] = s[j], s[i] 18 | } 19 | 20 | // Less checks if version at index i is less than version at index j 21 | func (s Versions) Less(i, j int) bool { 22 | return s[i].LT(s[j]) 23 | } 24 | 25 | // Sort sorts a slice of versions 26 | func Sort(versions []Version) { 27 | sort.Sort(Versions(versions)) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/sql.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | ) 7 | 8 | // Scan implements the database/sql.Scanner interface. 9 | func (v *Version) Scan(src interface{}) (err error) { 10 | var str string 11 | switch src := src.(type) { 12 | case string: 13 | str = src 14 | case []byte: 15 | str = string(src) 16 | default: 17 | return fmt.Errorf("version.Scan: cannot convert %T to string", src) 18 | } 19 | 20 | if t, err := Parse(str); err == nil { 21 | *v = t 22 | } 23 | 24 | return 25 | } 26 | 27 | // Value implements the database/sql/driver.Valuer interface. 28 | func (v Version) Value() (driver.Value, error) { 29 | return v.String(), nil 30 | } 31 | -------------------------------------------------------------------------------- /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/fatih/set/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 1.3 3 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/set/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Fatih Arslan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.go] 4 | indent_style = tab 5 | indent_size = 4 6 | insert_final_newline = true 7 | 8 | [*.{yml,yaml}] 9 | indent_style = space 10 | indent_size = 2 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.gitattributes: -------------------------------------------------------------------------------- 1 | go.sum linguist-generated 2 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.gitignore: -------------------------------------------------------------------------------- 1 | # Setup a Global .gitignore for OS and editor generated files: 2 | # https://help.github.com/articles/ignoring-files 3 | # git config --global core.excludesfile ~/.gitignore_global 4 | 5 | .vagrant 6 | *.sublime-project 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - "stable" 6 | - "1.11.x" 7 | - "1.10.x" 8 | - "1.9.x" 9 | 10 | matrix: 11 | include: 12 | - go: "stable" 13 | env: GOLINT=true 14 | allow_failures: 15 | - go: tip 16 | fast_finish: true 17 | 18 | 19 | before_install: 20 | - if [ ! -z "${GOLINT}" ]; then go get -u golang.org/x/lint/golint; fi 21 | 22 | script: 23 | - go test --race ./... 24 | 25 | after_script: 26 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 27 | - if [ ! -z "${GOLINT}" ]; then echo running golint; golint --set_exit_status ./...; else echo skipping golint; fi 28 | - go vet ./... 29 | 30 | os: 31 | - linux 32 | - osx 33 | - windows 34 | 35 | notifications: 36 | email: false 37 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/fen.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 | // +build solaris 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | // Watcher watches a set of files, delivering events to a channel. 14 | type Watcher struct { 15 | Events chan Event 16 | Errors chan error 17 | } 18 | 19 | // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. 20 | func NewWatcher() (*Watcher, error) { 21 | return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") 22 | } 23 | 24 | // Close removes all watches and closes the events channel. 25 | func (w *Watcher) Close() error { 26 | return nil 27 | } 28 | 29 | // Add starts watching the named file or directory (non-recursively). 30 | func (w *Watcher) Add(name string) error { 31 | return nil 32 | } 33 | 34 | // Remove stops watching the the named file or directory (non-recursively). 35 | func (w *Watcher) Remove(name string) error { 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/fsnotify/fsnotify 2 | 3 | go 1.13 4 | 5 | require golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9 6 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9 h1:L2auWcuQIvxz9xSEqzESnV/QN/gNRXNApHi3fYwl2w0= 2 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 3 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY | unix.O_CLOEXEC 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY | unix.O_CLOEXEC 13 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | # Folders 6 | _obj 7 | _test 8 | # Architecture specific extensions/prefixes 9 | *.[568vq] 10 | [568vq].out 11 | *.cgo1.go 12 | *.cgo2.c 13 | _cgo_defun.c 14 | _cgo_gotypes.go 15 | _cgo_export.* 16 | _testmain.go 17 | *.exe 18 | *.test 19 | *.prof 20 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015 Frits van Bommel 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 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. 18 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/README.md: -------------------------------------------------------------------------------- 1 | # sortorder [![PkgGoDev](https://pkg.go.dev/badge/github.com/fvbommel/sortorder)](https://pkg.go.dev/github.com/fvbommel/sortorder) 2 | 3 | import "github.com/fvbommel/sortorder" 4 | 5 | Sort orders and comparison functions. 6 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/doc.go: -------------------------------------------------------------------------------- 1 | // Package sortorder implements sort orders and comparison functions. 2 | // 3 | // Currently, it only implements so-called "natural order", where integers 4 | // embedded in strings are compared by value. 5 | package sortorder 6 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/fvbommel/sortorder 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /vendor/github.com/fvbommel/sortorder/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/vendor/github.com/fvbommel/sortorder/go.sum -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 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/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .test/ -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | script: 4 | - go test -race -v ./... 5 | 6 | go: 7 | - "1.9" 8 | - "1.10" 9 | - "1.11" 10 | - "1.12" 11 | - "1.13" 12 | - tip 13 | 14 | matrix: 15 | allow_failures: 16 | - go: tip 17 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | 3 | RUN mkdir -p $GOPATH/src/github.com/nxadm/tail/ 4 | ADD . $GOPATH/src/github.com/nxadm/tail/ 5 | 6 | # expecting to fetch dependencies successfully. 7 | RUN go get -v github.com/nxadm/tail 8 | 9 | # expecting to run the test successfully. 10 | RUN go test -v github.com/nxadm/tail 11 | 12 | # expecting to install successfully 13 | RUN go install -v github.com/nxadm/tail 14 | RUN go install -v github.com/nxadm/tail/cmd/gotail 15 | 16 | RUN $GOPATH/bin/gotail -h || true 17 | 18 | ENV PATH $GOPATH/bin:$PATH 19 | CMD ["gotail"] 20 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/nxadm/tail.svg?branch=master)](https://travis-ci.org/nxadm/tail) 2 | 3 | This is repo is forked from the dormant upstream repo at 4 | [hpcloud](https://github.com/hpcloud/tail). This fork adds support for go 5 | modules, updates the dependencies, adds features and fixes bugs. Go 1.9 is 6 | the oldest compiler release supported. 7 | 8 | # Go package for tail-ing files 9 | 10 | A Go package striving to emulate the features of the BSD `tail` program. 11 | 12 | ```Go 13 | t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true}) 14 | if err != nil { 15 | panic(err) 16 | } 17 | 18 | for line := range t.Lines { 19 | fmt.Println(line.Text) 20 | } 21 | ``` 22 | 23 | See [API documentation](http://godoc.org/github.com/nxadm/tail). 24 | 25 | ## Log rotation 26 | 27 | Tail comes with full support for truncation/move detection as it is 28 | designed to work with log rotation tools. 29 | 30 | ## Installing 31 | 32 | go get github.com/nxadm/tail/... 33 | 34 | ## Windows support 35 | 36 | This package [needs assistance](https://github.com/nxadm/tail/labels/Windows) for full Windows support. 37 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 0.{build} 2 | skip_tags: true 3 | cache: C:\Users\appveyor\AppData\Local\NuGet\Cache 4 | build_script: 5 | - SET GOPATH=c:\workspace 6 | - go test -v -race ./... 7 | test: off 8 | clone_folder: c:\workspace\src\github.com\nxadm\tail 9 | branches: 10 | only: 11 | - master 12 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/nxadm/tail 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/fsnotify/fsnotify v1.4.7 7 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd // indirect 8 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/go.sum: -------------------------------------------------------------------------------- 1 | github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 2 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 3 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd h1:DBH9mDw0zluJT/R+nGuV3jWFWLFaHyYZWD4tOT+cjn0= 4 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 5 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 6 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 7 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/ratelimiter/Licence: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 99designs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/ratelimiter/storage.go: -------------------------------------------------------------------------------- 1 | package ratelimiter 2 | 3 | type Storage interface { 4 | GetBucketFor(string) (*LeakyBucket, error) 5 | SetBucketFor(string, LeakyBucket) error 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/tail_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package tail 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func OpenFile(name string) (file *os.File, err error) { 10 | return os.Open(name) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/tail_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package tail 4 | 5 | import ( 6 | "github.com/nxadm/tail/winfile" 7 | "os" 8 | ) 9 | 10 | func OpenFile(name string) (file *os.File, err error) { 11 | return winfile.OpenFile(name, os.O_RDONLY, 0) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/watch/filechanges.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | type FileChanges struct { 4 | Modified chan bool // Channel to get notified of modifications 5 | Truncated chan bool // Channel to get notified of truncations 6 | Deleted chan bool // Channel to get notified of deletions/renames 7 | } 8 | 9 | func NewFileChanges() *FileChanges { 10 | return &FileChanges{ 11 | make(chan bool, 1), make(chan bool, 1), make(chan bool, 1)} 12 | } 13 | 14 | func (fc *FileChanges) NotifyModified() { 15 | sendOnlyIfEmpty(fc.Modified) 16 | } 17 | 18 | func (fc *FileChanges) NotifyTruncated() { 19 | sendOnlyIfEmpty(fc.Truncated) 20 | } 21 | 22 | func (fc *FileChanges) NotifyDeleted() { 23 | sendOnlyIfEmpty(fc.Deleted) 24 | } 25 | 26 | // sendOnlyIfEmpty sends on a bool channel only if the channel has no 27 | // backlog to be read by other goroutines. This concurrency pattern 28 | // can be used to notify other goroutines if and only if they are 29 | // looking for it (i.e., subsequent notifications can be compressed 30 | // into one). 31 | func sendOnlyIfEmpty(ch chan bool) { 32 | select { 33 | case ch <- true: 34 | default: 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/nxadm/tail/watch/watch.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 HPE Software Inc. All rights reserved. 2 | // Copyright (c) 2013 ActiveState Software Inc. All rights reserved. 3 | 4 | package watch 5 | 6 | import "gopkg.in/tomb.v1" 7 | 8 | // FileWatcher monitors file-level events. 9 | type FileWatcher interface { 10 | // BlockUntilExists blocks until the file comes into existence. 11 | BlockUntilExists(*tomb.Tomb) error 12 | 13 | // ChangeEvents reports on changes to a file, be it modification, 14 | // deletion, renames or truncations. Returned FileChanges group of 15 | // channels will be closed, thus become unusable, after a deletion 16 | // or truncation event. 17 | // In order to properly report truncations, ChangeEvents requires 18 | // the caller to pass their current offset in the file. 19 | ChangeEvents(*tomb.Tomb, int64) (*FileChanges, error) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | TODO 3 | tmp/**/* 4 | *.coverprofile 5 | .vscode 6 | .idea/ 7 | *.log 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.13.x 4 | - 1.14.x 5 | - tip 6 | 7 | cache: 8 | directories: 9 | - $GOPATH/pkg/mod 10 | 11 | # allow internal package imports, necessary for forked repositories 12 | go_import_path: github.com/onsi/ginkgo 13 | 14 | install: 15 | - GO111MODULE="off" go get -v -t ./... 16 | - GO111MODULE="off" go get golang.org/x/tools/cmd/cover 17 | - GO111MODULE="off" go get github.com/onsi/gomega 18 | - GO111MODULE="off" go install github.com/onsi/ginkgo/ginkgo 19 | - export PATH=$PATH:$HOME/gopath/bin 20 | 21 | script: 22 | - GO111MODULE="on" go mod tidy 23 | - diff -u <(echo -n) <(git diff go.mod) 24 | - diff -u <(echo -n) <(git diff go.sum) 25 | - $HOME/gopath/bin/ginkgo -r --randomizeAllSpecs --randomizeSuites --race --trace && go vet 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/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 `git log --pretty=format:'- %s [%h]' HEAD...vX.X.X` to list all the commits since the last release 5 | - Categorize the changes into 6 | - Breaking Changes (requires a major version) 7 | - New Features (minor version) 8 | - Fixes (fix version) 9 | - Maintenance (which in general should not be mentioned in `CHANGELOG.md` as they have no user impact) 10 | 1. Update `VERSION` in `config/config.go` 11 | 1. Create a commit with the version number as the commit message (e.g. `v1.3.0`) 12 | 1. Tag the commit with the version number as the tag name (e.g. `v1.3.0`) 13 | 1. Push the commit and tag to GitHub 14 | 1. Create a new [GitHub release](https://help.github.com/articles/creating-releases/) with the version number as the tag (e.g. `v1.3.0`). List the key changes in the release notes. 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/onsi/ginkgo 2 | 3 | require ( 4 | github.com/fsnotify/fsnotify v1.4.9 // indirect 5 | github.com/nxadm/tail v1.4.4 6 | github.com/onsi/gomega v1.10.1 7 | golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 8 | golang.org/x/text v0.3.2 // indirect 9 | ) 10 | 11 | go 1.13 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/global/init.go: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/onsi/ginkgo/internal/failer" 7 | "github.com/onsi/ginkgo/internal/suite" 8 | ) 9 | 10 | const DefaultTimeout = time.Duration(1 * time.Second) 11 | 12 | var Suite *suite.Suite 13 | var Failer *failer.Failer 14 | 15 | func init() { 16 | InitializeGlobals() 17 | } 18 | 19 | func InitializeGlobals() { 20 | Failer = failer.New() 21 | Suite = suite.New(Failer) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/interfaces.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/types" 5 | ) 6 | 7 | type BasicNode interface { 8 | Type() types.SpecComponentType 9 | Run() (types.SpecState, types.SpecFailure) 10 | CodeLocation() types.CodeLocation 11 | } 12 | 13 | type SubjectNode interface { 14 | BasicNode 15 | 16 | Text() string 17 | Flag() types.FlagType 18 | Samples() int 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | import "os" 4 | 5 | /* 6 | The OutputInterceptor is used by the ForwardingReporter to 7 | intercept and capture all stdin and stderr output during a test run. 8 | */ 9 | type OutputInterceptor interface { 10 | StartInterceptingOutput() error 11 | StopInterceptingAndReturnOutput() (string, error) 12 | StreamTo(*os.File) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_darwin.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_dragonfly.go: -------------------------------------------------------------------------------- 1 | // +build dragonfly 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !mips64le 3 | 4 | package remote 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func interceptorDupx(oldfd int, newfd int) { 11 | unix.Dup2(oldfd, newfd) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build mips64le 3 | 4 | package remote 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func interceptorDupx(oldfd int, newfd int) { 11 | unix.Dup3(oldfd, newfd, 0) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_netbsd.go: -------------------------------------------------------------------------------- 1 | // +build netbsd 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build openbsd 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package remote 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func interceptorDupx(oldfd int, newfd int) { 10 | unix.Dup2(oldfd, newfd) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package remote 4 | 5 | import ( 6 | "errors" 7 | "os" 8 | ) 9 | 10 | func NewOutputInterceptor() OutputInterceptor { 11 | return &outputInterceptor{} 12 | } 13 | 14 | type outputInterceptor struct { 15 | intercepting bool 16 | } 17 | 18 | func (interceptor *outputInterceptor) StartInterceptingOutput() error { 19 | if interceptor.intercepting { 20 | return errors.New("Already intercepting output!") 21 | } 22 | interceptor.intercepting = true 23 | 24 | // not working on windows... 25 | 26 | return nil 27 | } 28 | 29 | func (interceptor *outputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 30 | // not working on windows... 31 | interceptor.intercepting = false 32 | 33 | return "", nil 34 | } 35 | 36 | func (interceptor *outputInterceptor) StreamTo(*os.File) {} 37 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/spec" 5 | ) 6 | 7 | type SerialIterator struct { 8 | specs []*spec.Spec 9 | index int 10 | } 11 | 12 | func NewSerialIterator(specs []*spec.Spec) *SerialIterator { 13 | return &SerialIterator{ 14 | specs: specs, 15 | index: 0, 16 | } 17 | } 18 | 19 | func (s *SerialIterator) Next() (*spec.Spec, error) { 20 | if s.index >= len(s.specs) { 21 | return nil, ErrClosed 22 | } 23 | 24 | spec := s.specs[s.index] 25 | s.index += 1 26 | return spec, nil 27 | } 28 | 29 | func (s *SerialIterator) NumberOfSpecsPriorToIteration() int { 30 | return len(s.specs) 31 | } 32 | 33 | func (s *SerialIterator) NumberOfSpecsToProcessIfKnown() (int, bool) { 34 | return len(s.specs), true 35 | } 36 | 37 | func (s *SerialIterator) NumberOfSpecsThatWillBeRunIfKnown() (int, bool) { 38 | count := 0 39 | for _, s := range s.specs { 40 | if !s.Skipped() && !s.Pending() { 41 | count += 1 42 | } 43 | } 44 | return count, true 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/onsi/ginkgo/internal/spec" 7 | ) 8 | 9 | var ErrClosed = errors.New("no more specs to run") 10 | 11 | type SpecIterator interface { 12 | Next() (*spec.Spec, error) 13 | NumberOfSpecsPriorToIteration() int 14 | NumberOfSpecsToProcessIfKnown() (int, bool) 15 | NumberOfSpecsThatWillBeRunIfKnown() (int, bool) 16 | } 17 | 18 | type Counter struct { 19 | Index int `json:"index"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/specrunner/random_id.go: -------------------------------------------------------------------------------- 1 | package specrunner 2 | 3 | import ( 4 | "crypto/rand" 5 | "fmt" 6 | ) 7 | 8 | func randomID() string { 9 | b := make([]byte, 8) 10 | _, err := rand.Read(b) 11 | if err != nil { 12 | return "" 13 | } 14 | return fmt.Sprintf("%x-%x-%x-%x", b[0:2], b[2:4], b[4:6], b[6:8]) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/writer/fake_writer.go: -------------------------------------------------------------------------------- 1 | package writer 2 | 3 | type FakeGinkgoWriter struct { 4 | EventStream []string 5 | } 6 | 7 | func NewFake() *FakeGinkgoWriter { 8 | return &FakeGinkgoWriter{ 9 | EventStream: []string{}, 10 | } 11 | } 12 | 13 | func (writer *FakeGinkgoWriter) AddEvent(event string) { 14 | writer.EventStream = append(writer.EventStream, event) 15 | } 16 | 17 | func (writer *FakeGinkgoWriter) Truncate() { 18 | writer.EventStream = append(writer.EventStream, "TRUNCATE") 19 | } 20 | 21 | func (writer *FakeGinkgoWriter) DumpOut() { 22 | writer.EventStream = append(writer.EventStream, "DUMP") 23 | } 24 | 25 | func (writer *FakeGinkgoWriter) DumpOutWithHeader(header string) { 26 | writer.EventStream = append(writer.EventStream, "DUMP_WITH_HEADER: "+header) 27 | } 28 | 29 | func (writer *FakeGinkgoWriter) Bytes() []byte { 30 | writer.EventStream = append(writer.EventStream, "BYTES") 31 | return nil 32 | } 33 | 34 | func (writer *FakeGinkgoWriter) Write(data []byte) (n int, err error) { 35 | return 0, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/reporter.go: -------------------------------------------------------------------------------- 1 | package reporters 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/config" 5 | "github.com/onsi/ginkgo/types" 6 | ) 7 | 8 | type Reporter interface { 9 | SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) 10 | BeforeSuiteDidRun(setupSummary *types.SetupSummary) 11 | SpecWillRun(specSummary *types.SpecSummary) 12 | SpecDidComplete(specSummary *types.SpecSummary) 13 | AfterSuiteDidRun(setupSummary *types.SetupSummary) 14 | SpecSuiteDidEnd(summary *types.SuiteSummary) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | Colorable writer for windows. 4 | 5 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 6 | This package is possible to handle escape sequence for ansi color on windows. 7 | 8 | ## Too Bad! 9 | 10 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 11 | 12 | 13 | ## So Good! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 16 | 17 | ## Usage 18 | 19 | ```go 20 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 21 | logrus.SetOutput(colorable.NewColorableStdout()) 22 | 23 | logrus.Info("succeeded") 24 | logrus.Warn("not correct") 25 | logrus.Error("something error") 26 | logrus.Fatal("panic") 27 | ``` 28 | 29 | You can compile above code on non-windows OSs. 30 | 31 | ## Installation 32 | 33 | ``` 34 | $ go get github.com/mattn/go-colorable 35 | ``` 36 | 37 | # License 38 | 39 | MIT 40 | 41 | # Author 42 | 43 | Yasuhiro Matsumoto (a.k.a mattn) 44 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func NewColorable(file *os.File) io.Writer { 11 | if file == nil { 12 | panic("nil passed instead of *os.File to NewColorable()") 13 | } 14 | 15 | return file 16 | } 17 | 18 | func NewColorableStdout() io.Writer { 19 | return os.Stdout 20 | } 21 | 22 | func NewColorableStderr() io.Writer { 23 | return os.Stderr 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | isatty for golang 4 | 5 | ## Usage 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "fmt" 12 | "github.com/mattn/go-isatty" 13 | "os" 14 | ) 15 | 16 | func main() { 17 | if isatty.IsTerminal(os.Stdout.Fd()) { 18 | fmt.Println("Is Terminal") 19 | } else { 20 | fmt.Println("Is Not Terminal") 21 | } 22 | } 23 | ``` 24 | 25 | ## Installation 26 | 27 | ``` 28 | $ go get github.com/mattn/go-isatty 29 | ``` 30 | 31 | # License 32 | 33 | MIT 34 | 35 | # Author 36 | 37 | Yasuhiro Matsumoto (a.k.a mattn) 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/code_location.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type CodeLocation struct { 8 | FileName string 9 | LineNumber int 10 | FullStackTrace string 11 | } 12 | 13 | func (codeLocation CodeLocation) String() string { 14 | return fmt.Sprintf("%s:%d", codeLocation.FileName, codeLocation.LineNumber) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/synchronization.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type RemoteBeforeSuiteState int 8 | 9 | const ( 10 | RemoteBeforeSuiteStateInvalid RemoteBeforeSuiteState = iota 11 | 12 | RemoteBeforeSuiteStatePending 13 | RemoteBeforeSuiteStatePassed 14 | RemoteBeforeSuiteStateFailed 15 | RemoteBeforeSuiteStateDisappeared 16 | ) 17 | 18 | type RemoteBeforeSuiteData struct { 19 | Data []byte 20 | State RemoteBeforeSuiteState 21 | } 22 | 23 | func (r RemoteBeforeSuiteData) ToJSON() []byte { 24 | data, _ := json.Marshal(r) 25 | return data 26 | } 27 | 28 | type RemoteAfterSuiteData struct { 29 | CanRun bool 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.test 3 | . 4 | .idea 5 | gomega.iml 6 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.13.x 5 | - 1.14.x 6 | - gotip 7 | 8 | env: 9 | - GO111MODULE=on 10 | 11 | install: 12 | - go get -v ./... 13 | - go build ./... 14 | - go get github.com/onsi/ginkgo 15 | - go install github.com/onsi/ginkgo/ginkgo 16 | 17 | script: make test 18 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | [ -z "`gofmt -s -w -l -e .`" ] 3 | go vet 4 | ginkgo -p -r --randomizeAllSpecs --failOnPending --randomizeSuites --race 5 | 6 | .PHONY: test 7 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/README.md: -------------------------------------------------------------------------------- 1 | ![Gomega: Ginkgo's Preferred Matcher Library](http://onsi.github.io/gomega/images/gomega.png) 2 | 3 | [![Build Status](https://travis-ci.org/onsi/gomega.svg?branch=master)](https://travis-ci.org/onsi/gomega) 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 `git log --pretty=format:'- %s [%h]' HEAD...vX.X.X` to list all the commits since the last release 5 | - Categorize the changes into 6 | - Breaking Changes (requires a major version) 7 | - New Features (minor version) 8 | - Fixes (fix version) 9 | - Maintenance (which in general should not be mentioned in `CHANGELOG.md` as they have no user impact) 10 | 2. Update GOMEGA_VERSION in `gomega_dsl.go` 11 | 3. Push a commit with the version number as the commit message (e.g. `v1.3.0`) 12 | 4. Create a new [GitHub release](https://help.github.com/articles/creating-releases/) with the version number as the tag (e.g. `v1.3.0`). List the key changes in the release notes. 13 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/onsi/gomega 2 | 3 | require ( 4 | github.com/golang/protobuf v1.4.2 5 | github.com/onsi/ginkgo v1.12.1 6 | golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 7 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 8 | gopkg.in/yaml.v2 v2.3.0 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/oraclematcher/oracle_matcher.go: -------------------------------------------------------------------------------- 1 | package oraclematcher 2 | 3 | import "github.com/onsi/gomega/types" 4 | 5 | /* 6 | GomegaMatchers that also match the OracleMatcher interface can convey information about 7 | whether or not their result will change upon future attempts. 8 | 9 | This allows `Eventually` and `Consistently` to short circuit if success becomes impossible. 10 | 11 | For example, a process' exit code can never change. So, gexec's Exit matcher returns `true` 12 | for `MatchMayChangeInTheFuture` until the process exits, at which point it returns `false` forevermore. 13 | */ 14 | type OracleMatcher interface { 15 | MatchMayChangeInTheFuture(actual interface{}) bool 16 | } 17 | 18 | func MatchMayChangeInTheFuture(matcher types.GomegaMatcher, value interface{}) bool { 19 | oracleMatcher, ok := matcher.(OracleMatcher) 20 | if !ok { 21 | return true 22 | } 23 | 24 | return oracleMatcher.MatchMayChangeInTheFuture(value) 25 | } 26 | -------------------------------------------------------------------------------- /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 interface{} 14 | } 15 | 16 | func (matcher *BeAnExistingFileMatcher) Match(actual interface{}) (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 interface{}) (message string) { 35 | return format.Message(actual, fmt.Sprintf("to exist")) 36 | } 37 | 38 | func (matcher *BeAnExistingFileMatcher) NegatedFailureMessage(actual interface{}) (message string) { 39 | return format.Message(actual, fmt.Sprintf("not to exist")) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_empty_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 BeEmptyMatcher struct { 12 | } 13 | 14 | func (matcher *BeEmptyMatcher) Match(actual interface{}) (success bool, err error) { 15 | length, ok := lengthOf(actual) 16 | if !ok { 17 | return false, fmt.Errorf("BeEmpty matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1)) 18 | } 19 | 20 | return length == 0, nil 21 | } 22 | 23 | func (matcher *BeEmptyMatcher) FailureMessage(actual interface{}) (message string) { 24 | return format.Message(actual, "to be empty") 25 | } 26 | 27 | func (matcher *BeEmptyMatcher) NegatedFailureMessage(actual interface{}) (message string) { 28 | return format.Message(actual, "not to be empty") 29 | } 30 | -------------------------------------------------------------------------------- /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 | } 13 | 14 | func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err error) { 15 | if !isBool(actual) { 16 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return actual == false, nil 20 | } 21 | 22 | func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) { 23 | return format.Message(actual, "to be false") 24 | } 25 | 26 | func (matcher *BeFalseMatcher) NegatedFailureMessage(actual interface{}) (message string) { 27 | return format.Message(actual, "not to be false") 28 | } 29 | -------------------------------------------------------------------------------- /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 interface{}) (success bool, err error) { 11 | return isNil(actual), nil 12 | } 13 | 14 | func (matcher *BeNilMatcher) FailureMessage(actual interface{}) (message string) { 15 | return format.Message(actual, "to be nil") 16 | } 17 | 18 | func (matcher *BeNilMatcher) NegatedFailureMessage(actual interface{}) (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 | } 13 | 14 | func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) { 15 | if !isBool(actual) { 16 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return actual.(bool), nil 20 | } 21 | 22 | func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) { 23 | return format.Message(actual, "to be true") 24 | } 25 | 26 | func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) { 27 | return format.Message(actual, "not to be true") 28 | } 29 | -------------------------------------------------------------------------------- /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 interface{}) (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 interface{}) (message string) { 23 | return format.Message(actual, "to be zero-valued") 24 | } 25 | 26 | func (matcher *BeZeroMatcher) NegatedFailureMessage(actual interface{}) (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 interface{}) (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 interface{}) (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 interface{}) (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 interface{}) (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. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return length == matcher.Count, nil 20 | } 21 | 22 | func (matcher *HaveLenMatcher) FailureMessage(actual interface{}) (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 interface{}) (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 interface{}) (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 interface{}) (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 interface{}) (message string) { 34 | return fmt.Sprintf("Unexpected error:\n%s\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1), "occurred") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/not.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/internal/oraclematcher" 5 | "github.com/onsi/gomega/types" 6 | ) 7 | 8 | type NotMatcher struct { 9 | Matcher types.GomegaMatcher 10 | } 11 | 12 | func (m *NotMatcher) Match(actual interface{}) (bool, error) { 13 | success, err := m.Matcher.Match(actual) 14 | if err != nil { 15 | return false, err 16 | } 17 | return !success, nil 18 | } 19 | 20 | func (m *NotMatcher) FailureMessage(actual interface{}) (message string) { 21 | return m.Matcher.NegatedFailureMessage(actual) // works beautifully 22 | } 23 | 24 | func (m *NotMatcher) NegatedFailureMessage(actual interface{}) (message string) { 25 | return m.Matcher.FailureMessage(actual) // works beautifully 26 | } 27 | 28 | func (m *NotMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { 29 | return oraclematcher.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/succeed_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type SucceedMatcher struct { 10 | } 11 | 12 | func (matcher *SucceedMatcher) Match(actual interface{}) (success bool, err error) { 13 | // is purely nil? 14 | if actual == nil { 15 | return true, nil 16 | } 17 | 18 | // must be an 'error' type 19 | if !isError(actual) { 20 | return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1)) 21 | } 22 | 23 | // must be nil (or a pointer to a nil) 24 | return isNil(actual), nil 25 | } 26 | 27 | func (matcher *SucceedMatcher) FailureMessage(actual interface{}) (message string) { 28 | return fmt.Sprintf("Expected success, but got an error:\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1)) 29 | } 30 | 31 | func (matcher *SucceedMatcher) NegatedFailureMessage(actual interface{}) (message string) { 32 | return "Expected failure, but got no error." 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | type Node struct { 4 | ID int 5 | Value interface{} 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/onsi/gomega/types/types.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type TWithHelper interface { 4 | Helper() 5 | } 6 | 7 | type GomegaFailHandler func(message string, callerSkip ...int) 8 | 9 | type GomegaFailWrapper struct { 10 | Fail GomegaFailHandler 11 | TWithHelper TWithHelper 12 | } 13 | 14 | //A simple *testing.T interface wrapper 15 | type GomegaTestingT interface { 16 | Fatalf(format string, args ...interface{}) 17 | } 18 | 19 | //All Gomega matchers must implement the GomegaMatcher interface 20 | // 21 | //For details on writing custom matchers, check out: http://onsi.github.io/gomega/#adding-your-own-matchers 22 | type GomegaMatcher interface { 23 | Match(actual interface{}) (success bool, err error) 24 | FailureMessage(actual interface{}) (message string) 25 | NegatedFailureMessage(actual interface{}) (message string) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.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 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | cobra.test 36 | bin 37 | 38 | .idea/ 39 | *.iml 40 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | stages: 4 | - diff 5 | - test 6 | - build 7 | 8 | go: 9 | - 1.12.x 10 | - 1.13.x 11 | - tip 12 | 13 | before_install: 14 | - go get -u github.com/kyoh86/richgo 15 | - go get -u github.com/mitchellh/gox 16 | 17 | matrix: 18 | allow_failures: 19 | - go: tip 20 | include: 21 | - stage: diff 22 | go: 1.13.x 23 | script: make fmt 24 | - stage: build 25 | go: 1.13.x 26 | script: make cobra_generator 27 | 28 | script: 29 | - make test 30 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Cobra Changelog 2 | 3 | ## Pending 4 | * Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` @jpmcb 5 | 6 | ## v1.0.0 7 | Announcing v1.0.0 of Cobra. 🎉 8 | **Notable Changes** 9 | * Fish completion (including support for Go custom completion) @marckhouzam 10 | * API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam 11 | * Remove/replace SetOutput on Command - deprecated @jpmcb 12 | * add support for autolabel stale PR @xchapter7x 13 | * Add Labeler Actions @xchapter7x 14 | * Custom completions coded in Go (instead of Bash) @marckhouzam 15 | * Partial Revert of #922 @jharshman 16 | * Add Makefile to project @jharshman 17 | * Correct documentation for InOrStdin @desponda 18 | * Apply formatting to templates @jharshman 19 | * Revert change so help is printed on stdout again @marckhouzam 20 | * Update md2man to v2.0.0 @pdf 21 | * update viper to v1.4.0 @umarcor 22 | * Update cmd/root.go example in README.md @jharshman 23 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/Makefile: -------------------------------------------------------------------------------- 1 | BIN="./bin" 2 | SRC=$(shell find . -name "*.go") 3 | 4 | ifeq (, $(shell which richgo)) 5 | $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") 6 | endif 7 | 8 | .PHONY: fmt vet test cobra_generator install_deps clean 9 | 10 | default: all 11 | 12 | all: fmt vet test cobra_generator 13 | 14 | fmt: 15 | $(info ******************** checking formatting ********************) 16 | @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) 17 | 18 | test: install_deps vet 19 | $(info ******************** running tests ********************) 20 | richgo test -v ./... 21 | 22 | cobra_generator: install_deps 23 | $(info ******************** building generator ********************) 24 | mkdir -p $(BIN) 25 | make -C cobra all 26 | 27 | install_deps: 28 | $(info ******************** downloading dependencies ********************) 29 | go get -v ./... 30 | 31 | vet: 32 | $(info ******************** vetting ********************) 33 | go vet ./... 34 | 35 | clean: 36 | rm -rf $(BIN) 37 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "time" 9 | 10 | "github.com/inconshreveable/mousetrap" 11 | ) 12 | 13 | var preExecHookFn = preExecHook 14 | 15 | func preExecHook(c *Command) { 16 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 17 | c.Print(MousetrapHelpText) 18 | if MousetrapDisplayDuration > 0 { 19 | time.Sleep(MousetrapDisplayDuration) 20 | } else { 21 | c.Println("Press return to continue...") 22 | fmt.Scanln() 23 | } 24 | os.Exit(1) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/fish_completions.md: -------------------------------------------------------------------------------- 1 | ## Generating Fish Completions For Your cobra.Command 2 | 3 | Please refer to [Shell Completions](shell_completions.md) for details. 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/spf13/cobra 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/cpuguy83/go-md2man/v2 v2.0.0 7 | github.com/inconshreveable/mousetrap v1.0.0 8 | github.com/spf13/pflag v1.0.5 9 | gopkg.in/yaml.v2 v2.3.0 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/powershell_completions.md: -------------------------------------------------------------------------------- 1 | # Generating PowerShell Completions For Your Own cobra.Command 2 | 3 | Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. 4 | 5 | *Note*: PowerShell completions have not (yet?) been aligned to Cobra's generic shell completion support. This implies the PowerShell completions are not as rich as for other shells (see [What's not yet supported](#whats-not-yet-supported)), and may behave slightly differently. They are still very useful for PowerShell users. 6 | 7 | # What's supported 8 | 9 | - Completion for subcommands using their `.Short` description 10 | - Completion for non-hidden flags using their `.Name` and `.Shorthand` 11 | 12 | # What's not yet supported 13 | 14 | - Command aliases 15 | - Required, filename or custom flags (they will work like normal flags) 16 | - Custom completion scripts 17 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/spf13/pflag 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opencontrol/compliance-masonry/8c0a34ec40a89b30586ae0a770ab96d707bbb526/vendor/github.com/spf13/pflag/go.sum -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.codeclimate.yml: -------------------------------------------------------------------------------- 1 | engines: 2 | gofmt: 3 | enabled: true 4 | golint: 5 | enabled: true 6 | govet: 7 | enabled: true 8 | 9 | exclude_patterns: 10 | - ".github/" 11 | - "vendor/" 12 | - "codegen/" 13 | - "doc.go" 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.8 4 | - 1.9 5 | - tip 6 | 7 | env: 8 | global: 9 | - CC_TEST_REPORTER_ID=68feaa3410049ce73e145287acbcdacc525087a30627f96f04e579e75bd71c00 10 | 11 | before_script: 12 | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter 13 | - chmod +x ./cc-test-reporter 14 | - ./cc-test-reporter before-build 15 | 16 | install: 17 | - go get github.com/go-task/task/cmd/task 18 | 19 | script: 20 | - task dl-deps 21 | - task lint 22 | - task test-coverage 23 | 24 | after_script: 25 | - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT 26 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/davecgh/go-spew" 6 | packages = ["spew"] 7 | revision = "346938d642f2ec3594ed81d874461961cd0faa76" 8 | version = "v1.1.0" 9 | 10 | [[projects]] 11 | name = "github.com/pmezard/go-difflib" 12 | packages = ["difflib"] 13 | revision = "792786c7400a136282c1664665ae0a8db921c6c2" 14 | version = "v1.0.0" 15 | 16 | [[projects]] 17 | name = "github.com/stretchr/testify" 18 | packages = [ 19 | "assert", 20 | "require" 21 | ] 22 | revision = "b91bfb9ebec76498946beb6af7c0230c7cc7ba6c" 23 | version = "v1.2.0" 24 | 25 | [solve-meta] 26 | analyzer-name = "dep" 27 | analyzer-version = 1 28 | inputs-digest = "2d160a7dea4ffd13c6c31dab40373822f9d78c73beba016d662bef8f7a998876" 29 | solver-name = "gps-cdcl" 30 | solver-version = 1 31 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/Gopkg.toml: -------------------------------------------------------------------------------- 1 | [prune] 2 | unused-packages = true 3 | non-go = true 4 | go-tests = true 5 | 6 | [[constraint]] 7 | name = "github.com/stretchr/testify" 8 | version = "~1.2.0" 9 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/Taskfile.yml: -------------------------------------------------------------------------------- 1 | default: 2 | deps: [test] 3 | 4 | dl-deps: 5 | desc: Downloads cli dependencies 6 | cmds: 7 | - go get -u github.com/golang/lint/golint 8 | - go get -u github.com/golang/dep/cmd/dep 9 | 10 | update-deps: 11 | desc: Updates dependencies 12 | cmds: 13 | - dep ensure 14 | - dep ensure -update 15 | 16 | lint: 17 | desc: Runs golint 18 | cmds: 19 | - go fmt $(go list ./... | grep -v /vendor/) 20 | - go vet $(go list ./... | grep -v /vendor/) 21 | - golint $(ls *.go | grep -v "doc.go") 22 | silent: true 23 | 24 | test: 25 | desc: Runs go tests 26 | cmds: 27 | - go test -race . 28 | 29 | test-coverage: 30 | desc: Runs go tests and calucates test coverage 31 | cmds: 32 | - go test -coverprofile=c.out . 33 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/constants.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | const ( 4 | // PathSeparator is the character used to separate the elements 5 | // of the keypath. 6 | // 7 | // For example, `location.address.city` 8 | PathSeparator string = "." 9 | 10 | // SignatureSeparator is the character that is used to 11 | // separate the Base64 string from the security signature. 12 | SignatureSeparator = "_" 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security key 9 | func HashWithKey(data, key string) string { 10 | d := sha1.Sum([]byte(data + ":" + key)) 11 | return hex.EncodeToString(d[:]) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/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 go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/tg/gosortmap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Tomasz Grodzki 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.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 unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /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 | // +build !gccgo 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_darwin_386.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 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-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 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_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 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_freebsd_386.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 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-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 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_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 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-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 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_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 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 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-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 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_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 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-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 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 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, 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-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, 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_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, 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-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for arm64, 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 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 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /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 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 | // +build ppc64 s390x mips mips64 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 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64 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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 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/errors_freebsd_arm64.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 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | 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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 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 | // +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/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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 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/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 | // +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 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 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 | // +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 | // +build darwin 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/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | } 36 | 37 | return (salen + salign - 1) & ^(salign - 1) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,go1.12,!go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 14 | // To implement this using libSystem we'd need syscall_syscallPtr for 15 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 16 | // back to raw syscalls for this func on Go 1.12. 17 | var p unsafe.Pointer 18 | if len(buf) > 0 { 19 | p = unsafe.Pointer(&buf[0]) 20 | } else { 21 | p = unsafe.Pointer(&_zero) 22 | } 23 | r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 24 | n = int(r0) 25 | if e1 != 0 { 26 | return n, errnoErr(e1) 27 | } 28 | return n, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,386,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,amd64,!go1.12 6 | 7 | package unix 8 | 9 | //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,arm,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,arm64,!go1.12 6 | 7 | package unix 8 | 9 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 10 | return 0, ENOSYS 11 | } 12 | -------------------------------------------------------------------------------- /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 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /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 | // +build linux,!gccgo 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 | // +build linux,!gccgo,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 | // +build arm,!gccgo,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 | // +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 | // +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 | // +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 | // +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 | // +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 | // +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 | // +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 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /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 ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(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 ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go 386 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | // +build go1.13 5 | 6 | #include "textflag.h" 7 | TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 8 | JMP libc_fdopendir(SB) 9 | TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 10 | JMP libc_closedir(SB) 11 | TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 12 | JMP libc_readdir_r(SB) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/README: -------------------------------------------------------------------------------- 1 | This repository holds the transition packages for the new Go 1.13 error values. 2 | See golang.org/design/29934-error-values. 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/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 xerrors implements functions to manipulate errors. 6 | // 7 | // This package is based on the Go 2 proposal for error values: 8 | // https://golang.org/design/29934-error-values 9 | // 10 | // These functions were incorporated into the standard library's errors package 11 | // in Go 1.13: 12 | // - Is 13 | // - As 14 | // - Unwrap 15 | // 16 | // Also, Errorf's %w verb was incorporated into fmt.Errorf. 17 | // 18 | // Use this package to get equivalent behavior in all supported Go versions. 19 | // 20 | // No other features of this package were included in Go 1.13, and at present 21 | // there are no plans to include any of them. 22 | package xerrors // import "golang.org/x/xerrors" 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/errors.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 xerrors 6 | 7 | import "fmt" 8 | 9 | // errorString is a trivial implementation of error. 10 | type errorString struct { 11 | s string 12 | frame Frame 13 | } 14 | 15 | // New returns an error that formats as the given text. 16 | // 17 | // The returned error contains a Frame set to the caller's location and 18 | // implements Formatter to show this information when printed with details. 19 | func New(text string) error { 20 | return &errorString{text, Caller(1)} 21 | } 22 | 23 | func (e *errorString) Error() string { 24 | return e.s 25 | } 26 | 27 | func (e *errorString) Format(s fmt.State, v rune) { FormatError(e, s, v) } 28 | 29 | func (e *errorString) FormatError(p Printer) (next error) { 30 | p.Print(e.s) 31 | e.frame.Format(p) 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/go.mod: -------------------------------------------------------------------------------- 1 | module golang.org/x/xerrors 2 | 3 | go 1.11 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/xerrors/internal/internal.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 internal 6 | 7 | // EnableTrace indicates whether stack information should be recorded in errors. 8 | var EnableTrace = true 9 | -------------------------------------------------------------------------------- /vendor/gopkg.in/tomb.v1/README.md: -------------------------------------------------------------------------------- 1 | Installation and usage 2 | ---------------------- 3 | 4 | See [gopkg.in/tomb.v1](https://gopkg.in/tomb.v1) for documentation and usage details. 5 | -------------------------------------------------------------------------------- /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/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 OpenControl Contributors. See LICENSE.md for license. 3 | */ 4 | 5 | package version 6 | 7 | import ( 8 | "fmt" 9 | "os" 10 | ) 11 | 12 | // Version is the version of the build. 13 | // Build details 14 | var ( 15 | Version string 16 | Commit string 17 | Date string 18 | ) 19 | 20 | // PrintVersion returns the version for the command version and --version flag 21 | func PrintVersion() { 22 | fmt.Printf("masonry version: %s, build: %s, date: %s\n", Version, Commit, Date) 23 | os.Exit(0) 24 | } 25 | --------------------------------------------------------------------------------