├── .gitignore ├── LICENSE ├── README.md ├── conf └── cloudboot-server.conf ├── doc ├── act2_api.yaml ├── db │ ├── cloudboot.sql │ └── update.sql └── raml │ ├── agent.raml │ ├── device.raml │ ├── hardware.raml │ ├── location.raml │ ├── manage_network.raml │ ├── network.raml │ ├── os_config.raml │ ├── osinstall.raml │ ├── system_config.raml │ ├── user.raml │ └── vm.raml ├── gbb.json └── src └── idcos.io └── osinstall ├── agent ├── agent.go └── agent_test.go ├── build └── build.go ├── cmd ├── cloudboot-agent │ ├── agent_service.go │ └── main.go ├── cloudboot-encrypt-generator │ └── main.go ├── cloudboot-initdb │ └── main.go ├── cloudboot-server │ └── main.go ├── pe-agent │ └── main.go └── win-agent │ └── main.go ├── config ├── config.go ├── iniconf │ ├── config_test.ini │ ├── loader.go │ └── loader_test.go └── jsonconf │ ├── config_test.json │ ├── loader.go │ └── loader_test.go ├── logger ├── beelog.go ├── logger.go └── logrus.go ├── middleware ├── close.go ├── inject_config.go ├── inject_logger.go ├── inject_repo.go ├── limiter.go └── timeout.go ├── model ├── cmdb.go ├── exec.go ├── mysqlrepo │ ├── initdb │ │ └── init_os_install.go │ ├── os_install_device.go │ ├── os_install_device_history.go │ ├── os_install_device_install_callback.go │ ├── os_install_device_install_report.go │ ├── os_install_device_log.go │ ├── os_install_dhcp_subnet.go │ ├── os_install_hardware.go │ ├── os_install_ip.go │ ├── os_install_location.go │ ├── os_install_mac.go │ ├── os_install_manage_ip.go │ ├── os_install_manage_network.go │ ├── os_install_manufacturer.go │ ├── os_install_network.go │ ├── os_install_os_config.go │ ├── os_install_platform_config.go │ ├── os_install_system_config.go │ ├── os_install_user.go │ ├── os_install_user_access_token.go │ ├── os_install_vm_device.go │ ├── os_install_vm_device_log.go │ ├── os_install_vm_host.go │ ├── repo.go │ ├── task_info.go │ └── task_result.go └── repo.go ├── server └── osinstallserver │ ├── exec │ └── exec.go │ ├── pipeline.go │ ├── route │ ├── cron.go │ ├── device.go │ ├── device_install_callback.go │ ├── device_install_report.go │ ├── device_log.go │ ├── dhcp_subnet.go │ ├── hardware.go │ ├── import.go │ ├── location.go │ ├── manage_network.go │ ├── manufacturer.go │ ├── network.go │ ├── os_config.go │ ├── platform_config.go │ ├── resources_pool.go │ ├── system_config.go │ ├── task_info.go │ ├── task_result.go │ ├── user.go │ ├── vm_device_log.go │ ├── vm_host.go │ ├── vm_install.go │ └── vm_shell.go │ ├── routes.go │ ├── server.go │ └── util │ ├── ipmi.go │ ├── network.go │ ├── pxe.go │ ├── rsa.go │ ├── shell.go │ ├── string.go │ ├── user.go │ └── vm_install.go ├── utils ├── charset.go ├── charset_test.go ├── ping │ └── ping.go ├── time.go ├── time_test.go ├── utils.go └── utils_test.go └── vendor ├── github.com ├── AlexanderChen1989 │ └── go-json-rest │ │ ├── LICENSE │ │ └── rest │ │ ├── access_log_apache.go │ │ ├── access_log_apache_test.go │ │ ├── access_log_json.go │ │ ├── access_log_json_test.go │ │ ├── api.go │ │ ├── api_test.go │ │ ├── auth_basic.go │ │ ├── auth_basic_test.go │ │ ├── close.go │ │ ├── content_type_checker.go │ │ ├── content_type_checker_test.go │ │ ├── cors.go │ │ ├── ctx.go │ │ ├── doc.go │ │ ├── gzip.go │ │ ├── gzip_test.go │ │ ├── handler.go │ │ ├── handler_test.go │ │ ├── if.go │ │ ├── if_test.go │ │ ├── json_indent.go │ │ ├── json_indent_test.go │ │ ├── jsonp.go │ │ ├── jsonp_test.go │ │ ├── limiter.go │ │ ├── limiter_test.go │ │ ├── middleware.go │ │ ├── middleware_test.go │ │ ├── powered_by.go │ │ ├── powered_by_test.go │ │ ├── recorder.go │ │ ├── recorder_test.go │ │ ├── recover.go │ │ ├── recover_test.go │ │ ├── request.go │ │ ├── request_test.go │ │ ├── response.go │ │ ├── response_test.go │ │ ├── route.go │ │ ├── route_test.go │ │ ├── router.go │ │ ├── router_benchmark_test.go │ │ ├── router_test.go │ │ ├── status.go │ │ ├── status_test.go │ │ ├── test │ │ ├── doc.go │ │ └── util.go │ │ ├── timeout.go │ │ ├── timer.go │ │ ├── timer_test.go │ │ └── trie │ │ ├── impl.go │ │ └── impl_test.go ├── Sirupsen │ └── logrus │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── alt_exit_test.go │ │ ├── appveyor.yml │ │ ├── doc.go │ │ ├── entry.go │ │ ├── entry_test.go │ │ ├── example_basic_test.go │ │ ├── example_default_field_value_test.go │ │ ├── example_global_hook_test.go │ │ ├── example_hook_test.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── formatter_bench_test.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── hook_test.go │ │ ├── hooks.go │ │ ├── hooks │ │ └── syslog │ │ │ ├── README.md │ │ │ ├── syslog.go │ │ │ └── syslog_test.go │ │ ├── internal │ │ └── testutils │ │ │ └── testutils.go │ │ ├── json_formatter.go │ │ ├── json_formatter_test.go │ │ ├── level_test.go │ │ ├── logger.go │ │ ├── logger_bench_test.go │ │ ├── logger_test.go │ │ ├── logrus.go │ │ ├── logrus_test.go │ │ ├── terminal_check_aix.go │ │ ├── terminal_check_appengine.go │ │ ├── terminal_check_js.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_check_windows.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ ├── text_formatter_test.go │ │ └── writer.go ├── astaxie │ └── beego │ │ ├── LICENSE │ │ └── logs │ │ ├── README.md │ │ ├── accesslog.go │ │ ├── color.go │ │ ├── color_windows.go │ │ ├── color_windows_test.go │ │ ├── conn.go │ │ ├── conn_test.go │ │ ├── console.go │ │ ├── console_test.go │ │ ├── file.go │ │ ├── file_test.go │ │ ├── jianliao.go │ │ ├── log.go │ │ ├── logger.go │ │ ├── logger_test.go │ │ ├── multifile.go │ │ ├── multifile_test.go │ │ ├── slack.go │ │ ├── smtp.go │ │ └── smtp_test.go ├── axgle │ └── mahonia │ │ ├── 8bit.go │ │ ├── ASCII.go │ │ ├── LICENSE │ │ ├── README.md │ │ ├── big5-data.go │ │ ├── big5.go │ │ ├── charset.go │ │ ├── convert_string.go │ │ ├── entity.go │ │ ├── entity_data.go │ │ ├── euc-jp.go │ │ ├── fallback.go │ │ ├── gb18030-data.go │ │ ├── gb18030.go │ │ ├── gbk-data.go │ │ ├── gbk.go │ │ ├── jis0201-data.go │ │ ├── jis0208-data.go │ │ ├── jis0212-data.go │ │ ├── mahonia_test.go │ │ ├── mbcs.go │ │ ├── reader.go │ │ ├── shiftjis.go │ │ ├── translate.go │ │ ├── utf16.go │ │ ├── utf8.go │ │ └── writer.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── common_test.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── dump_test.go │ │ ├── dumpcgo_test.go │ │ ├── dumpnocgo_test.go │ │ ├── example_test.go │ │ ├── format.go │ │ ├── format_test.go │ │ ├── internal_test.go │ │ ├── internalunsafe_test.go │ │ ├── spew.go │ │ ├── spew_test.go │ │ └── testdata │ │ └── dumpcgo.go ├── didip │ └── tollbooth │ │ ├── LICENSE │ │ ├── README.md │ │ ├── config │ │ ├── config.go │ │ ├── config_benchmark_test.go │ │ └── config_test.go │ │ ├── errors │ │ ├── errors.go │ │ └── errors_test.go │ │ ├── libstring │ │ ├── libstring.go │ │ └── libstring_test.go │ │ ├── tollbooth.go │ │ ├── tollbooth_benchmark_test.go │ │ └── tollbooth_test.go ├── erikstmartin │ └── go-testdb │ │ ├── LICENSE │ │ ├── README.md │ │ ├── conn.go │ │ ├── examples_test.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── stmt.go │ │ ├── testdb.go │ │ ├── testdb_test.go │ │ ├── tx.go │ │ └── tx_test.go ├── go-sql-driver │ └── mysql │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── auth.go │ │ ├── auth_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_test.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── driver_test.go │ │ ├── dsn.go │ │ ├── dsn_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── packets_test.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── statement_test.go │ │ ├── transaction.go │ │ ├── utils.go │ │ └── utils_test.go ├── gofrs │ └── uuid │ │ ├── LICENSE │ │ ├── README.md │ │ ├── codec.go │ │ ├── codec_test.go │ │ ├── fuzz.go │ │ ├── generator.go │ │ ├── generator_test.go │ │ ├── sql.go │ │ ├── sql_test.go │ │ ├── testdata │ │ └── corpus │ │ │ ├── 1416586f4a34d02bcb506f6107b40df512b9f2f9 │ │ │ ├── 3b46a7e7b02ec193581e6c9fa2c8a72f50a64e08-1 │ │ │ ├── 50c54bb75fcfdc488f162bf2f0c6dec6103bfa18-5 │ │ │ ├── 69c581ab749cbd56be8684d3a58ac2cfab9af0f4-5 │ │ │ ├── 752bf000e0bff06777dd0d6f0be6353844de678a-3 │ │ │ ├── a4483762d4ece8466d82cca5cacd35a0829c4e60-2 │ │ │ ├── d0952c45e0c823fc5cc12bcf7d9b877d150ab523-1 │ │ │ ├── da39a3ee5e6b4b0d3255bfef95601890afd80709 │ │ │ ├── e2b84d2065846891f18ae109b12e01d224e1c7c3-4 │ │ │ ├── e320d749435115e874f77420e17d0937e07f69f3-2 │ │ │ ├── ed132d47d757f6468443a22df8a2a965efb34098-7 │ │ │ ├── eeefb01f7bb3c627aedb292c994b20f739ffd613-6 │ │ │ ├── seed_invalid_0 │ │ │ ├── seed_invalid_1 │ │ │ ├── seed_invalid_10 │ │ │ ├── seed_invalid_11 │ │ │ ├── seed_invalid_12 │ │ │ ├── seed_invalid_13 │ │ │ ├── seed_invalid_14 │ │ │ ├── seed_invalid_15 │ │ │ ├── seed_invalid_16 │ │ │ ├── seed_invalid_17 │ │ │ ├── seed_invalid_18 │ │ │ ├── seed_invalid_19 │ │ │ ├── seed_invalid_2 │ │ │ ├── seed_invalid_20 │ │ │ ├── seed_invalid_21 │ │ │ ├── seed_invalid_22 │ │ │ ├── seed_invalid_23 │ │ │ ├── seed_invalid_3 │ │ │ ├── seed_invalid_4 │ │ │ ├── seed_invalid_5 │ │ │ ├── seed_invalid_6 │ │ │ ├── seed_invalid_7 │ │ │ ├── seed_invalid_8 │ │ │ ├── seed_invalid_9 │ │ │ ├── seed_valid_BracedCanonical │ │ │ ├── seed_valid_BracedHashlike │ │ │ ├── seed_valid_Canonical │ │ │ ├── seed_valid_Hashlike │ │ │ ├── seed_valid_URNCanonical │ │ │ └── seed_valid_URNHashlike │ │ ├── uuid.go │ │ └── uuid_test.go ├── gopherjs │ └── gopherjs │ │ ├── LICENSE │ │ └── js │ │ └── js.go ├── gorilla │ ├── securecookie │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── fuzz.go │ │ ├── go.mod │ │ ├── securecookie.go │ │ └── securecookie_test.go │ └── sessions │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cookie.go │ │ ├── cookie_go111.go │ │ ├── cookie_go111_test.go │ │ ├── cookie_test.go │ │ ├── doc.go │ │ ├── go.mod │ │ ├── lex.go │ │ ├── options.go │ │ ├── options_go111.go │ │ ├── sessions.go │ │ ├── sessions_test.go │ │ ├── store.go │ │ └── store_test.go ├── jakecoffman │ └── cron │ │ ├── LICENSE │ │ ├── README.md │ │ ├── constantdelay.go │ │ ├── constantdelay_test.go │ │ ├── cron.go │ │ ├── cron_test.go │ │ ├── parser.go │ │ ├── parser_test.go │ │ ├── spec.go │ │ └── spec_test.go ├── jtolds │ └── gls │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ ├── context_test.go │ │ ├── gen_sym.go │ │ ├── gid.go │ │ ├── id_pool.go │ │ ├── stack_tags.go │ │ ├── stack_tags_js.go │ │ └── stack_tags_main.go ├── juju │ └── ratelimit │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ratelimit.go │ │ ├── ratelimit_test.go │ │ └── reader.go ├── konsorten │ └── go-windows-terminal-sequences │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ ├── sequences.go │ │ └── sequences_test.go ├── kr │ ├── pretty │ │ ├── License │ │ ├── Readme │ │ ├── diff.go │ │ ├── diff_test.go │ │ ├── example_test.go │ │ ├── formatter.go │ │ ├── formatter_test.go │ │ ├── go.mod │ │ ├── pretty.go │ │ └── zero.go │ └── text │ │ ├── License │ │ ├── Readme │ │ ├── doc.go │ │ ├── go.mod │ │ ├── indent.go │ │ ├── indent_test.go │ │ ├── wrap.go │ │ └── wrap_test.go ├── lib │ └── pq │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── TESTS.md │ │ ├── array.go │ │ ├── array_test.go │ │ ├── bench_test.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── conn_test.go │ │ ├── connector.go │ │ ├── connector_example_test.go │ │ ├── connector_test.go │ │ ├── copy.go │ │ ├── copy_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── error.go │ │ ├── go.mod │ │ ├── go18_test.go │ │ ├── hstore │ │ ├── hstore.go │ │ └── hstore_test.go │ │ ├── issues_test.go │ │ ├── notify.go │ │ ├── notify_test.go │ │ ├── rows.go │ │ ├── rows_test.go │ │ ├── ssl.go │ │ ├── ssl_permissions.go │ │ ├── ssl_test.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── url_test.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ ├── uuid.go │ │ └── uuid_test.go ├── patrickmn │ └── go-cache │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cache.go │ │ ├── cache_test.go │ │ ├── sharded.go │ │ └── sharded_test.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ ├── difflib.go │ │ └── difflib_test.go ├── smartystreets │ ├── assertions │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── collections.go │ │ ├── collections_test.go │ │ ├── doc.go │ │ ├── doc_test.go │ │ ├── equal_method.go │ │ ├── equal_method_test.go │ │ ├── equality.go │ │ ├── equality_test.go │ │ ├── filter.go │ │ ├── internal │ │ │ ├── go-render │ │ │ │ ├── LICENSE │ │ │ │ └── render │ │ │ │ │ ├── render.go │ │ │ │ │ ├── render_test.go │ │ │ │ │ └── render_time.go │ │ │ ├── oglematchers │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── any_of.go │ │ │ │ ├── contains.go │ │ │ │ ├── deep_equals.go │ │ │ │ ├── equals.go │ │ │ │ ├── greater_or_equal.go │ │ │ │ ├── greater_than.go │ │ │ │ ├── less_or_equal.go │ │ │ │ ├── less_than.go │ │ │ │ ├── matcher.go │ │ │ │ ├── not.go │ │ │ │ └── transform_description.go │ │ │ └── unit │ │ │ │ └── fixture.go │ │ ├── messages.go │ │ ├── panic.go │ │ ├── panic_test.go │ │ ├── quantity.go │ │ ├── quantity_test.go │ │ ├── serializer.go │ │ ├── serializer_test.go │ │ ├── strings.go │ │ ├── strings_test.go │ │ ├── time.go │ │ ├── time_test.go │ │ ├── type.go │ │ ├── type_test.go │ │ └── utilities_for_test.go │ └── goconvey │ │ ├── LICENSE.md │ │ └── convey │ │ ├── assertions.go │ │ ├── context.go │ │ ├── convey.goconvey │ │ ├── discovery.go │ │ ├── doc.go │ │ ├── focused_execution_test.go │ │ ├── gotest │ │ ├── doc_test.go │ │ └── utils.go │ │ ├── init.go │ │ ├── isolated_execution_test.go │ │ ├── nilReporter.go │ │ ├── reporting │ │ ├── console.go │ │ ├── doc.go │ │ ├── dot.go │ │ ├── dot_test.go │ │ ├── gotest.go │ │ ├── gotest_test.go │ │ ├── init.go │ │ ├── json.go │ │ ├── printer.go │ │ ├── printer_test.go │ │ ├── problems.go │ │ ├── problems_test.go │ │ ├── reporter.go │ │ ├── reporter_test.go │ │ ├── reporting.goconvey │ │ ├── reports.go │ │ ├── statistics.go │ │ └── story.go │ │ ├── reporting_hooks_test.go │ │ └── story_conventions_test.go ├── stretchr │ └── testify │ │ ├── LICENSE │ │ ├── assert │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertions.go │ │ ├── assertions_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ ├── forward_assertions_test.go │ │ ├── http_assertions.go │ │ └── http_assertions_test.go │ │ └── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── forward_requirements_test.go │ │ ├── require.go │ │ ├── require.go.tmpl │ │ ├── require_forward.go │ │ ├── require_forward.go.tmpl │ │ ├── requirements.go │ │ └── requirements_test.go ├── takama │ └── daemon │ │ ├── LICENSE │ │ ├── README.md │ │ ├── daemon.go │ │ ├── daemon_darwin.go │ │ ├── daemon_freebsd.go │ │ ├── daemon_linux.go │ │ ├── daemon_linux_systemd.go │ │ ├── daemon_linux_systemv.go │ │ ├── daemon_linux_upstart.go │ │ ├── daemon_windows.go │ │ ├── helper.go │ │ ├── helper_legacy.go │ │ └── helper_windows.go └── urfave │ └── cli │ ├── CHANGELOG.md │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── MAINTAINERS.md │ ├── README.md │ ├── app.go │ ├── app_test.go │ ├── appveyor.yml │ ├── category.go │ ├── cli.go │ ├── command.go │ ├── command_test.go │ ├── context.go │ ├── context_test.go │ ├── errors.go │ ├── errors_test.go │ ├── flag-types.json │ ├── flag.go │ ├── flag_generated.go │ ├── flag_test.go │ ├── funcs.go │ ├── generate-flag-types │ ├── help.go │ ├── help_test.go │ ├── helpers_test.go │ ├── helpers_unix_test.go │ ├── helpers_windows_test.go │ ├── runtests │ ├── sort.go │ └── sort_test.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ └── ssh │ │ └── terminal │ │ ├── terminal.go │ │ ├── terminal_test.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ ├── net │ ├── LICENSE │ ├── PATENTS │ └── context │ │ ├── context.go │ │ ├── context_test.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ ├── pre_go19.go │ │ └── withtimeout_test.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ └── unix │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── 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_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_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── creds_test.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_linux_test.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 │ │ ├── example_test.go │ │ ├── export_test.go │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── mmap_unix_test.go │ │ ├── openbsd_pledge.go │ │ ├── openbsd_test.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_bsd_test.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_test.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_test.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_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_linux_test.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_test.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_solaris_test.go │ │ ├── syscall_test.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_test.go │ │ ├── timestruct.go │ │ ├── timestruct_test.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── xattr_bsd.go │ │ ├── xattr_test.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_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_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.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_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.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_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_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.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_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_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ └── time │ ├── LICENSE │ ├── PATENTS │ └── rate │ ├── rate.go │ ├── rate_go16.go │ ├── rate_go17.go │ └── rate_test.go ├── gopkg.in ├── check.v1 │ ├── LICENSE │ ├── README.md │ ├── TODO │ ├── benchmark.go │ ├── benchmark_test.go │ ├── bootstrap_test.go │ ├── check.go │ ├── check_test.go │ ├── checkers.go │ ├── checkers_test.go │ ├── export_test.go │ ├── fixture_test.go │ ├── foundation_test.go │ ├── helpers.go │ ├── helpers_test.go │ ├── integration_test.go │ ├── printer.go │ ├── printer_test.go │ ├── reporter.go │ ├── reporter_test.go │ ├── run.go │ └── run_test.go └── ini.v1 │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── bench_test.go │ ├── error.go │ ├── file.go │ ├── file_test.go │ ├── ini.go │ ├── ini_internal_test.go │ ├── ini_test.go │ ├── key.go │ ├── key_test.go │ ├── parser.go │ ├── parser_test.go │ ├── section.go │ ├── section_test.go │ ├── struct.go │ ├── struct_test.go │ └── testdata │ ├── TestFile_WriteTo.golden │ ├── UTF-16-BE-BOM.ini │ ├── UTF-16-LE-BOM.ini │ ├── UTF-8-BOM.ini │ ├── full.ini │ └── minimal.ini └── vendor.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | *.db 6 | *.idea 7 | *.cache 8 | 9 | # Folders 10 | _obj 11 | _test 12 | bin 13 | pkg 14 | doc/doc 15 | .vscode 16 | 17 | # Architecture specific extensions/prefixes 18 | *.[568vq] 19 | [568vq].out 20 | 21 | *.cgo1.go 22 | *.cgo2.c 23 | _cgo_defun.c 24 | _cgo_gotypes.go 25 | _cgo_export.* 26 | 27 | _testmain.go 28 | 29 | *.exe 30 | .DS_Store 31 | 32 | # Front 33 | node_modules/ 34 | idcshell-ui/ 35 | 36 | 37 | # vim 38 | *.sw[op] 39 | .cache/ 40 | -------------------------------------------------------------------------------- /conf/cloudboot-server.conf: -------------------------------------------------------------------------------- 1 | { 2 | "repo": { 3 | "connection": "root:yunjikeji@tcp(127.0.0.1:3306)/cloudboot?charset=utf8&parseTime=True&loc=Local" 4 | }, 5 | "osInstall": { 6 | "httpPort": 8083, 7 | "pxeConfigDir": "/var/lib/tftpboot/pxelinux.cfg" 8 | }, 9 | "logger": { 10 | "logFile": "/var/log/cloudboot-server.log", 11 | "level": "debug" 12 | }, 13 | "vm": { 14 | "storage": "guest_images_lvm" 15 | }, 16 | "cron": { 17 | "installTimeout": 3600 18 | }, 19 | "act2":{ 20 | "server":"192.168.1.17", 21 | "port":6868 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gbb.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.6.0", 3 | "tool": "go install", 4 | "importpath": "idcos.io/osinstall/build", 5 | "variables": [ 6 | { 7 | "variable": "Date", 8 | "value": "{{.Date}}" 9 | }, 10 | { 11 | "variable": "Commit", 12 | "value": "{{.GitCommit}}" 13 | }, 14 | { 15 | "variable": "Branch", 16 | "value": "$(git symbolic-ref --short -q HEAD)" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/agent/agent_test.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/smartystreets/goconvey/convey" 7 | ) 8 | 9 | func TestExecScript(t *testing.T) { 10 | Convey("执行命令: ls -l", t, func() { 11 | _, err := execScript("ls -l") 12 | So(err, ShouldBeNil) 13 | }) 14 | 15 | Convey("执行命令: ls -l / | grep bin", t, func() { 16 | _, err := execScript("ls -l / | grep bin") 17 | So(err, ShouldBeNil) 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/build/build.go: -------------------------------------------------------------------------------- 1 | package build 2 | 3 | import "strings" 4 | 5 | const ( 6 | // VersionNumber 版本号 7 | VersionNumber = "1.5.0" 8 | ) 9 | 10 | var ( 11 | // Date build time 12 | Date string 13 | // Branch current git branch 14 | Branch string 15 | // Commit git commit id 16 | Commit string 17 | ) 18 | 19 | // Version 生成版本信息 20 | func Version() string { 21 | var buf strings.Builder 22 | buf.WriteString(VersionNumber) 23 | 24 | if Date != "" { 25 | buf.WriteByte('\n') 26 | buf.WriteString("date: ") 27 | buf.WriteString(Date) 28 | } 29 | if Branch != "" { 30 | buf.WriteByte('\n') 31 | buf.WriteString("branch: ") 32 | buf.WriteString(Branch) 33 | } 34 | if Commit != "" { 35 | buf.WriteByte('\n') 36 | buf.WriteString("commit: ") 37 | buf.WriteString(Commit) 38 | } 39 | return buf.String() 40 | } 41 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/cmd/cloudboot-agent/agent_service.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/takama/daemon" 4 | 5 | // Service has embedded daemon 6 | type Service struct { 7 | daemon.Daemon 8 | } 9 | 10 | // StartDaemon start daemon 11 | func (service *Service) StartDaemon() error { 12 | if _, err := service.Install(); err != nil { 13 | return err 14 | } 15 | if _, err := service.Start(); err != nil { 16 | return err 17 | } 18 | return nil 19 | } 20 | 21 | // StopDaemon stop daemon 22 | func (service *Service) StopDaemon() error { 23 | if _, err := service.Stop(); err != nil { 24 | return err 25 | } 26 | if _, err := service.Remove(); err != nil { 27 | return err 28 | } 29 | return nil 30 | } 31 | 32 | // StatusDaemon daemon status 33 | func (service *Service) StatusDaemon() error { 34 | if _, err := service.Status(); err != nil { 35 | return err 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/cmd/cloudboot-encrypt-generator/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "idcos.io/osinstall/server/osinstallserver/util" 7 | ) 8 | 9 | func main() { 10 | var str string 11 | var publicKey string 12 | flag.StringVar(&str, "s", "", "需要加密的字符串") 13 | flag.StringVar(&publicKey, "p", "", "公钥地址") 14 | flag.Parse() 15 | if str == "" { 16 | fmt.Println("请设置需要加密的字符串参数,格式如: ./osinstall-encrypt-generator -p=\"./rsa/public.pem\" -s=\"user:password@tcp(localhost:3306)/idcos-osinstall?charset=utf8&parseTime=True&loc=Local\"") 17 | return 18 | } 19 | 20 | if publicKey == "" { 21 | fmt.Println("请设置公钥参数,格式如: ./osinstall-encrypt-generator -p=\"./rsa/public.pem\" -s=\"user:password@tcp(localhost:3306)/idcos-osinstall?charset=utf8&parseTime=True&loc=Local\"") 22 | return 23 | } 24 | 25 | str, err := util.RSAEncrypt(publicKey, str) 26 | if err != nil { 27 | fmt.Println(err) 28 | return 29 | } 30 | fmt.Println("生成成功,请将以下配置信息复制到/etc/osinstall-server/osinstall-server.conf里的\"repo\": {}节点里,并去除原有的\"connection\"子节点:") 31 | fmt.Println("\"connectionIsCrypted\":\"" + str + "\"") 32 | } 33 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/cmd/cloudboot-initdb/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "idcos.io/osinstall/model/mysqlrepo/initdb" 8 | 9 | _ "github.com/go-sql-driver/mysql" 10 | "github.com/jinzhu/gorm" 11 | ) 12 | 13 | func main() { 14 | var db *gorm.DB 15 | var err error 16 | 17 | db, err = gorm.Open("mysql", "root:yunjikeji@tcp(10.0.1.31:3306)/osinstall?charset=utf8&parseTime=True&loc=Local") 18 | if err != nil { 19 | fmt.Println(err) 20 | os.Exit(1) 21 | } 22 | defer db.Close() 23 | 24 | //db.SingularTable(true) 25 | err = initdb.DropOsInstallTables(db, nil) 26 | err = initdb.InitOsInstallTables(db, nil) 27 | if err != nil { 28 | fmt.Println(err) 29 | os.Exit(1) 30 | } 31 | fmt.Println("done") 32 | } 33 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/iniconf/config_test.ini: -------------------------------------------------------------------------------- 1 | [Logger] 2 | color = true 3 | 4 | [Repo] 5 | connection = "admin:admin@10.0.2.8/wyb-devdb?charset=utf8&parseTime=True&loc=Local" -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/iniconf/loader.go: -------------------------------------------------------------------------------- 1 | package iniconf 2 | 3 | import ( 4 | "idcos.io/osinstall/config" 5 | 6 | "gopkg.in/ini.v1" 7 | ) 8 | 9 | // INILoader 从ini 文件中加配置数据 10 | type INILoader struct { 11 | path string 12 | content []byte 13 | } 14 | 15 | // New 新建INILoader 16 | func New(path string) *INILoader { 17 | return &INILoader{ 18 | path: path, 19 | content: nil, 20 | } 21 | } 22 | 23 | // NewContent 从字符串生成 ini struct for test 24 | func NewContent(content []byte) *INILoader { 25 | return &INILoader{ 26 | path: "", 27 | content: content, 28 | } 29 | } 30 | 31 | // Load 实现Loader 接口 Load() 32 | func (loader *INILoader) Load() (*config.Config, error) { 33 | 34 | var ( 35 | cfg *ini.File 36 | err error 37 | ) 38 | 39 | if loader.content != nil { 40 | cfg, err = ini.Load(loader.content) 41 | } else { 42 | cfg, err = ini.Load(loader.path) 43 | } 44 | 45 | if err != nil { 46 | return nil, err 47 | } 48 | 49 | var conf = new(config.Config) 50 | return conf, cfg.MapTo(conf) 51 | } 52 | 53 | // Save 实现Loader 接口 Save() 54 | func (loader *INILoader) Save(conf *config.Config) error { 55 | return nil 56 | } 57 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/iniconf/loader_test.go: -------------------------------------------------------------------------------- 1 | package iniconf 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/smartystreets/goconvey/convey" 7 | ) 8 | 9 | func TestINILoader(t *testing.T) { 10 | loader := New("config_test.ini") 11 | conf, err := loader.Load() 12 | if err != nil { 13 | t.Errorf("Load error: %s\n", err) 14 | return 15 | } 16 | 17 | Convey("Logger config 校验", t, func() { 18 | So(conf.Logger.Color, ShouldEqual, true) 19 | }) 20 | 21 | Convey("Repo config 校验", t, func() { 22 | So(conf.Repo.Connection, ShouldEqual, "admin:admin@10.0.2.8/wyb-devdb?charset=utf8&parseTime=True&loc=Local") 23 | }) 24 | } 25 | 26 | func TestINILoaderContent(t *testing.T) { 27 | var iniContent = `[Logger] 28 | color = true 29 | 30 | [Repo] 31 | connection = "admin:admin@10.0.2.8/wyb-devdb?charset=utf8&parseTime=True&loc=Local"` 32 | 33 | loader := NewContent([]byte(iniContent)) 34 | conf, err := loader.Load() 35 | if err != nil { 36 | t.Errorf("Load error: %s\n", err) 37 | return 38 | } 39 | 40 | Convey("Logger config 校验", t, func() { 41 | So(conf.Logger.Color, ShouldEqual, true) 42 | }) 43 | 44 | Convey("Repo config 校验", t, func() { 45 | So(conf.Repo.Connection, ShouldEqual, "admin:admin@10.0.2.8/wyb-devdb?charset=utf8&parseTime=True&loc=Local") 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/jsonconf/config_test.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": { 3 | "addr": ":8080" 4 | }, 5 | "repo": { 6 | "addr": "10.0.2.8", 7 | "db": "testdb" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/jsonconf/loader.go: -------------------------------------------------------------------------------- 1 | package jsonconf 2 | 3 | import ( 4 | "encoding/json" 5 | "idcos.io/osinstall/config" 6 | "os" 7 | ) 8 | 9 | // JSONLoader 从json 文件中加配置数据 10 | type JSONLoader struct { 11 | path string 12 | } 13 | 14 | // New 新建JSONLoader 15 | func New(path string) *JSONLoader { 16 | return &JSONLoader{path} 17 | } 18 | 19 | // Load 实现Loader 接口 Load() 20 | func (loader *JSONLoader) Load() (*config.Config, error) { 21 | f, err := os.Open(loader.path) 22 | if err != nil { 23 | return nil, err 24 | } 25 | defer f.Close() 26 | var conf config.Config 27 | 28 | return &conf, json.NewDecoder(f).Decode(&conf) 29 | } 30 | 31 | // Save 实现Loader 接口 Save() 32 | func (loader *JSONLoader) Save(conf *config.Config) error { 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/config/jsonconf/loader_test.go: -------------------------------------------------------------------------------- 1 | package jsonconf 2 | 3 | import "testing" 4 | 5 | func TestJSONLoader(t *testing.T) { 6 | loader := New("config_test.json") 7 | conf, err := loader.Load() 8 | if err != nil { 9 | t.Errorf("Load error: %s\n", err) 10 | return 11 | } 12 | if conf.Server.Addr != ":8080" { 13 | t.Errorf("Config data error\n") 14 | return 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/middleware/close.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "idcos.io/osinstall/logger" 5 | "net/http" 6 | 7 | "github.com/AlexanderChen1989/go-json-rest/rest" 8 | 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // CloseMiddleware cancel context when timeout 13 | type CloseMiddleware struct { 14 | logger logger.Logger 15 | } 16 | 17 | // NewCloseMiddleware create middleware 18 | func NewCloseMiddleware(log logger.Logger) *CloseMiddleware { 19 | return &CloseMiddleware{log} 20 | } 21 | 22 | // MiddlewareFunc makes CloseMiddleware implement the Middleware interface. 23 | func (mw *CloseMiddleware) MiddlewareFunc(h rest.HandlerFunc) rest.HandlerFunc { 24 | return func(ctx context.Context, w rest.ResponseWriter, r *rest.Request) { 25 | // Cancel the context if the client closes the connection 26 | if wcn, ok := w.(http.CloseNotifier); ok { 27 | var cancel context.CancelFunc 28 | ctx, cancel = context.WithCancel(ctx) 29 | defer cancel() 30 | 31 | notify := wcn.CloseNotify() 32 | go func() { 33 | <-notify 34 | mw.logger.Warn("Remote closed, cancel context.\n") 35 | cancel() 36 | }() 37 | } 38 | 39 | h(ctx, w, r) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/middleware/inject_config.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "idcos.io/osinstall/config" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ctxConfigKey 注入的*config.Config对应的查询Key 11 | var ctxConfigKey uint8 12 | 13 | // ConfigFromContext 从ctx中获取model.Repo 14 | func ConfigFromContext(ctx context.Context) (*config.Config, bool) { 15 | conf, ok := ctx.Value(&ctxConfigKey).(*config.Config) 16 | return conf, ok 17 | } 18 | 19 | // InjectConfig 注入*config.Config 20 | func InjectConfig(conf *config.Config) rest.Middleware { 21 | fn := func(h rest.HandlerFunc) rest.HandlerFunc { 22 | return func(ctx context.Context, w rest.ResponseWriter, r *rest.Request) { 23 | ctx = context.WithValue(ctx, &ctxConfigKey, conf) 24 | h(ctx, w, r) 25 | } 26 | } 27 | return rest.MiddlewareSimple(fn) 28 | } 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/middleware/inject_logger.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "idcos.io/osinstall/logger" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest" 7 | 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ctxLoggerKey 注入的logger.Logger对应的查询Key 12 | var ctxLoggerKey uint8 13 | 14 | // LoggerFromContext 从ctx中获取model.Repo 15 | func LoggerFromContext(ctx context.Context) (logger.Logger, bool) { 16 | log, ok := ctx.Value(&ctxLoggerKey).(logger.Logger) 17 | return log, ok 18 | } 19 | 20 | // InjectLogger 注入logger.Logger 21 | func InjectLogger(logger logger.Logger) rest.Middleware { 22 | fn := func(h rest.HandlerFunc) rest.HandlerFunc { 23 | return func(ctx context.Context, w rest.ResponseWriter, r *rest.Request) { 24 | ctx = context.WithValue(ctx, &ctxLoggerKey, logger) 25 | h(ctx, w, r) 26 | } 27 | } 28 | return rest.MiddlewareSimple(fn) 29 | } 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/middleware/inject_repo.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "idcos.io/osinstall/model" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ctxRepoKey 注入的model.Repo对应的查询Key 11 | var ctxRepoKey uint8 12 | 13 | // RepoFromContext 从ctx中获取model.Repo 14 | func RepoFromContext(ctx context.Context) (model.Repo, bool) { 15 | repo, ok := ctx.Value(&ctxRepoKey).(model.Repo) 16 | return repo, ok 17 | } 18 | 19 | // InjectRepo 注入model.Repo 20 | func InjectRepo(repo model.Repo) rest.Middleware { 21 | fn := func(h rest.HandlerFunc) rest.HandlerFunc { 22 | return func(ctx context.Context, w rest.ResponseWriter, r *rest.Request) { 23 | ctx = context.WithValue(ctx, &ctxRepoKey, repo) 24 | h(ctx, w, r) 25 | } 26 | } 27 | return rest.MiddlewareSimple(fn) 28 | } 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/middleware/timeout.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest" 7 | 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // TimeoutMiddleware cancel context when timeout 12 | type TimeoutMiddleware struct { 13 | timeout time.Duration 14 | } 15 | 16 | // NewTimeoutMiddleware create timeout middleware with duration 17 | func NewTimeoutMiddleware(timeout time.Duration) *TimeoutMiddleware { 18 | return &TimeoutMiddleware{timeout} 19 | } 20 | 21 | // MiddlewareFunc makes TimeoutMiddleware implement the Middleware interface. 22 | func (mw *TimeoutMiddleware) MiddlewareFunc(h rest.HandlerFunc) rest.HandlerFunc { 23 | return func(ctx context.Context, w rest.ResponseWriter, r *rest.Request) { 24 | ctx, _ = context.WithTimeout(ctx, mw.timeout) 25 | h(ctx, w, r) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/mysqlrepo/initdb/init_os_install.go: -------------------------------------------------------------------------------- 1 | package initdb 2 | 3 | import ( 4 | "idcos.io/osinstall/config" 5 | "idcos.io/osinstall/model" 6 | 7 | "github.com/jinzhu/gorm" 8 | ) 9 | 10 | var osInstallTables = []interface{}{ 11 | &model.Device{}, 12 | &model.Network{}, 13 | &model.OsConfig{}, 14 | &model.SystemConfig{}, 15 | &model.Hardware{}, 16 | &model.Location{}, 17 | &model.Ip{}, 18 | &model.DeviceLog{}, 19 | &model.DeviceHistory{}, 20 | &model.Mac{}, 21 | &model.Manufacturer{}, 22 | &model.VmDevice{}, 23 | &model.User{}, 24 | &model.ManageNetwork{}, 25 | &model.ManageIp{}, 26 | &model.UserAccessToken{}, 27 | &model.DeviceInstallReport{}, 28 | &model.DeviceInstallCallback{}, 29 | &model.DhcpSubnet{}, 30 | &model.PlatformConfig{}, 31 | &model.VmHost{}, 32 | &model.VmDeviceLog{}, 33 | } 34 | 35 | func InitOsInstallTables(db *gorm.DB, conf *config.Config) error { 36 | //db.DropTableIfExists(osInstallTables...) 37 | db.CreateTable(osInstallTables...) 38 | return nil 39 | } 40 | 41 | func DropOsInstallTables(db *gorm.DB, conf *config.Config) error { 42 | db.DropTableIfExists(osInstallTables...) 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/mysqlrepo/os_install_device_history.go: -------------------------------------------------------------------------------- 1 | package mysqlrepo 2 | 3 | import ( 4 | "fmt" 5 | "idcos.io/osinstall/model" 6 | ) 7 | 8 | func (repo *MySQLRepo) UpdateHistoryDeviceStatusById(id uint, status string) (*model.DeviceHistory, error) { 9 | mod := model.DeviceHistory{Status: status} 10 | err := repo.db.First(&mod, id).Update("status", status).Error 11 | return &mod, err 12 | } 13 | 14 | func (repo *MySQLRepo) CopyDeviceToHistory(id uint) error { 15 | //var result model.DeviceHistory 16 | sqlDelete := "delete from device_histories where id = " + fmt.Sprintf("%d", id) 17 | errDelete := repo.db.Exec(sqlDelete).Error 18 | if errDelete != nil { 19 | return errDelete 20 | } 21 | 22 | sql := "insert into device_histories select * from devices where id = " + fmt.Sprintf("%d", id) 23 | err := repo.db.Exec(sql).Error 24 | return err 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/mysqlrepo/os_install_ip.go: -------------------------------------------------------------------------------- 1 | package mysqlrepo 2 | 3 | import ( 4 | //"fmt" 5 | "idcos.io/osinstall/model" 6 | ) 7 | 8 | func (repo *MySQLRepo) AddIp(networkId uint, ip string) (*model.Ip, error) { 9 | mod := model.Ip{NetworkID: networkId, Ip: ip} 10 | err := repo.db.Create(&mod).Error 11 | return &mod, err 12 | } 13 | 14 | func (repo *MySQLRepo) DeleteIpByNetworkId(networkId uint) (*model.Ip, error) { 15 | mod := model.Ip{} 16 | err := repo.db.Unscoped().Where("network_id = ?", networkId).Delete(&mod).Error 17 | return &mod, err 18 | } 19 | 20 | func (repo *MySQLRepo) CountIpByIp(ip string) (uint, error) { 21 | mod := model.Ip{Ip: ip} 22 | var count uint 23 | err := repo.db.Model(mod).Where("ip = ?", ip).Count(&count).Error 24 | return count, err 25 | } 26 | 27 | func (repo *MySQLRepo) GetIpByIp(ip string) (*model.Ip, error) { 28 | var mod model.Ip 29 | err := repo.db.Unscoped().Where("ip = ?", ip).Find(&mod).Error 30 | return &mod, err 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/mysqlrepo/os_install_manage_ip.go: -------------------------------------------------------------------------------- 1 | package mysqlrepo 2 | 3 | import ( 4 | //"fmt" 5 | "idcos.io/osinstall/model" 6 | ) 7 | 8 | func (repo *MySQLRepo) AddManageIp(networkId uint, ip string) (*model.ManageIp, error) { 9 | mod := model.ManageIp{NetworkID: networkId, Ip: ip} 10 | err := repo.db.Create(&mod).Error 11 | return &mod, err 12 | } 13 | 14 | func (repo *MySQLRepo) DeleteManageIpByNetworkId(networkId uint) (*model.ManageIp, error) { 15 | mod := model.ManageIp{} 16 | err := repo.db.Unscoped().Where("network_id = ?", networkId).Delete(&mod).Error 17 | return &mod, err 18 | } 19 | 20 | func (repo *MySQLRepo) CountManageIpByIp(ip string) (uint, error) { 21 | mod := model.ManageIp{Ip: ip} 22 | var count uint 23 | err := repo.db.Model(mod).Where("ip = ?", ip).Count(&count).Error 24 | return count, err 25 | } 26 | 27 | func (repo *MySQLRepo) GetManageIpByIp(ip string) (*model.ManageIp, error) { 28 | var mod model.ManageIp 29 | err := repo.db.Unscoped().Where("ip = ?", ip).Find(&mod).Error 30 | return &mod, err 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/mysqlrepo/os_install_user_access_token.go: -------------------------------------------------------------------------------- 1 | package mysqlrepo 2 | 3 | import ( 4 | //"fmt" 5 | "idcos.io/osinstall/model" 6 | ) 7 | 8 | func (repo *MySQLRepo) AddUserAccessToken(userId uint, accessToken string) (*model.UserAccessToken, error) { 9 | mod := model.UserAccessToken{UserID: userId, AccessToken: accessToken} 10 | err := repo.db.Create(&mod).Error 11 | return &mod, err 12 | } 13 | 14 | func (repo *MySQLRepo) DeleteUserAccessTokenByToken(accessToken string) (*model.UserAccessToken, error) { 15 | mod := model.UserAccessToken{} 16 | err := repo.db.Unscoped().Where("access_token = ?", accessToken).Delete(&mod).Error 17 | return &mod, err 18 | } 19 | 20 | func (repo *MySQLRepo) CountUserAccessTokenByToken(accessToken string) (uint, error) { 21 | mod := model.UserAccessToken{AccessToken: accessToken} 22 | var count uint 23 | err := repo.db.Model(mod).Where("access_token = ?", accessToken).Count(&count).Error 24 | return count, err 25 | } 26 | 27 | func (repo *MySQLRepo) GetUserByAccessToken(accessToken string) (*model.UserWithToken, error) { 28 | var result model.UserWithToken 29 | err := repo.db.Raw("SELECT t1.access_token,t2.username,t2.role,t2.name,t2.id from user_access_tokens t1 inner join users t2 on t1.user_id = t2.id where t1.access_token = ?", accessToken).Scan(&result).Error 30 | return &result, err 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/model/repo.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | // Repo 数据仓库 4 | type Repo interface { 5 | Close() error 6 | DropDB() error // 测试时使用 7 | 8 | //装机相关 9 | IDevice 10 | INetwork 11 | IOsConfig 12 | ISystemConfig 13 | IHardware 14 | ILocation 15 | IIp 16 | IManageNetwork 17 | IManageIp 18 | IMac 19 | IManufacturer 20 | IDeviceLog 21 | IDeviceHistory 22 | IVmDevice 23 | IUser 24 | IUserAccessToken 25 | IDeviceInstallReport 26 | IDeviceInstallCallback 27 | IDhcpSubnet 28 | IPlatformConfig 29 | IVmHost 30 | IVmDeviceLog 31 | ITaskInfo 32 | ITaskResult 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/server/osinstallserver/server.go: -------------------------------------------------------------------------------- 1 | package osinstallserver 2 | 3 | import ( 4 | "idcos.io/osinstall/config" 5 | "idcos.io/osinstall/logger" 6 | "idcos.io/osinstall/model" 7 | "idcos.io/osinstall/model/mysqlrepo" 8 | "net/http" 9 | 10 | "github.com/AlexanderChen1989/go-json-rest/rest" 11 | ) 12 | 13 | type OsInstallServer struct { 14 | Conf *config.Config 15 | Log logger.Logger 16 | Repo model.Repo 17 | handler http.Handler 18 | } 19 | 20 | // NewServer 实例化http server 21 | func NewServer(log logger.Logger, conf *config.Config, setup PipelineSetupFunc) (*OsInstallServer, error) { 22 | repo, err := mysqlrepo.NewRepo(conf, log) 23 | if err != nil { 24 | log.Error(err) 25 | return nil, err 26 | } 27 | 28 | api := rest.NewAPI() 29 | 30 | api.Use(setup(conf, log, repo)...) 31 | 32 | // routes a global 33 | router, err := rest.MakeRouter(routes...) 34 | if err != nil { 35 | log.Error(err) 36 | return nil, err 37 | } 38 | 39 | api.SetApp(router) 40 | 41 | return &OsInstallServer{ 42 | Conf: conf, 43 | Log: log, 44 | Repo: repo, 45 | handler: api.MakeHandler(), 46 | }, nil 47 | } 48 | 49 | func (server *OsInstallServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { 50 | server.handler.ServeHTTP(w, r) 51 | } 52 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/server/osinstallserver/util/pxe.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "strings" 7 | ) 8 | 9 | func CreatePxeFile(dir string, file string, content string) error { 10 | if !FileExist(dir) { 11 | err := os.MkdirAll(dir, 0777) 12 | if err != nil { 13 | return err 14 | } 15 | } 16 | 17 | //文件已存在,先删除 18 | if FileExist(dir + "/" + file) { 19 | err := os.Remove(dir + "/" + file) 20 | if err != nil { 21 | return err 22 | } 23 | } 24 | 25 | bytes := []byte(content) 26 | err := ioutil.WriteFile(dir+"/"+file, bytes, 0644) 27 | if err != nil { 28 | return err 29 | } 30 | return nil 31 | } 32 | 33 | func FileExist(filename string) bool { 34 | _, err := os.Stat(filename) 35 | return err == nil || os.IsExist(err) 36 | } 37 | 38 | func ReadFile(path string) (string, error) { 39 | fi, err := os.Open(path) 40 | if err != nil { 41 | return "", err 42 | } 43 | defer fi.Close() 44 | bytes, err := ioutil.ReadAll(fi) 45 | return string(bytes), err 46 | } 47 | 48 | func GetPxeFileNameByMac(mac string) string { 49 | mac = strings.Replace(mac, ":", "-", -1) 50 | return "01-" + mac 51 | } 52 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/server/osinstallserver/util/string.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | //"strings" 5 | "errors" 6 | ) 7 | 8 | func SubString(str string, begin int, length int) string { 9 | // 将字符串的转换成[]rune 10 | rs := []rune(str) 11 | lth := len(rs) 12 | 13 | // 简单的越界判断 14 | if begin < 0 { 15 | begin = 0 16 | } 17 | if begin >= lth { 18 | begin = lth 19 | } 20 | 21 | end := begin + length 22 | if end > lth { 23 | end = lth 24 | } 25 | 26 | // 返回子串 27 | return string(rs[begin:end]) 28 | } 29 | 30 | func CutArray(arr []string, length int) ([]string, []string, error) { 31 | var newArr []string 32 | var lostArr []string 33 | if len(arr) < length { 34 | return newArr, lostArr, errors.New("长度不够切分") 35 | } 36 | for i, value := range arr { 37 | if (i + 1) <= length { 38 | newArr = append(newArr, value) 39 | } else { 40 | lostArr = append(lostArr, value) 41 | } 42 | } 43 | return newArr, lostArr, nil 44 | } 45 | 46 | func IsInArray(str string, arr []string) bool { 47 | for _, value := range arr { 48 | if str == value { 49 | return true 50 | } 51 | } 52 | return false 53 | } 54 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/server/osinstallserver/util/user.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/hex" 6 | "strings" 7 | ) 8 | 9 | func EncodePassword(password string) (string, error) { 10 | md5Ctx := md5.New() 11 | md5Ctx.Write([]byte(password)) 12 | cipherStr := md5Ctx.Sum(nil) 13 | result := strings.ToLower(hex.EncodeToString(cipherStr)) 14 | return result, nil 15 | } 16 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/server/osinstallserver/util/vm_install.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | //"strings" 5 | "crypto/md5" 6 | "encoding/hex" 7 | "fmt" 8 | "math" 9 | "time" 10 | ) 11 | 12 | func CreateNewMacAddress() string { 13 | h := md5.New() 14 | h.Write([]byte(fmt.Sprintf("%s", time.Now().UnixNano()))) 15 | cipherStr := h.Sum(nil) 16 | md5 := fmt.Sprintf("%s", hex.EncodeToString(cipherStr)) 17 | var mac string 18 | mac = "52:54:00" 19 | mac += ":" + md5[0:2] 20 | mac += ":" + md5[2:4] 21 | mac += ":" + md5[4:6] 22 | return mac 23 | } 24 | 25 | func FotmatNumberToMB(number float64, unit string) int { 26 | var result float64 27 | if unit == "KiB" { 28 | result = number / 1024 29 | } else if unit == "MiB" { 30 | result = number 31 | } else if unit == "GiB" { 32 | result = number * 1024 33 | } else if unit == "TiB" { 34 | result = number * 1024 * 1024 35 | } 36 | return int(math.Floor(result)) 37 | } 38 | 39 | func FotmatNumberToGB(number float64, unit string) int { 40 | var result float64 41 | if unit == "KiB" { 42 | result = number / 1024 / 1024 43 | } else if unit == "MiB" { 44 | result = number / 1024 45 | } else if unit == "GiB" { 46 | result = number 47 | } else if unit == "TiB" { 48 | result = number * 1024 49 | } 50 | return int(math.Floor(result)) 51 | } 52 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/utils/charset.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import "github.com/axgle/mahonia" 4 | 5 | // GBK2UTF8 将GBK字符串转换成UTF8字符串 6 | func GBK2UTF8(strGBK string) (strUTF8 string) { 7 | return mahonia.NewDecoder("gbk").ConvertString(strGBK) 8 | } 9 | 10 | // UTF82GBK 将UTF8字符串转换成GBK字符串 11 | func UTF82GBK(strUTF8 string) (strGBK string) { 12 | return mahonia.NewEncoder("gbk").ConvertString(strUTF8) 13 | } 14 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/utils/charset_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/smartystreets/goconvey/convey" 7 | ) 8 | 9 | func TestCharset(t *testing.T) { 10 | Convey("utf8字符串与gbk字符串相互转换", t, func() { 11 | str := "hello, 世界!" // utf8 string 12 | gbkStr := UTF82GBK(str) // utf8-->gbk 13 | utf8Str := GBK2UTF8(gbkStr) // gbk-->utf8 14 | So(utf8Str, ShouldEqual, str) 15 | }) 16 | 17 | Convey("将utf8字符串再次转换成utf8字符串", t, func() { 18 | str := "hello, 世界!" // 包含中英文的utf8字符串 19 | So(GBK2UTF8(str), ShouldNotEqual, str) // 试图将utf8字符串通过'gbk-->utf8'方式转成utf8字符串,不能成立。 20 | 21 | str = "hello, world!" // 仅仅包含英文的utf8字符串 22 | So(GBK2UTF8(str), ShouldEqual, str) // 试图将utf8字符串通过'gbk-->utf8'方式转成utf8字符串,成立。 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/utils/time_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | "time" 7 | 8 | . "github.com/smartystreets/goconvey/convey" 9 | ) 10 | 11 | func TestJsonTime(t *testing.T) { 12 | type person struct { 13 | Birthday ISOTime `json:"birthday"` 14 | } 15 | now, _ := time.Parse(longTimeLayout, "2015-09-24 14:59:06") 16 | 17 | sJSON := `{"birthday":"2015-09-24 14:59:06"}` 18 | 19 | Convey("对象转换成JSON字符串", t, func() { 20 | p := person{ 21 | Birthday: ISOTime(now), 22 | } 23 | bJSON, err := json.Marshal(p) 24 | So(err, ShouldBeNil) 25 | So(string(bJSON), ShouldEqual, sJSON) 26 | So(p.Birthday.String(), ShouldEqual, "2015-09-24 14:59:06") 27 | }) 28 | 29 | Convey("JSON字符串转换成对象", t, func() { 30 | var p person 31 | err := json.Unmarshal([]byte(sJSON), &p) 32 | So(err, ShouldBeNil) 33 | So(now.Format(longTimeLayout), ShouldEqual, time.Time(p.Birthday).Format(longTimeLayout)) 34 | }) 35 | 36 | } 37 | 38 | func TestUnixSecToISOTime(t *testing.T) { 39 | Convey("测试unix秒转ISOTime", t, func() { 40 | jt := UnixSecToISOTime(10) // 10 秒 41 | So(jt.String(), ShouldEqual, "1970-01-01 08:00:10") 42 | jt = UnixSecToISOTime(600) // 10 分钟 43 | So(jt.String(), ShouldEqual, "1970-01-01 08:10:00") 44 | jt = UnixSecToISOTime(36000) // 10 小时 45 | So(jt.String(), ShouldEqual, "1970-01-01 18:00:00") 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/smartystreets/goconvey/convey" 7 | ) 8 | 9 | func TestPing(t *testing.T) { 10 | Convey("www.baidu.com", t, func() { 11 | So(PingLoop("www.baidu.com", 2, 2), ShouldBeTrue) 12 | }) 13 | 14 | Convey("osinstall.", t, func() { 15 | So(PingLoop("osinstall.", 2, 2), ShouldBeTrue) 16 | }) 17 | 18 | Convey("www.google.com", t, func() { 19 | So(PingLoop("www.google.com", 2, 2), ShouldBeFalse) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 Antoine Imbert 2 | 3 | The MIT License 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/close.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "net/http" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // CloseMiddleware cancel context when timeout 10 | type CloseMiddleware struct{} 11 | 12 | // MiddlewareFunc makes CloseMiddleware implement the Middleware interface. 13 | func (mw *CloseMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc { 14 | return func(ctx context.Context, w ResponseWriter, r *Request) { 15 | // Cancel the context if the client closes the connection 16 | if wcn, ok := w.(http.CloseNotifier); ok { 17 | var cancel context.CancelFunc 18 | ctx, cancel = context.WithCancel(ctx) 19 | defer cancel() 20 | 21 | notify := wcn.CloseNotify() 22 | go func() { 23 | <-notify 24 | cancel() 25 | }() 26 | } 27 | 28 | h(ctx, w, r) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/ctx.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "golang.org/x/net/context" 4 | 5 | const ctxPathParams = "PATH_PARAMS" 6 | const ctxEnv = "ENV" 7 | 8 | func contextWithEnv() context.Context { 9 | return context.WithValue( 10 | context.Background(), 11 | ctxEnv, 12 | &map[string]interface{}{}, 13 | ) 14 | } 15 | 16 | // PathParamFromContext fetch PathParam from context 17 | func PathParamFromContext(ctx context.Context) map[string]string { 18 | return *(ctx.Value(ctxPathParams).(*map[string]string)) 19 | } 20 | 21 | // EnvFromContext fetch Env from context 22 | func EnvFromContext(ctx context.Context) map[string]interface{} { 23 | return *(ctx.Value(ctxEnv).(*map[string]interface{})) 24 | } 25 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/json_indent_test.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest/test" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | func TestJSONIndentMiddleware(t *testing.T) { 11 | 12 | api := NewAPI() 13 | 14 | // the middleware to test 15 | api.Use(&JSONIndentMiddleware{}) 16 | 17 | // a simple app 18 | api.SetApp(AppSimple(func(ctx context.Context, w ResponseWriter, r *Request) { 19 | w.WriteJSON(map[string]string{"Id": "123"}) 20 | })) 21 | 22 | // wrap all 23 | handler := api.MakeHandler() 24 | 25 | req := test.MakeSimpleRequest("GET", "http://localhost/", nil) 26 | recorded := test.RunRequest(t, handler, req) 27 | recorded.CodeIs(200) 28 | recorded.ContentTypeIsJSON() 29 | recorded.BodyIs("{\n \"Id\": \"123\"\n}") 30 | } 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/limiter.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/didip/tollbooth" 7 | "github.com/didip/tollbooth/config" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // LimiterMiddleware cancel context when timeout 12 | type LimiterMiddleware struct { 13 | limiter *config.Limiter 14 | } 15 | 16 | // Limiter create timeout middleware with duration 17 | func Limiter(limiter *config.Limiter) *LimiterMiddleware { 18 | return &LimiterMiddleware{limiter} 19 | } 20 | 21 | // SimpleLimiter create a simple limiter 22 | func SimpleLimiter(max int64, ttl time.Duration) *LimiterMiddleware { 23 | return Limiter(tollbooth.NewLimiter(max, ttl)) 24 | } 25 | 26 | // MiddlewareFunc makes LimiterMiddleware implement the Middleware interface. 27 | func (mw *LimiterMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc { 28 | return func(ctx context.Context, w ResponseWriter, r *Request) { 29 | httpError := tollbooth.LimitByRequest(mw.limiter, r.Request) 30 | if httpError != nil { 31 | w.WriteHeader(httpError.StatusCode) 32 | w.WriteJSON(map[string]string{"status": "error", "msg": httpError.Message}) 33 | return 34 | } 35 | 36 | // There's no rate-limit error, serve the next handler. 37 | h(ctx, w, r) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/limiter_test.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "github.com/AlexanderChen1989/go-json-rest/rest/test" 8 | "github.com/didip/tollbooth" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | func TestLimiterMiddleware(t *testing.T) { 13 | api := NewAPI() 14 | 15 | // the middleware to test 16 | api.Use(Limiter(tollbooth.NewLimiter(1, time.Second))) 17 | 18 | // a simple app 19 | api.SetApp(AppSimple(func(ctx context.Context, w ResponseWriter, r *Request) { 20 | w.WriteJSON(map[string]string{"Id": "123"}) 21 | })) 22 | 23 | // wrap all 24 | handler := api.MakeHandler() 25 | 26 | for i := 0; i < 100; i++ { 27 | req := test.MakeSimpleRequest("GET", "http://localhost/", nil) 28 | req.RemoteAddr = "127.0.0.1:45344" 29 | recorded := test.RunRequest(t, handler, req) 30 | if i > 1 { 31 | recorded.CodeIs(429) 32 | recorded.ContentTypeIsJSON() 33 | } 34 | } 35 | for i := 0; i < 5; i++ { 36 | time.Sleep(time.Second) 37 | req := test.MakeSimpleRequest("GET", "http://localhost/", nil) 38 | req.RemoteAddr = "127.0.0.1:45344" 39 | recorded := test.RunRequest(t, handler, req) 40 | recorded.CodeIs(200) 41 | recorded.ContentTypeIsJSON() 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/powered_by.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "golang.org/x/net/context" 4 | 5 | const xPoweredByDefault = "go-json-rest" 6 | 7 | // PoweredByMiddleware adds the "X-Powered-By" header to the HTTP response. 8 | type PoweredByMiddleware struct { 9 | 10 | // If specified, used as the value for the "X-Powered-By" response header. 11 | // Defaults to "go-json-rest". 12 | XPoweredBy string 13 | } 14 | 15 | // MiddlewareFunc makes PoweredByMiddleware implement the Middleware interface. 16 | func (mw *PoweredByMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc { 17 | 18 | poweredBy := xPoweredByDefault 19 | if mw.XPoweredBy != "" { 20 | poweredBy = mw.XPoweredBy 21 | } 22 | 23 | return func(ctx context.Context, w ResponseWriter, r *Request) { 24 | 25 | w.Header().Add("X-Powered-By", poweredBy) 26 | 27 | // call the handler 28 | h(ctx, w, r) 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/powered_by_test.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/AlexanderChen1989/go-json-rest/rest/test" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | func TestPoweredByMiddleware(t *testing.T) { 11 | 12 | api := NewAPI() 13 | 14 | // the middleware to test 15 | api.Use(&PoweredByMiddleware{ 16 | XPoweredBy: "test", 17 | }) 18 | 19 | // a simple app 20 | api.SetApp(AppSimple(func(ctx context.Context, w ResponseWriter, r *Request) { 21 | w.WriteJSON(map[string]string{"Id": "123"}) 22 | })) 23 | 24 | // wrap all 25 | handler := api.MakeHandler() 26 | 27 | req := test.MakeSimpleRequest("GET", "http://localhost/", nil) 28 | recorded := test.RunRequest(t, handler, req) 29 | recorded.CodeIs(200) 30 | recorded.ContentTypeIsJSON() 31 | recorded.HeaderIs("X-Powered-By", "test") 32 | } 33 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/recover_test.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "io/ioutil" 5 | "log" 6 | "testing" 7 | 8 | "github.com/AlexanderChen1989/go-json-rest/rest/test" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | func TestRecoverMiddleware(t *testing.T) { 13 | 14 | api := NewAPI() 15 | 16 | // the middleware to test 17 | api.Use(&RecoverMiddleware{ 18 | Logger: log.New(ioutil.Discard, "", 0), 19 | EnableLogAsJSON: false, 20 | EnableResponseStackTrace: true, 21 | }) 22 | 23 | // a simple app that fails 24 | api.SetApp(AppSimple(func(ctx context.Context, w ResponseWriter, r *Request) { 25 | panic("test") 26 | })) 27 | 28 | // wrap all 29 | handler := api.MakeHandler() 30 | 31 | req := test.MakeSimpleRequest("GET", "http://localhost/", nil) 32 | recorded := test.RunRequest(t, handler, req) 33 | recorded.CodeIs(500) 34 | recorded.ContentTypeIsJSON() 35 | 36 | // payload 37 | payload := map[string]string{} 38 | err := recorded.DecodeJSONPayload(&payload) 39 | if err != nil { 40 | t.Fatal(err) 41 | } 42 | if payload["Error"] == "" { 43 | t.Errorf("Expected an error message, got: %v", payload) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/response_test.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestResponseNotIndent(t *testing.T) { 8 | 9 | writer := responseWriter{ 10 | nil, 11 | false, 12 | } 13 | 14 | got, err := writer.EncodeJSON(map[string]bool{"test": true}) 15 | if err != nil { 16 | t.Error(err.Error()) 17 | } 18 | gotStr := string(got) 19 | expected := "{\"test\":true}" 20 | if gotStr != expected { 21 | t.Error(expected + " was the expected, but instead got " + gotStr) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/timeout.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // TimeoutMiddleware cancel context when timeout 10 | type TimeoutMiddleware struct { 11 | timeout time.Duration 12 | } 13 | 14 | // Timeout create timeout middleware with duration 15 | func Timeout(timeout time.Duration) *TimeoutMiddleware { 16 | return &TimeoutMiddleware{timeout} 17 | } 18 | 19 | // MiddlewareFunc makes TimeoutMiddleware implement the Middleware interface. 20 | func (mw *TimeoutMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc { 21 | return func(ctx context.Context, w ResponseWriter, r *Request) { 22 | ctx, _ = context.WithTimeout(ctx, mw.timeout) 23 | h(ctx, w, r) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/AlexanderChen1989/go-json-rest/rest/timer.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // TimerMiddleware computes the elapsed time spent during the execution of the wrapped handler. 10 | // The result is available to the wrapping handlers as request.Env["ELAPSED_TIME"].(*time.Duration), 11 | // and as request.Env["START_TIME"].(*time.Time) 12 | type TimerMiddleware struct{} 13 | 14 | // MiddlewareFunc makes TimerMiddleware implement the Middleware interface. 15 | func (mw *TimerMiddleware) MiddlewareFunc(h HandlerFunc) HandlerFunc { 16 | return func(ctx context.Context, w ResponseWriter, r *Request) { 17 | 18 | start := time.Now() 19 | env := EnvFromContext(ctx) 20 | env["START_TIME"] = &start 21 | 22 | // call the handler 23 | h(ctx, w, r) 24 | 25 | end := time.Now() 26 | elapsed := end.Sub(start) 27 | env["ELAPSED_TIME"] = &elapsed 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/example_default_field_value_test.go: -------------------------------------------------------------------------------- 1 | package logrus_test 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | "os" 6 | ) 7 | 8 | type DefaultFieldHook struct { 9 | GetValue func() string 10 | } 11 | 12 | func (h *DefaultFieldHook) Levels() []logrus.Level { 13 | return logrus.AllLevels 14 | } 15 | 16 | func (h *DefaultFieldHook) Fire(e *logrus.Entry) error { 17 | e.Data["aDefaultField"] = h.GetValue() 18 | return nil 19 | } 20 | 21 | func ExampleDefaultField() { 22 | l := logrus.New() 23 | l.Out = os.Stdout 24 | l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true} 25 | 26 | l.AddHook(&DefaultFieldHook{GetValue: func() string { return "with its default value" }}) 27 | l.Info("first log") 28 | // Output: 29 | // level=info msg="first log" aDefaultField="with its default value" 30 | } 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/example_global_hook_test.go: -------------------------------------------------------------------------------- 1 | package logrus_test 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | "os" 6 | ) 7 | 8 | var ( 9 | mystring string 10 | ) 11 | 12 | type GlobalHook struct { 13 | } 14 | 15 | func (h *GlobalHook) Levels() []logrus.Level { 16 | return logrus.AllLevels 17 | } 18 | 19 | func (h *GlobalHook) Fire(e *logrus.Entry) error { 20 | e.Data["mystring"] = mystring 21 | return nil 22 | } 23 | 24 | func ExampleGlobalVariableHook() { 25 | l := logrus.New() 26 | l.Out = os.Stdout 27 | l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true} 28 | l.AddHook(&GlobalHook{}) 29 | mystring = "first value" 30 | l.Info("first log") 31 | mystring = "another value" 32 | l.Info("second log") 33 | // Output: 34 | // level=info msg="first log" mystring="first value" 35 | // level=info msg="second log" mystring="another value" 36 | } 37 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/sirupsen/logrus 2 | 3 | require ( 4 | github.com/davecgh/go-spew v1.1.1 // indirect 5 | github.com/konsorten/go-windows-terminal-sequences v1.0.1 6 | github.com/pmezard/go-difflib v1.0.0 // indirect 7 | github.com/stretchr/objx v0.1.1 // indirect 8 | github.com/stretchr/testify v1.2.2 9 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 10 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 11 | ) 12 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md: -------------------------------------------------------------------------------- 1 | # Syslog Hooks for Logrus :walrus: 2 | 3 | ## Usage 4 | 5 | ```go 6 | import ( 7 | "log/syslog" 8 | "github.com/sirupsen/logrus" 9 | lSyslog "github.com/sirupsen/logrus/hooks/syslog" 10 | ) 11 | 12 | func main() { 13 | log := logrus.New() 14 | hook, err := lSyslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 15 | 16 | if err == nil { 17 | log.Hooks.Add(hook) 18 | } 19 | } 20 | ``` 21 | 22 | If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of `NewSyslogHook`. It should look like the following. 23 | 24 | ```go 25 | import ( 26 | "log/syslog" 27 | "github.com/sirupsen/logrus" 28 | lSyslog "github.com/sirupsen/logrus/hooks/syslog" 29 | ) 30 | 31 | func main() { 32 | log := logrus.New() 33 | hook, err := lSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "") 34 | 35 | if err == nil { 36 | log.Hooks.Add(hook) 37 | } 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog_test.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!nacl,!plan9 2 | 3 | package syslog 4 | 5 | import ( 6 | "log/syslog" 7 | "testing" 8 | 9 | "github.com/sirupsen/logrus" 10 | ) 11 | 12 | func TestLocalhostAddAndPrint(t *testing.T) { 13 | log := logrus.New() 14 | hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") 15 | 16 | if err != nil { 17 | t.Errorf("Unable to connect to local syslog.") 18 | } 19 | 20 | log.Hooks.Add(hook) 21 | 22 | for _, level := range hook.Levels() { 23 | if len(log.Hooks[level]) != 1 { 24 | t.Errorf("SyslogHook was not added. The length of log.Hooks[%v]: %v", level, len(log.Hooks[level])) 25 | } 26 | } 27 | 28 | log.Info("Congratulations!") 29 | } 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_check_aix.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows,aix 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | func checkIfTerminal(w io.Writer) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_check_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows,!aix 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/crypto/ssh/terminal" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | return terminal.IsTerminal(int(v.Fd())) 16 | default: 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_check_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func checkIfTerminal(w io.Writer) bool { 12 | switch v := w.(type) { 13 | case *os.File: 14 | var mode uint32 15 | err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) 16 | return err == nil 17 | default: 18 | return false 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | func initTerminal(w io.Writer) { 8 | } 9 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | 10 | sequences "github.com/konsorten/go-windows-terminal-sequences" 11 | ) 12 | 13 | func initTerminal(w io.Writer) { 14 | switch v := w.(type) { 15 | case *os.File: 16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/astaxie/beego/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 astaxie 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. -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/astaxie/beego/logs/color.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 beego Author. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !windows 16 | 17 | package logs 18 | 19 | import "io" 20 | 21 | type ansiColorWriter struct { 22 | w io.Writer 23 | mode outputMode 24 | } 25 | 26 | func (cw *ansiColorWriter) Write(p []byte) (int, error) { 27 | return cw.w.Write(p) 28 | } 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/astaxie/beego/logs/conn_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 beego Author. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package logs 16 | 17 | import ( 18 | "testing" 19 | ) 20 | 21 | func TestConn(t *testing.T) { 22 | log := NewLogger(1000) 23 | log.SetLogger("conn", `{"net":"tcp","addr":":7020"}`) 24 | log.Informational("informational") 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/astaxie/beego/logs/smtp_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 beego Author. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package logs 16 | 17 | import ( 18 | "testing" 19 | "time" 20 | ) 21 | 22 | func TestSmtp(t *testing.T) { 23 | log := NewLogger(10000) 24 | log.SetLogger("smtp", `{"username":"beegotest@gmail.com","password":"xxxxxxxx","host":"smtp.gmail.com:587","sendTos":["xiemengjun@gmail.com"]}`) 25 | log.Critical("sendmail critical") 26 | time.Sleep(time.Second * 30) 27 | } 28 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | https://opensource.org/licenses/BSD-3-Clause 3 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/README.md: -------------------------------------------------------------------------------- 1 | mahonia 2 | ======= 3 | 4 | character-set conversion library implemented in Go. 5 | 6 | Mahonia is a character-set conversion library implemented in Go. 7 | All data is compiled into the executable; it doesn't need any external data files. 8 | 9 | based on http://code.google.com/p/mahonia/ 10 | 11 | install 12 | ------- 13 | 14 | go get github.com/axgle/mahonia 15 | 16 | example 17 | ------- 18 | 19 | package main 20 | import "fmt" 21 | import "github.com/axgle/mahonia" 22 | func main(){ 23 | enc:=mahonia.NewEncoder("gbk") 24 | //converts a string from UTF-8 to gbk encoding. 25 | fmt.Println(enc.ConvertString("hello,世界")) 26 | } 27 | 28 | donate 29 | ------- 30 | https://github.com/axgle/mahonia/wiki/Donate 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/convert_string.go: -------------------------------------------------------------------------------- 1 | package mahonia 2 | 3 | // ConvertString converts a string from UTF-8 to e's encoding. 4 | func (e Encoder) ConvertString(s string) string { 5 | dest := make([]byte, len(s)+10) 6 | destPos := 0 7 | 8 | for _, rune := range s { 9 | retry: 10 | size, status := e(dest[destPos:], rune) 11 | 12 | if status == NO_ROOM { 13 | newDest := make([]byte, len(dest)*2) 14 | copy(newDest, dest) 15 | dest = newDest 16 | goto retry 17 | } 18 | 19 | if status == STATE_ONLY { 20 | destPos += size 21 | goto retry 22 | } 23 | 24 | destPos += size 25 | } 26 | 27 | return string(dest[:destPos]) 28 | } 29 | 30 | // ConvertString converts a string from d's encoding to UTF-8. 31 | func (d Decoder) ConvertString(s string) string { 32 | bytes := []byte(s) 33 | runes := make([]rune, len(s)) 34 | destPos := 0 35 | 36 | for len(bytes) > 0 { 37 | c, size, status := d(bytes) 38 | 39 | if status == STATE_ONLY { 40 | bytes = bytes[size:] 41 | continue 42 | } 43 | 44 | if status == NO_ROOM { 45 | c = 0xfffd 46 | size = len(bytes) 47 | status = INVALID_CHAR 48 | } 49 | 50 | bytes = bytes[size:] 51 | runes[destPos] = c 52 | destPos++ 53 | } 54 | 55 | return string(runes[:destPos]) 56 | } 57 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/fallback.go: -------------------------------------------------------------------------------- 1 | package mahonia 2 | 3 | // FallbackDecoder combines a series of Decoders into one. 4 | // If the first Decoder returns a status of INVALID_CHAR, the others are tried as well. 5 | // 6 | // Note: if the text to be decoded ends with a sequence of bytes that is not a valid character in the first charset, 7 | // but it could be the beginning of a valid character, the FallbackDecoder will give a status of NO_ROOM instead of 8 | // falling back to the other Decoders. 9 | func FallbackDecoder(decoders ...Decoder) Decoder { 10 | return func(p []byte) (c rune, size int, status Status) { 11 | for _, d := range decoders { 12 | c, size, status = d(p) 13 | if status != INVALID_CHAR { 14 | return 15 | } 16 | } 17 | return 0, 1, INVALID_CHAR 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/translate.go: -------------------------------------------------------------------------------- 1 | package mahonia 2 | 3 | import "unicode/utf8" 4 | 5 | // Translate enables a Decoder to implement go-charset's Translator interface. 6 | func (d Decoder) Translate(data []byte, eof bool) (n int, cdata []byte, err error) { 7 | cdata = make([]byte, len(data)+1) 8 | destPos := 0 9 | 10 | for n < len(data) { 11 | rune, size, status := d(data[n:]) 12 | 13 | switch status { 14 | case STATE_ONLY: 15 | n += size 16 | continue 17 | 18 | case NO_ROOM: 19 | if !eof { 20 | return n, cdata[:destPos], nil 21 | } 22 | rune = 0xfffd 23 | n = len(data) 24 | 25 | default: 26 | n += size 27 | } 28 | 29 | if rune < 128 { 30 | if destPos >= len(cdata) { 31 | cdata = doubleLength(cdata) 32 | } 33 | cdata[destPos] = byte(rune) 34 | destPos++ 35 | } else { 36 | if destPos+utf8.RuneLen(rune) > len(cdata) { 37 | cdata = doubleLength(cdata) 38 | } 39 | destPos += utf8.EncodeRune(cdata[destPos:], rune) 40 | } 41 | } 42 | 43 | return n, cdata[:destPos], nil 44 | } 45 | 46 | func doubleLength(b []byte) []byte { 47 | b2 := make([]byte, 2*len(b)) 48 | copy(b2, b) 49 | return b2 50 | } 51 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/axgle/mahonia/utf8.go: -------------------------------------------------------------------------------- 1 | package mahonia 2 | 3 | import "unicode/utf8" 4 | 5 | func init() { 6 | RegisterCharset(&Charset{ 7 | Name: "UTF-8", 8 | NewDecoder: func() Decoder { return decodeUTF8Rune }, 9 | NewEncoder: func() Encoder { return encodeUTF8Rune }, 10 | }) 11 | } 12 | 13 | func decodeUTF8Rune(p []byte) (c rune, size int, status Status) { 14 | if len(p) == 0 { 15 | status = NO_ROOM 16 | return 17 | } 18 | 19 | if p[0] < 128 { 20 | return rune(p[0]), 1, SUCCESS 21 | } 22 | 23 | c, size = utf8.DecodeRune(p) 24 | 25 | if c == 0xfffd { 26 | if utf8.FullRune(p) { 27 | status = INVALID_CHAR 28 | return 29 | } 30 | 31 | return 0, 0, NO_ROOM 32 | } 33 | 34 | status = SUCCESS 35 | return 36 | } 37 | 38 | func encodeUTF8Rune(p []byte, c rune) (size int, status Status) { 39 | size = utf8.RuneLen(c) 40 | if size > len(p) { 41 | return 0, NO_ROOM 42 | } 43 | 44 | return utf8.EncodeRune(p, c), SUCCESS 45 | } 46 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/didip/tollbooth/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Didip Kerabat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/didip/tollbooth/config/config_benchmark_test.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | ) 7 | 8 | func BenchmarkLimitReached(b *testing.B) { 9 | limiter := NewLimiter(1, time.Second) 10 | key := "127.0.0.1|/" 11 | 12 | for i := 0; i < b.N; i++ { 13 | limiter.LimitReached(key) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/didip/tollbooth/errors/errors.go: -------------------------------------------------------------------------------- 1 | // Package errors provide data structure for errors. 2 | package errors 3 | 4 | import "fmt" 5 | 6 | // HTTPError is an error struct that returns both message and status code. 7 | type HTTPError struct { 8 | Message string 9 | StatusCode int 10 | } 11 | 12 | // Error returns error message. 13 | func (httperror *HTTPError) Error() string { 14 | return fmt.Sprintf("%v: %v", httperror.StatusCode, httperror.Message) 15 | } 16 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/didip/tollbooth/errors/errors_test.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import "testing" 4 | 5 | func TestError(t *testing.T) { 6 | errs := HTTPError{"blah", 429} 7 | if errs.Error() == "" { 8 | t.Errorf("Unable to print Error(). Value: %v", errs.Error()) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/didip/tollbooth/tollbooth_benchmark_test.go: -------------------------------------------------------------------------------- 1 | package tollbooth 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "strings" 7 | "testing" 8 | "time" 9 | ) 10 | 11 | func BenchmarkLimitByKeys(b *testing.B) { 12 | limiter := NewLimiter(1, time.Second) // Only 1 request per second is allowed. 13 | 14 | for i := 0; i < b.N; i++ { 15 | LimitByKeys(limiter, []string{"127.0.0.1", "/"}) 16 | } 17 | } 18 | 19 | func BenchmarkBuildKeys(b *testing.B) { 20 | limiter := NewLimiter(1, time.Second) 21 | 22 | request, err := http.NewRequest("GET", "/", strings.NewReader("Hello, world!")) 23 | if err != nil { 24 | fmt.Printf("Unable to create new HTTP request. Error: %v", err) 25 | } 26 | 27 | request.Header.Set("X-Real-IP", "2601:7:1c82:4097:59a0:a80b:2841:b8c8") 28 | for i := 0; i < b.N; i++ { 29 | sliceKeys := BuildKeys(limiter, request) 30 | if len(sliceKeys) == 0 { 31 | fmt.Print("Length of sliceKeys should never be empty.") 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/erikstmartin/go-testdb/result.go: -------------------------------------------------------------------------------- 1 | package testdb 2 | 3 | type Result struct { 4 | lastInsertId int64 5 | lastInsertIdError error 6 | rowsAffected int64 7 | rowsAffectedError error 8 | } 9 | 10 | func NewResult(lastId int64, lastIdError error, rowsAffected int64, rowsAffectedError error) (res *Result) { 11 | return &Result{ 12 | lastInsertId: lastId, 13 | lastInsertIdError: lastIdError, 14 | rowsAffected: rowsAffected, 15 | rowsAffectedError: rowsAffectedError, 16 | } 17 | } 18 | 19 | func (res *Result) LastInsertId() (int64, error) { 20 | return res.lastInsertId, res.lastInsertIdError 21 | } 22 | 23 | func (res *Result) RowsAffected() (int64, error) { 24 | return res.rowsAffected, res.rowsAffectedError 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/erikstmartin/go-testdb/rows.go: -------------------------------------------------------------------------------- 1 | package testdb 2 | 3 | import ( 4 | "database/sql/driver" 5 | "io" 6 | ) 7 | 8 | type rows struct { 9 | closed bool 10 | columns []string 11 | rows [][]driver.Value 12 | pos int 13 | } 14 | 15 | func (rs *rows) clone() *rows { 16 | if rs == nil { 17 | return nil 18 | } 19 | 20 | return &rows{closed: false, columns: rs.columns, rows: rs.rows, pos: 0} 21 | } 22 | 23 | func (rs *rows) Next(dest []driver.Value) error { 24 | rs.pos++ 25 | if rs.pos > len(rs.rows) { 26 | rs.closed = true 27 | 28 | return io.EOF // per interface spec 29 | } 30 | 31 | for i, col := range rs.rows[rs.pos-1] { 32 | dest[i] = col 33 | } 34 | 35 | return nil 36 | } 37 | 38 | func (rs *rows) Err() error { 39 | return nil 40 | } 41 | 42 | func (rs *rows) Columns() []string { 43 | return rs.columns 44 | } 45 | 46 | func (rs *rows) Close() error { 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/erikstmartin/go-testdb/stmt.go: -------------------------------------------------------------------------------- 1 | package testdb 2 | 3 | import ( 4 | "database/sql/driver" 5 | ) 6 | 7 | type stmt struct { 8 | queryFunc func(args []driver.Value) (driver.Rows, error) 9 | execFunc func(args []driver.Value) (driver.Result, error) 10 | } 11 | 12 | func (s *stmt) Close() error { 13 | return nil 14 | } 15 | 16 | func (s *stmt) NumInput() int { 17 | // This prevents the sql package from validating the number of inputs 18 | return -1 19 | } 20 | 21 | func (s *stmt) Exec(args []driver.Value) (driver.Result, error) { 22 | return s.execFunc(args) 23 | } 24 | 25 | func (s *stmt) Query(args []driver.Value) (driver.Rows, error) { 26 | return s.queryFunc(args) 27 | } 28 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/erikstmartin/go-testdb/tx.go: -------------------------------------------------------------------------------- 1 | package testdb 2 | 3 | type Tx struct { 4 | commitFunc func() error 5 | rollbackFunc func() error 6 | } 7 | 8 | func (t *Tx) Commit() error { 9 | if t.commitFunc != nil { 10 | return t.commitFunc() 11 | } 12 | return nil 13 | } 14 | 15 | func (t *Tx) Rollback() error { 16 | if t.rollbackFunc != nil { 17 | return t.rollbackFunc() 18 | } 19 | return nil 20 | } 21 | 22 | func (t *Tx) SetCommitFunc(f func() error) { 23 | t.commitFunc = f 24 | } 25 | 26 | func (t *Tx) StubCommitError(err error) { 27 | t.SetCommitFunc(func() error { 28 | return err 29 | }) 30 | } 31 | 32 | func (t *Tx) SetRollbackFunc(f func() error) { 33 | t.rollbackFunc = f 34 | } 35 | 36 | func (t *Tx) StubRollbackError(err error) { 37 | t.SetRollbackFunc(func() error { 38 | return err 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Reporting Issues 4 | 5 | Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed). 6 | 7 | ## Contributing Code 8 | 9 | By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file. 10 | Don't forget to add yourself to the AUTHORS file. 11 | 12 | ### Code Review 13 | 14 | Everyone is invited to review and comment on pull requests. 15 | If it looks fine to you, comment with "LGTM" (Looks good to me). 16 | 17 | If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes. 18 | 19 | Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM". 20 | 21 | ## Development Ideas 22 | 23 | If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page. 24 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/go-sql-driver/mysql/errors_test.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | import ( 12 | "bytes" 13 | "log" 14 | "testing" 15 | ) 16 | 17 | func TestErrorsSetLogger(t *testing.T) { 18 | previous := errLog 19 | defer func() { 20 | errLog = previous 21 | }() 22 | 23 | // set up logger 24 | const expected = "prefix: test\n" 25 | buffer := bytes.NewBuffer(make([]byte, 0, 64)) 26 | logger := log.New(buffer, "prefix: ", 0) 27 | 28 | // print 29 | SetLogger(logger) 30 | errLog.Print("test") 31 | 32 | // check result 33 | if actual := buffer.String(); actual != expected { 34 | t.Errorf("expected %q, got %q", expected, actual) 35 | } 36 | } 37 | 38 | func TestErrorsStrictIgnoreNotes(t *testing.T) { 39 | runTests(t, dsn+"&sql_notes=false", func(dbt *DBTest) { 40 | dbt.mustExec("DROP TABLE IF EXISTS does_not_exist") 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2018 by Maxim Bublis 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/1416586f4a34d02bcb506f6107b40df512b9f2f9: -------------------------------------------------------------------------------- 1 | zba7b810-9dad-11d1-80b4-00c04fd4 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/3b46a7e7b02ec193581e6c9fa2c8a72f50a64e08-1: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80F4-00c"4fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/50c54bb75fcfdc488f162bf2f0c6dec6103bfa18-5: -------------------------------------------------------------------------------- 1 | 6ad1DdE8dda91DdE80F400c0Bool30t: -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/69c581ab749cbd56be8684d3a58ac2cfab9af0f4-5: -------------------------------------------------------------------------------- 1 | 6ba7b810Edad1DdE80F400c0Bool30c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/752bf000e0bff06777dd0d6f0be6353844de678a-3: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad1Dd180F400c0Bool30c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/a4483762d4ece8466d82cca5cacd35a0829c4e60-2: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80F4-F0c"4fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/d0952c45e0c823fc5cc12bcf7d9b877d150ab523-1: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b400c0Bool30c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/da39a3ee5e6b4b0d3255bfef95601890afd80709: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idcos/osinstall-server/869e9994a4bb1dcf2b57e6d01a7464c5bb885e75/src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/da39a3ee5e6b4b0d3255bfef95601890afd80709 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/e2b84d2065846891f18ae109b12e01d224e1c7c3-4: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad1DdE80F400c0Bool30c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/e320d749435115e874f77420e17d0937e07f69f3-2: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad1Dd180b400c0Bool30c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/ed132d47d757f6468443a22df8a2a965efb34098-7: -------------------------------------------------------------------------------- 1 | 6ba1DdE8dDAE8DdE80F400c0BoUl30to -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/eeefb01f7bb3c627aedb292c994b20f739ffd613-6: -------------------------------------------------------------------------------- 1 | 6ad1DdE8dDdE8DdE80F400c0Bool30t: -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_0: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b4-00c04fd430c -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_1: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b400c04fd430c -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_10: -------------------------------------------------------------------------------- 1 | uuid:urn:6ba7b810-9dad-11d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_11: -------------------------------------------------------------------------------- 1 | uuid:urn:6ba7b8109dad11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_12: -------------------------------------------------------------------------------- 1 | 6ba7b8109-dad-11d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_13: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad1-1d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_14: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d18-0b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_15: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b40-0c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_16: -------------------------------------------------------------------------------- 1 | 6ba7b810+9dad+11d1+80b4+00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_17: -------------------------------------------------------------------------------- 1 | (6ba7b810-9dad-11d1-80b4-00c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_18: -------------------------------------------------------------------------------- 1 | {6ba7b810-9dad-11d1-80b4-00c04fd430c8> -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_19: -------------------------------------------------------------------------------- 1 | zba7b810-9dad-11d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_2: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b400c04fd430q8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_20: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_21: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad-11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_22: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d1-80b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_23: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_3: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b4-00c04fd430c8= -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_4: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b4-00c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_5: -------------------------------------------------------------------------------- 1 | {6ba7b810-9dad-11d1-80b4-00c04fd430c8}f -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_6: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b4-00c04fd430c800c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_7: -------------------------------------------------------------------------------- 1 | ba7b8109dad11d180b400c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_8: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b400c04fd430c86ba7b8109dad11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_invalid_9: -------------------------------------------------------------------------------- 1 | urn:uuid:{6ba7b810-9dad-11d1-80b4-00c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_BracedCanonical: -------------------------------------------------------------------------------- 1 | {6ba7b810-9dad-11d1-80b4-00c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_BracedHashlike: -------------------------------------------------------------------------------- 1 | {6ba7b8109dad11d180b400c04fd430c8} -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_Canonical: -------------------------------------------------------------------------------- 1 | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_Hashlike: -------------------------------------------------------------------------------- 1 | 6ba7b8109dad11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_URNCanonical: -------------------------------------------------------------------------------- 1 | urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gofrs/uuid/testdata/corpus/seed_valid_URNHashlike: -------------------------------------------------------------------------------- 1 | urn:uuid:6ba7b8109dad11d180b400c04fd430c8 -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/securecookie/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of gorilla/securecookie authors for copyright purposes. 2 | # Please keep the list sorted. 3 | 4 | 0x434D53 5 | Abdülhamit Yilmaz 6 | Annonomus-Penguin 7 | Craig Peterson 8 | Cyril David 9 | Dmitry Chestnykh 10 | Dominik Honnef 11 | Google LLC (https://opensource.google.com/) 12 | John Downey 13 | Kamil Kisiel 14 | Keunwoo Lee 15 | Mahmud Ridwan 16 | Matt Silverlock 17 | rodrigo moraes 18 | s7v7nislands 19 | Wesley Bitter 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/securecookie/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package securecookie 4 | 5 | var hashKey = []byte("very-secret12345") 6 | var blockKey = []byte("a-lot-secret1234") 7 | var s = New(hashKey, blockKey) 8 | 9 | type Cookie struct { 10 | B bool 11 | I int 12 | S string 13 | } 14 | 15 | func Fuzz(data []byte) int { 16 | datas := string(data) 17 | var c Cookie 18 | if err := s.Decode("fuzz", datas, &c); err != nil { 19 | return 0 20 | } 21 | if _, err := s.Encode("fuzz", c); err != nil { 22 | panic(err) 23 | } 24 | return 1 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/securecookie/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gorilla/securecookie 2 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/cookie.go: -------------------------------------------------------------------------------- 1 | // +build !go1.11 2 | 3 | package sessions 4 | 5 | import "net/http" 6 | 7 | // newCookieFromOptions returns an http.Cookie with the options set. 8 | func newCookieFromOptions(name, value string, options *Options) *http.Cookie { 9 | return &http.Cookie{ 10 | Name: name, 11 | Value: value, 12 | Path: options.Path, 13 | Domain: options.Domain, 14 | MaxAge: options.MaxAge, 15 | Secure: options.Secure, 16 | HttpOnly: options.HttpOnly, 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/cookie_go111.go: -------------------------------------------------------------------------------- 1 | // +build go1.11 2 | 3 | package sessions 4 | 5 | import "net/http" 6 | 7 | // newCookieFromOptions returns an http.Cookie with the options set. 8 | func newCookieFromOptions(name, value string, options *Options) *http.Cookie { 9 | return &http.Cookie{ 10 | Name: name, 11 | Value: value, 12 | Path: options.Path, 13 | Domain: options.Domain, 14 | MaxAge: options.MaxAge, 15 | Secure: options.Secure, 16 | HttpOnly: options.HttpOnly, 17 | SameSite: options.SameSite, 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/cookie_go111_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.11 2 | 3 | package sessions 4 | 5 | import ( 6 | "net/http" 7 | "testing" 8 | ) 9 | 10 | // Test for setting SameSite field in new http.Cookie from name, value 11 | // and options 12 | func TestNewCookieFromOptionsSameSite(t *testing.T) { 13 | tests := []struct { 14 | sameSite http.SameSite 15 | }{ 16 | {http.SameSiteDefaultMode}, 17 | {http.SameSiteLaxMode}, 18 | {http.SameSiteStrictMode}, 19 | } 20 | for i, v := range tests { 21 | options := &Options{ 22 | SameSite: v.sameSite, 23 | } 24 | cookie := newCookieFromOptions("", "", options) 25 | if cookie.SameSite != v.sameSite { 26 | t.Fatalf("%v: bad cookie sameSite: got %v, want %v", i+1, cookie.SameSite, v.sameSite) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gorilla/sessions 2 | 3 | require ( 4 | github.com/gorilla/context v1.1.1 5 | github.com/gorilla/securecookie v1.1.1 6 | ) 7 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/options.go: -------------------------------------------------------------------------------- 1 | // +build !go1.11 2 | 3 | package sessions 4 | 5 | // Options stores configuration for a session or session store. 6 | // 7 | // Fields are a subset of http.Cookie fields. 8 | type Options struct { 9 | Path string 10 | Domain string 11 | // MaxAge=0 means no Max-Age attribute specified and the cookie will be 12 | // deleted after the browser session ends. 13 | // MaxAge<0 means delete cookie immediately. 14 | // MaxAge>0 means Max-Age attribute present and given in seconds. 15 | MaxAge int 16 | Secure bool 17 | HttpOnly bool 18 | } 19 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/gorilla/sessions/options_go111.go: -------------------------------------------------------------------------------- 1 | // +build go1.11 2 | 3 | package sessions 4 | 5 | import "net/http" 6 | 7 | // Options stores configuration for a session or session store. 8 | // 9 | // Fields are a subset of http.Cookie fields. 10 | type Options struct { 11 | Path string 12 | Domain string 13 | // MaxAge=0 means no Max-Age attribute specified and the cookie will be 14 | // deleted after the browser session ends. 15 | // MaxAge<0 means delete cookie immediately. 16 | // MaxAge>0 means Max-Age attribute present and given in seconds. 17 | MaxAge int 18 | Secure bool 19 | HttpOnly bool 20 | // Defaults to http.SameSiteDefaultMode 21 | SameSite http.SameSite 22 | } 23 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jakecoffman/cron/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 Rob Figueiredo 2 | All Rights Reserved. 3 | 4 | MIT LICENSE 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jakecoffman/cron/constantdelay.go: -------------------------------------------------------------------------------- 1 | package cron 2 | 3 | import "time" 4 | 5 | // ConstantDelaySchedule represents a simple recurring duty cycle, e.g. "Every 5 minutes". 6 | // It does not support jobs more frequent than once a second. 7 | type ConstantDelaySchedule struct { 8 | Delay time.Duration 9 | } 10 | 11 | // Every returns a crontab Schedule that activates once every duration. 12 | // Delays of less than a second are not supported (will panic). 13 | // Any fields less than a Second are truncated. 14 | func Every(duration time.Duration) ConstantDelaySchedule { 15 | if duration < time.Second { 16 | panic("cron/constantdelay: delays of less than a second are not supported: " + 17 | duration.String()) 18 | } 19 | return ConstantDelaySchedule{ 20 | Delay: duration - time.Duration(duration.Nanoseconds())%time.Second, 21 | } 22 | } 23 | 24 | // Next returns the next time this should be run. 25 | // This rounds so that the next activation time will be on the second. 26 | func (schedule ConstantDelaySchedule) Next(t time.Time) time.Time { 27 | return t.Add(schedule.Delay - time.Duration(t.Nanosecond())*time.Nanosecond) 28 | } 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jtolds/gls/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Space Monkey, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jtolds/gls/gen_sym.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | var ( 8 | keyMtx sync.Mutex 9 | keyCounter uint64 10 | ) 11 | 12 | // ContextKey is a throwaway value you can use as a key to a ContextManager 13 | type ContextKey struct{ id uint64 } 14 | 15 | // GenSym will return a brand new, never-before-used ContextKey 16 | func GenSym() ContextKey { 17 | keyMtx.Lock() 18 | defer keyMtx.Unlock() 19 | keyCounter += 1 20 | return ContextKey{id: keyCounter} 21 | } 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jtolds/gls/gid.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | var ( 4 | stackTagPool = &idPool{} 5 | ) 6 | 7 | // Will return this goroutine's identifier if set. If you always need a 8 | // goroutine identifier, you should use EnsureGoroutineId which will make one 9 | // if there isn't one already. 10 | func GetGoroutineId() (gid uint, ok bool) { 11 | return readStackTag() 12 | } 13 | 14 | // Will call cb with the current goroutine identifier. If one hasn't already 15 | // been generated, one will be created and set first. The goroutine identifier 16 | // might be invalid after cb returns. 17 | func EnsureGoroutineId(cb func(gid uint)) { 18 | if gid, ok := readStackTag(); ok { 19 | cb(gid) 20 | return 21 | } 22 | gid := stackTagPool.Acquire() 23 | defer stackTagPool.Release(gid) 24 | addStackTag(gid, func() { cb(gid) }) 25 | } 26 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jtolds/gls/id_pool.go: -------------------------------------------------------------------------------- 1 | package gls 2 | 3 | // though this could probably be better at keeping ids smaller, the goal of 4 | // this class is to keep a registry of the smallest unique integer ids 5 | // per-process possible 6 | 7 | import ( 8 | "sync" 9 | ) 10 | 11 | type idPool struct { 12 | mtx sync.Mutex 13 | released []uint 14 | max_id uint 15 | } 16 | 17 | func (p *idPool) Acquire() (id uint) { 18 | p.mtx.Lock() 19 | defer p.mtx.Unlock() 20 | if len(p.released) > 0 { 21 | id = p.released[len(p.released)-1] 22 | p.released = p.released[:len(p.released)-1] 23 | return id 24 | } 25 | id = p.max_id 26 | p.max_id++ 27 | return id 28 | } 29 | 30 | func (p *idPool) Release(id uint) { 31 | p.mtx.Lock() 32 | defer p.mtx.Unlock() 33 | p.released = append(p.released, id) 34 | } 35 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/jtolds/gls/stack_tags_main.go: -------------------------------------------------------------------------------- 1 | // +build !js 2 | 3 | package gls 4 | 5 | // This file is used for standard Go builds, which have the expected runtime 6 | // support 7 | 8 | import ( 9 | "runtime" 10 | ) 11 | 12 | var ( 13 | findPtr = func() uintptr { 14 | var pc [1]uintptr 15 | n := runtime.Callers(4, pc[:]) 16 | if n != 1 { 17 | panic("failed to find function pointer") 18 | } 19 | return pc[0] 20 | } 21 | 22 | getStack = func(offset, amount int) (stack []uintptr, next_offset int) { 23 | stack = make([]uintptr, amount) 24 | stack = stack[:runtime.Callers(offset, stack)] 25 | if len(stack) < amount { 26 | return stack, 0 27 | } 28 | return stack, offset + len(stack) 29 | } 30 | ) 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/juju/ratelimit/reader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Canonical Ltd. 2 | // Licensed under the LGPLv3 with static-linking exception. 3 | // See LICENCE file for details. 4 | 5 | package ratelimit 6 | 7 | import "io" 8 | 9 | type reader struct { 10 | r io.Reader 11 | bucket *Bucket 12 | } 13 | 14 | // Reader returns a reader that is rate limited by 15 | // the given token bucket. Each token in the bucket 16 | // represents one byte. 17 | func Reader(r io.Reader, bucket *Bucket) io.Reader { 18 | return &reader{ 19 | r: r, 20 | bucket: bucket, 21 | } 22 | } 23 | 24 | func (r *reader) Read(buf []byte) (int, error) { 25 | n, err := r.r.Read(buf) 26 | if n <= 0 { 27 | return n, err 28 | } 29 | r.bucket.Wait(int64(n)) 30 | return n, err 31 | } 32 | 33 | type writer struct { 34 | w io.Writer 35 | bucket *Bucket 36 | } 37 | 38 | // Writer returns a reader that is rate limited by 39 | // the given token bucket. Each token in the bucket 40 | // represents one byte. 41 | func Writer(w io.Writer, bucket *Bucket) io.Writer { 42 | return &writer{ 43 | w: w, 44 | bucket: bucket, 45 | } 46 | } 47 | 48 | func (w *writer) Write(buf []byte) (int, error) { 49 | w.bucket.Wait(int64(len(buf))) 50 | return w.w.Write(buf) 51 | } 52 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de) 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/konsorten/go-windows-terminal-sequences 2 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package sequences 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | var ( 11 | kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll") 12 | setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode") 13 | ) 14 | 15 | func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error { 16 | const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4 17 | 18 | var mode uint32 19 | err := syscall.GetConsoleMode(syscall.Stdout, &mode) 20 | if err != nil { 21 | return err 22 | } 23 | 24 | if enable { 25 | mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING 26 | } else { 27 | mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING 28 | } 29 | 30 | ret, _, err := setConsoleMode.Call(uintptr(unsafe.Pointer(stream)), uintptr(mode)) 31 | if ret == 0 { 32 | return err 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/pretty/License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2012 Keith Rarick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/pretty/Readme: -------------------------------------------------------------------------------- 1 | package pretty 2 | 3 | import "github.com/kr/pretty" 4 | 5 | Package pretty provides pretty-printing for Go values. 6 | 7 | Documentation 8 | 9 | http://godoc.org/github.com/kr/pretty 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/pretty/example_test.go: -------------------------------------------------------------------------------- 1 | package pretty_test 2 | 3 | import ( 4 | "fmt" 5 | "github.com/kr/pretty" 6 | ) 7 | 8 | func Example() { 9 | type myType struct { 10 | a, b int 11 | } 12 | var x = []myType{{1, 2}, {3, 4}, {5, 6}} 13 | fmt.Printf("%# v", pretty.Formatter(x)) 14 | // output: 15 | // []pretty_test.myType{ 16 | // {a:1, b:2}, 17 | // {a:3, b:4}, 18 | // {a:5, b:6}, 19 | // } 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/pretty/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/kr/pretty" 2 | 3 | require "github.com/kr/text" v0.1.0 4 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/pretty/zero.go: -------------------------------------------------------------------------------- 1 | package pretty 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | func nonzero(v reflect.Value) bool { 8 | switch v.Kind() { 9 | case reflect.Bool: 10 | return v.Bool() 11 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 12 | return v.Int() != 0 13 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 14 | return v.Uint() != 0 15 | case reflect.Float32, reflect.Float64: 16 | return v.Float() != 0 17 | case reflect.Complex64, reflect.Complex128: 18 | return v.Complex() != complex(0, 0) 19 | case reflect.String: 20 | return v.String() != "" 21 | case reflect.Struct: 22 | for i := 0; i < v.NumField(); i++ { 23 | if nonzero(getField(v, i)) { 24 | return true 25 | } 26 | } 27 | return false 28 | case reflect.Array: 29 | for i := 0; i < v.Len(); i++ { 30 | if nonzero(v.Index(i)) { 31 | return true 32 | } 33 | } 34 | return false 35 | case reflect.Map, reflect.Interface, reflect.Slice, reflect.Ptr, reflect.Chan, reflect.Func: 36 | return !v.IsNil() 37 | case reflect.UnsafePointer: 38 | return v.Pointer() != 0 39 | } 40 | return true 41 | } 42 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/text/License: -------------------------------------------------------------------------------- 1 | Copyright 2012 Keith Rarick 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/text/Readme: -------------------------------------------------------------------------------- 1 | This is a Go package for manipulating paragraphs of text. 2 | 3 | See http://go.pkgdoc.org/github.com/kr/text for full documentation. 4 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/text/doc.go: -------------------------------------------------------------------------------- 1 | // Package text provides rudimentary functions for manipulating text in 2 | // paragraphs. 3 | package text 4 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/kr/text/go.mod: -------------------------------------------------------------------------------- 1 | module "github.com/kr/text" 2 | 3 | require "github.com/kr/pty" v1.1.1 4 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to pq 2 | 3 | `pq` has a backlog of pull requests, but contributions are still very 4 | much welcome. You can help with patch review, submitting bug reports, 5 | or adding new functionality. There is no formal style guide, but 6 | please conform to the style of existing code and general Go formatting 7 | conventions when submitting patches. 8 | 9 | ### Patch review 10 | 11 | Help review existing open pull requests by commenting on the code or 12 | proposed functionality. 13 | 14 | ### Bug reports 15 | 16 | We appreciate any bug reports, but especially ones with self-contained 17 | (doesn't depend on code outside of pq), minimal (can't be simplified 18 | further) test cases. It's especially helpful if you can submit a pull 19 | request with just the failing test case (you'll probably want to 20 | pattern it after the tests in 21 | [conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). 22 | 23 | ### New functionality 24 | 25 | There are a number of pending patches for new functionality, so 26 | additional feature patches will take a while to merge. Still, patches 27 | are generally reviewed based on usefulness and complexity in addition 28 | to time-in-queue, so if you have a knockout idea, take a shot. Feel 29 | free to open an issue discussion your proposed patch beforehand. 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/TESTS.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | ## Running Tests 4 | 5 | `go test` is used for testing. A running PostgreSQL 6 | server is required, with the ability to log in. The 7 | database to connect to test with is "pqgotest," on 8 | "localhost" but these can be overridden using [environment 9 | variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html). 10 | 11 | Example: 12 | 13 | PGHOST=/run/postgresql go test 14 | 15 | ## Benchmarks 16 | 17 | A benchmark suite can be run as part of the tests: 18 | 19 | go test -bench . 20 | 21 | ## Example setup (Docker) 22 | 23 | Run a postgres container: 24 | 25 | ``` 26 | docker run --expose 5432:5432 postgres 27 | ``` 28 | 29 | Run tests: 30 | 31 | ``` 32 | PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test 33 | ``` 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/connector_example_test.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package pq_test 4 | 5 | import ( 6 | "database/sql" 7 | "fmt" 8 | 9 | "github.com/lib/pq" 10 | ) 11 | 12 | func ExampleNewConnector() { 13 | name := "" 14 | connector, err := pq.NewConnector(name) 15 | if err != nil { 16 | fmt.Println(err) 17 | return 18 | } 19 | db := sql.OpenDB(connector) 20 | if err != nil { 21 | fmt.Println(err) 22 | return 23 | } 24 | defer db.Close() 25 | 26 | // Use the DB 27 | txn, err := db.Begin() 28 | if err != nil { 29 | fmt.Println(err) 30 | return 31 | } 32 | txn.Rollback() 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lib/pq 2 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/issues_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import "testing" 4 | 5 | func TestIssue494(t *testing.T) { 6 | db := openTestConn(t) 7 | defer db.Close() 8 | 9 | query := `CREATE TEMP TABLE t (i INT PRIMARY KEY)` 10 | if _, err := db.Exec(query); err != nil { 11 | t.Fatal(err) 12 | } 13 | 14 | txn, err := db.Begin() 15 | if err != nil { 16 | t.Fatal(err) 17 | } 18 | 19 | if _, err := txn.Prepare(CopyIn("t", "i")); err != nil { 20 | t.Fatal(err) 21 | } 22 | 23 | if _, err := txn.Query("SELECT 1"); err == nil { 24 | t.Fatal("expected error") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/ssl_permissions.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pq 4 | 5 | import "os" 6 | 7 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 8 | // The key file should have very little access. 9 | // 10 | // libpq does not check key file permissions on Windows. 11 | func sslKeyPermissions(sslkey string) error { 12 | info, err := os.Stat(sslkey) 13 | if err != nil { 14 | return err 15 | } 16 | if info.Mode().Perm()&0077 != 0 { 17 | return ErrSSLKeyHasWorldPermissions 18 | } 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pq 4 | 5 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 6 | // The key file should have very little access. 7 | // 8 | // libpq does not check key file permissions on Windows. 9 | func sslKeyPermissions(string) error { return nil } 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/lib/pq/uuid_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "reflect" 5 | "strings" 6 | "testing" 7 | ) 8 | 9 | func TestDecodeUUIDBinaryError(t *testing.T) { 10 | t.Parallel() 11 | _, err := decodeUUIDBinary([]byte{0x12, 0x34}) 12 | 13 | if err == nil { 14 | t.Fatal("Expected error, got none") 15 | } 16 | if !strings.HasPrefix(err.Error(), "pq:") { 17 | t.Errorf("Expected error to start with %q, got %q", "pq:", err.Error()) 18 | } 19 | if !strings.Contains(err.Error(), "bad length: 2") { 20 | t.Errorf("Expected error to contain length, got %q", err.Error()) 21 | } 22 | } 23 | 24 | func BenchmarkDecodeUUIDBinary(b *testing.B) { 25 | x := []byte{0x03, 0xa3, 0x52, 0x2f, 0x89, 0x28, 0x49, 0x87, 0x84, 0xd6, 0x93, 0x7b, 0x36, 0xec, 0x27, 0x6f} 26 | 27 | for i := 0; i < b.N; i++ { 28 | decodeUUIDBinary(x) 29 | } 30 | } 31 | 32 | func TestDecodeUUIDBackend(t *testing.T) { 33 | db := openTestConn(t) 34 | defer db.Close() 35 | 36 | var s = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a" 37 | var scanned interface{} 38 | 39 | err := db.QueryRow(`SELECT $1::uuid`, s).Scan(&scanned) 40 | if err != nil { 41 | t.Fatalf("Expected no error, got %v", err) 42 | } 43 | if !reflect.DeepEqual(scanned, []byte(s)) { 44 | t.Errorf("Expected []byte(%q), got %T(%q)", s, scanned, scanned) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/patrickmn/go-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | This is a list of people who have contributed code to go-cache. They, or their 2 | employers, are the copyright holders of the contributed code. Contributed code 3 | is subject to the license restrictions listed in LICENSE (as they were when the 4 | code was contributed.) 5 | 6 | Dustin Sallings 7 | Jason Mooberry 8 | Sergey Shepelev 9 | Alex Edwards 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/patrickmn/go-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2018 Patrick Mylund Nielsen and the go-cache contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/assertions/filter.go: -------------------------------------------------------------------------------- 1 | package assertions 2 | 3 | import "fmt" 4 | 5 | const ( 6 | success = "" 7 | needExactValues = "This assertion requires exactly %d comparison values (you provided %d)." 8 | needNonEmptyCollection = "This assertion requires at least 1 comparison value (you provided 0)." 9 | needFewerValues = "This assertion allows %d or fewer comparison values (you provided %d)." 10 | ) 11 | 12 | func need(needed int, expected []interface{}) string { 13 | if len(expected) != needed { 14 | return fmt.Sprintf(needExactValues, needed, len(expected)) 15 | } 16 | return success 17 | } 18 | 19 | func atLeast(minimum int, expected []interface{}) string { 20 | if len(expected) < 1 { 21 | return needNonEmptyCollection 22 | } 23 | return success 24 | } 25 | 26 | func atMost(max int, expected []interface{}) string { 27 | if len(expected) > max { 28 | return fmt.Sprintf(needFewerValues, max, len(expected)) 29 | } 30 | return success 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/assertions/internal/go-render/render/render_time.go: -------------------------------------------------------------------------------- 1 | package render 2 | 3 | import ( 4 | "reflect" 5 | "time" 6 | ) 7 | 8 | func renderTime(value reflect.Value) (string, bool) { 9 | if instant, ok := convertTime(value); !ok { 10 | return "", false 11 | } else if instant.IsZero() { 12 | return "0", true 13 | } else { 14 | return instant.String(), true 15 | } 16 | } 17 | 18 | func convertTime(value reflect.Value) (t time.Time, ok bool) { 19 | if value.Type() == timeType { 20 | defer func() { recover() }() 21 | t, ok = value.Interface().(time.Time) 22 | } 23 | return 24 | } 25 | 26 | var timeType = reflect.TypeOf(time.Time{}) 27 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/convey.goconvey: -------------------------------------------------------------------------------- 1 | #ignore 2 | -timeout=1s 3 | #-covermode=count 4 | #-coverpkg=github.com/smartystreets/goconvey/convey,github.com/smartystreets/goconvey/convey/gotest,github.com/smartystreets/goconvey/convey/reporting -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/gotest/doc_test.go: -------------------------------------------------------------------------------- 1 | package gotest 2 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/gotest/utils.go: -------------------------------------------------------------------------------- 1 | // Package gotest contains internal functionality. Although this package 2 | // contains one or more exported names it is not intended for public 3 | // consumption. See the examples package for how to use this project. 4 | package gotest 5 | 6 | import ( 7 | "runtime" 8 | "strings" 9 | ) 10 | 11 | func ResolveExternalCaller() (file string, line int, name string) { 12 | var caller_id uintptr 13 | callers := runtime.Callers(0, callStack) 14 | 15 | for x := 0; x < callers; x++ { 16 | caller_id, file, line, _ = runtime.Caller(x) 17 | if strings.HasSuffix(file, "_test.go") || strings.HasSuffix(file, "_tests.go") { 18 | name = runtime.FuncForPC(caller_id).Name() 19 | return 20 | } 21 | } 22 | file, line, name = "", -1, "" 23 | return // panic? 24 | } 25 | 26 | const maxStackDepth = 100 // This had better be enough... 27 | 28 | var callStack []uintptr = make([]uintptr, maxStackDepth, maxStackDepth) 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/nilReporter.go: -------------------------------------------------------------------------------- 1 | package convey 2 | 3 | import ( 4 | "github.com/smartystreets/goconvey/convey/reporting" 5 | ) 6 | 7 | type nilReporter struct{} 8 | 9 | func (self *nilReporter) BeginStory(story *reporting.StoryReport) {} 10 | func (self *nilReporter) Enter(scope *reporting.ScopeReport) {} 11 | func (self *nilReporter) Report(report *reporting.AssertionResult) {} 12 | func (self *nilReporter) Exit() {} 13 | func (self *nilReporter) EndStory() {} 14 | func (self *nilReporter) Write(p []byte) (int, error) { return len(p), nil } 15 | func newNilReporter() *nilReporter { return &nilReporter{} } 16 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/console.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | type console struct{} 9 | 10 | func (self *console) Write(p []byte) (n int, err error) { 11 | return fmt.Print(string(p)) 12 | } 13 | 14 | func NewConsole() io.Writer { 15 | return new(console) 16 | } 17 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/doc.go: -------------------------------------------------------------------------------- 1 | // Package reporting contains internal functionality related 2 | // to console reporting and output. Although this package has 3 | // exported names is not intended for public consumption. See the 4 | // examples package for how to use this project. 5 | package reporting 6 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/dot.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import "fmt" 4 | 5 | type dot struct{ out *Printer } 6 | 7 | func (self *dot) BeginStory(story *StoryReport) {} 8 | 9 | func (self *dot) Enter(scope *ScopeReport) {} 10 | 11 | func (self *dot) Report(report *AssertionResult) { 12 | if report.Error != nil { 13 | fmt.Print(redColor) 14 | self.out.Insert(dotError) 15 | } else if report.Failure != "" { 16 | fmt.Print(yellowColor) 17 | self.out.Insert(dotFailure) 18 | } else if report.Skipped { 19 | fmt.Print(yellowColor) 20 | self.out.Insert(dotSkip) 21 | } else { 22 | fmt.Print(greenColor) 23 | self.out.Insert(dotSuccess) 24 | } 25 | fmt.Print(resetColor) 26 | } 27 | 28 | func (self *dot) Exit() {} 29 | 30 | func (self *dot) EndStory() {} 31 | 32 | func (self *dot) Write(content []byte) (written int, err error) { 33 | return len(content), nil // no-op 34 | } 35 | 36 | func NewDotReporter(out *Printer) *dot { 37 | self := new(dot) 38 | self.out = out 39 | return self 40 | } 41 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/dot_test.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import ( 4 | "errors" 5 | "testing" 6 | ) 7 | 8 | func TestDotReporterAssertionPrinting(t *testing.T) { 9 | monochrome() 10 | file := newMemoryFile() 11 | printer := NewPrinter(file) 12 | reporter := NewDotReporter(printer) 13 | 14 | reporter.Report(NewSuccessReport()) 15 | reporter.Report(NewFailureReport("failed")) 16 | reporter.Report(NewErrorReport(errors.New("error"))) 17 | reporter.Report(NewSkipReport()) 18 | 19 | expected := dotSuccess + dotFailure + dotError + dotSkip 20 | 21 | if file.buffer != expected { 22 | t.Errorf("\nExpected: '%s'\nActual: '%s'", expected, file.buffer) 23 | } 24 | } 25 | 26 | func TestDotReporterOnlyReportsAssertions(t *testing.T) { 27 | monochrome() 28 | file := newMemoryFile() 29 | printer := NewPrinter(file) 30 | reporter := NewDotReporter(printer) 31 | 32 | reporter.BeginStory(nil) 33 | reporter.Enter(nil) 34 | reporter.Exit() 35 | reporter.EndStory() 36 | 37 | if file.buffer != "" { 38 | t.Errorf("\nExpected: '(blank)'\nActual: '%s'", file.buffer) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/gotest.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | type gotestReporter struct{ test T } 4 | 5 | func (self *gotestReporter) BeginStory(story *StoryReport) { 6 | self.test = story.Test 7 | } 8 | 9 | func (self *gotestReporter) Enter(scope *ScopeReport) {} 10 | 11 | func (self *gotestReporter) Report(r *AssertionResult) { 12 | if !passed(r) { 13 | self.test.Fail() 14 | } 15 | } 16 | 17 | func (self *gotestReporter) Exit() {} 18 | 19 | func (self *gotestReporter) EndStory() { 20 | self.test = nil 21 | } 22 | 23 | func (self *gotestReporter) Write(content []byte) (written int, err error) { 24 | return len(content), nil // no-op 25 | } 26 | 27 | func NewGoTestReporter() *gotestReporter { 28 | return new(gotestReporter) 29 | } 30 | 31 | func passed(r *AssertionResult) bool { 32 | return r.Error == nil && r.Failure == "" 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/reporter.go: -------------------------------------------------------------------------------- 1 | package reporting 2 | 3 | import "io" 4 | 5 | type Reporter interface { 6 | BeginStory(story *StoryReport) 7 | Enter(scope *ScopeReport) 8 | Report(r *AssertionResult) 9 | Exit() 10 | EndStory() 11 | io.Writer 12 | } 13 | 14 | type reporters struct{ collection []Reporter } 15 | 16 | func (self *reporters) BeginStory(s *StoryReport) { self.foreach(func(r Reporter) { r.BeginStory(s) }) } 17 | func (self *reporters) Enter(s *ScopeReport) { self.foreach(func(r Reporter) { r.Enter(s) }) } 18 | func (self *reporters) Report(a *AssertionResult) { self.foreach(func(r Reporter) { r.Report(a) }) } 19 | func (self *reporters) Exit() { self.foreach(func(r Reporter) { r.Exit() }) } 20 | func (self *reporters) EndStory() { self.foreach(func(r Reporter) { r.EndStory() }) } 21 | 22 | func (self *reporters) Write(contents []byte) (written int, err error) { 23 | self.foreach(func(r Reporter) { 24 | written, err = r.Write(contents) 25 | }) 26 | return written, err 27 | } 28 | 29 | func (self *reporters) foreach(action func(Reporter)) { 30 | for _, r := range self.collection { 31 | action(r) 32 | } 33 | } 34 | 35 | func NewReporters(collection ...Reporter) *reporters { 36 | self := new(reporters) 37 | self.collection = collection 38 | return self 39 | } 40 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/smartystreets/goconvey/convey/reporting/reporting.goconvey: -------------------------------------------------------------------------------- 1 | #ignore 2 | -timeout=1s 3 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 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=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } 4 | if h, ok := t.(tHelper); ok { h.Helper() } 5 | t.FailNow() 6 | } 7 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/takama/daemon/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 The Go Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/takama/daemon/daemon_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package daemon linux version 6 | package daemon 7 | 8 | import ( 9 | "os" 10 | ) 11 | 12 | // Get the daemon properly 13 | func newDaemon(name, description string, dependencies []string) (Daemon, error) { 14 | // newer subsystem must be checked first 15 | if _, err := os.Stat("/run/systemd/system"); err == nil { 16 | return &systemDRecord{name, description, dependencies}, nil 17 | } 18 | if _, err := os.Stat("/sbin/initctl"); err == nil { 19 | return &upstartRecord{name, description, dependencies}, nil 20 | } 21 | return &systemVRecord{name, description, dependencies}, nil 22 | } 23 | 24 | // Get executable path 25 | func execPath() (string, error) { 26 | return os.Readlink("/proc/self/exe") 27 | } 28 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | **NOTE**: the primary maintainer(s) may be found in 4 | [./MAINTAINERS.md](./MAINTAINERS.md). 5 | 6 | Feel free to put up a pull request to fix a bug or maybe add a feature. I will 7 | give it a code review and make sure that it does not break backwards 8 | compatibility. If I or any other collaborators agree that it is in line with 9 | the vision of the project, we will work with you to get the code into 10 | a mergeable state and merge it into the master branch. 11 | 12 | If you have contributed something significant to the project, we will most 13 | likely add you as a collaborator. As a collaborator you are given the ability 14 | to merge others pull requests. It is very important that new code does not 15 | break existing code, so be careful about what code you do choose to merge. 16 | 17 | If you feel like you have contributed to the project but have not yet been added 18 | as a collaborator, we probably forgot to add you :sweat_smile:. Please open an 19 | issue! 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jeremy Saenz & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | - @meatballhat 2 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2016 4 | 5 | image: Visual Studio 2017 6 | 7 | clone_folder: c:\gopath\src\github.com\urfave\cli 8 | 9 | environment: 10 | GOPATH: C:\gopath 11 | GOVERSION: 1.8.x 12 | PYTHON: C:\Python36-x64 13 | PYTHON_VERSION: 3.6.x 14 | PYTHON_ARCH: 64 15 | 16 | install: 17 | - set PATH=%GOPATH%\bin;C:\go\bin;%PATH% 18 | - go version 19 | - go env 20 | - go get github.com/urfave/gfmrun/... 21 | - go get -v -t ./... 22 | 23 | build_script: 24 | - python runtests vet 25 | - python runtests test 26 | - python runtests gfmrun 27 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/category.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | // CommandCategories is a slice of *CommandCategory. 4 | type CommandCategories []*CommandCategory 5 | 6 | // CommandCategory is a category containing commands. 7 | type CommandCategory struct { 8 | Name string 9 | Commands Commands 10 | } 11 | 12 | func (c CommandCategories) Less(i, j int) bool { 13 | return lexicographicLess(c[i].Name, c[j].Name) 14 | } 15 | 16 | func (c CommandCategories) Len() int { 17 | return len(c) 18 | } 19 | 20 | func (c CommandCategories) Swap(i, j int) { 21 | c[i], c[j] = c[j], c[i] 22 | } 23 | 24 | // AddCommand adds a command to a category. 25 | func (c CommandCategories) AddCommand(category string, command Command) CommandCategories { 26 | for _, commandCategory := range c { 27 | if commandCategory.Name == category { 28 | commandCategory.Commands = append(commandCategory.Commands, command) 29 | return c 30 | } 31 | } 32 | return append(c, &CommandCategory{Name: category, Commands: []Command{command}}) 33 | } 34 | 35 | // VisibleCommands returns a slice of the Commands with Hidden=false 36 | func (c *CommandCategory) VisibleCommands() []Command { 37 | ret := []Command{} 38 | for _, command := range c.Commands { 39 | if !command.Hidden { 40 | ret = append(ret, command) 41 | } 42 | } 43 | return ret 44 | } 45 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // return nil 16 | // } 17 | // 18 | // app.Run(os.Args) 19 | // } 20 | package cli 21 | 22 | //go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go 23 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/helpers_test.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "os" 5 | "reflect" 6 | "runtime" 7 | "strings" 8 | "testing" 9 | ) 10 | 11 | var ( 12 | wd, _ = os.Getwd() 13 | ) 14 | 15 | func expect(t *testing.T, a interface{}, b interface{}) { 16 | _, fn, line, _ := runtime.Caller(1) 17 | fn = strings.Replace(fn, wd+"/", "", -1) 18 | 19 | if !reflect.DeepEqual(a, b) { 20 | t.Errorf("(%s:%d) Expected %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a)) 21 | } 22 | } 23 | 24 | func refute(t *testing.T, a interface{}, b interface{}) { 25 | if reflect.DeepEqual(a, b) { 26 | t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/helpers_unix_test.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 2 | 3 | package cli 4 | 5 | import "os" 6 | 7 | func clearenv() { 8 | os.Clearenv() 9 | } 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/helpers_windows_test.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | ) 7 | 8 | // os.Clearenv() doesn't actually unset variables on Windows 9 | // See: https://github.com/golang/go/issues/17902 10 | func clearenv() { 11 | for _, s := range os.Environ() { 12 | for j := 1; j < len(s); j++ { 13 | if s[j] == '=' { 14 | keyp, _ := syscall.UTF16PtrFromString(s[0:j]) 15 | syscall.SetEnvironmentVariable(keyp, nil) 16 | break 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/sort.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import "unicode" 4 | 5 | // lexicographicLess compares strings alphabetically considering case. 6 | func lexicographicLess(i, j string) bool { 7 | iRunes := []rune(i) 8 | jRunes := []rune(j) 9 | 10 | lenShared := len(iRunes) 11 | if lenShared > len(jRunes) { 12 | lenShared = len(jRunes) 13 | } 14 | 15 | for index := 0; index < lenShared; index++ { 16 | ir := iRunes[index] 17 | jr := jRunes[index] 18 | 19 | if lir, ljr := unicode.ToLower(ir), unicode.ToLower(jr); lir != ljr { 20 | return lir < ljr 21 | } 22 | 23 | if ir != jr { 24 | return ir < jr 25 | } 26 | } 27 | 28 | return i < j 29 | } 30 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/github.com/urfave/cli/sort_test.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import "testing" 4 | 5 | var lexicographicLessTests = []struct { 6 | i string 7 | j string 8 | expected bool 9 | }{ 10 | {"", "a", true}, 11 | {"a", "", false}, 12 | {"a", "a", false}, 13 | {"a", "A", false}, 14 | {"A", "a", true}, 15 | {"aa", "a", false}, 16 | {"a", "aa", true}, 17 | {"a", "b", true}, 18 | {"a", "B", true}, 19 | {"A", "b", true}, 20 | {"A", "B", true}, 21 | } 22 | 23 | func TestLexicographicLess(t *testing.T) { 24 | for _, test := range lexicographicLessTests { 25 | actual := lexicographicLess(test.i, test.j) 26 | if test.expected != actual { 27 | t.Errorf(`expected string "%s" to come before "%s"`, test.i, test.j) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/net/context/withtimeout_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // This example passes a context with a timeout to tell a blocking function that 15 | // it should abandon its work after the timeout elapses. 16 | func ExampleWithTimeout() { 17 | // Pass a context with a timeout to tell a blocking function that it 18 | // should abandon its work after the timeout elapses. 19 | ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) 20 | defer cancel() 21 | 22 | select { 23 | case <-time.After(1 * time.Second): 24 | fmt.Println("overslept") 25 | case <-ctx.Done(): 26 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 27 | } 28 | 29 | // Output: 30 | // context deadline exceeded 31 | } 32 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/dirent.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 darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/example_test.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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix_test 8 | 9 | import ( 10 | "log" 11 | "os" 12 | 13 | "golang.org/x/sys/unix" 14 | ) 15 | 16 | func ExampleExec() { 17 | err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ()) 18 | log.Fatal(err) 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/export_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | var Itoa = itoa 10 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 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 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | uintptr_t 35 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 36 | { 37 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 38 | } 39 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/ioctl.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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/syscall_darwin_test.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 unix_test 6 | 7 | // stringsFromByteSlice converts a sequence of attributes to a []string. 8 | // On Darwin, each entry is a NULL-terminated string. 9 | func stringsFromByteSlice(buf []byte) []string { 10 | var result []string 11 | off := 0 12 | for i, b := range buf { 13 | if b == 0 { 14 | result = append(result, string(buf[off:i])) 15 | off = i + 1 16 | } 17 | } 18 | return result 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/syscall_netbsd_test.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 unix_test 6 | 7 | // stringsFromByteSlice converts a sequence of attributes to a []string. 8 | // On NetBSD, each entry consists of a single byte containing the length 9 | // of the attribute name, followed by the attribute name. 10 | // The name is _not_ NULL-terminated. 11 | func stringsFromByteSlice(buf []byte) []string { 12 | var result []string 13 | i := 0 14 | for i < len(buf) { 15 | next := i + 1 + int(buf[i]) 16 | result = append(result, string(buf[i+1:next])) 17 | i = next 18 | } 19 | return result 20 | } 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/syscall_openbsd_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,openbsd 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 = int16(mode) 20 | k.Flags = uint16(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 (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.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 arm,openbsd 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 = int16(mode) 20 | k.Flags = uint16(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 (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/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 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 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/time/rate/rate_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package rate 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // Wait is shorthand for WaitN(ctx, 1). 12 | func (lim *Limiter) Wait(ctx context.Context) (err error) { 13 | return lim.waitN(ctx, 1) 14 | } 15 | 16 | // WaitN blocks until lim permits n events to happen. 17 | // It returns an error if n exceeds the Limiter's burst size, the Context is 18 | // canceled, or the expected wait time exceeds the Context's Deadline. 19 | func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { 20 | return lim.waitN(ctx, n) 21 | } 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/golang.org/x/time/rate/rate_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package rate 8 | 9 | import "context" 10 | 11 | // Wait is shorthand for WaitN(ctx, 1). 12 | func (lim *Limiter) Wait(ctx context.Context) (err error) { 13 | return lim.waitN(ctx, 1) 14 | } 15 | 16 | // WaitN blocks until lim permits n events to happen. 17 | // It returns an error if n exceeds the Limiter's burst size, the Context is 18 | // canceled, or the expected wait time exceeds the Context's Deadline. 19 | func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { 20 | return lim.waitN(ctx, n) 21 | } 22 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/check.v1/README.md: -------------------------------------------------------------------------------- 1 | Instructions 2 | ============ 3 | 4 | Install the package with: 5 | 6 | go get gopkg.in/check.v1 7 | 8 | Import it with: 9 | 10 | import "gopkg.in/check.v1" 11 | 12 | and use _check_ as the package name inside the code. 13 | 14 | For more details, visit the project page: 15 | 16 | * http://labix.org/gocheck 17 | 18 | and the API documentation: 19 | 20 | * https://gopkg.in/check.v1 21 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/check.v1/TODO: -------------------------------------------------------------------------------- 1 | - Assert(slice, Contains, item) 2 | - Parallel test support 3 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/check.v1/export_test.go: -------------------------------------------------------------------------------- 1 | package check 2 | 3 | import "io" 4 | 5 | func PrintLine(filename string, line int) (string, error) { 6 | return printLine(filename, line) 7 | } 8 | 9 | func Indent(s, with string) string { 10 | return indent(s, with) 11 | } 12 | 13 | func NewOutputWriter(writer io.Writer, stream, verbose bool) *outputWriter { 14 | return newOutputWriter(writer, stream, verbose) 15 | } 16 | 17 | func (c *C) FakeSkip(reason string) { 18 | c.reason = reason 19 | } 20 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet coverage 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | 14 | coverage: 15 | go test -coverprofile=c.out && go tool cover -html=c.out && rm c.out 16 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/ini_internal_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "testing" 19 | 20 | . "github.com/smartystreets/goconvey/convey" 21 | ) 22 | 23 | func Test_Version(t *testing.T) { 24 | Convey("Get version", t, func() { 25 | So(Version(), ShouldEqual, _VERSION) 26 | }) 27 | } 28 | 29 | func Test_isSlice(t *testing.T) { 30 | Convey("Check if a string is in the slice", t, func() { 31 | ss := []string{"a", "b", "c"} 32 | So(inSlice("a", ss), ShouldBeTrue) 33 | So(inSlice("d", ss), ShouldBeFalse) 34 | }) 35 | } 36 | -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/UTF-16-BE-BOM.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idcos/osinstall-server/869e9994a4bb1dcf2b57e6d01a7464c5bb885e75/src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/UTF-16-BE-BOM.ini -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/UTF-16-LE-BOM.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idcos/osinstall-server/869e9994a4bb1dcf2b57e6d01a7464c5bb885e75/src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/UTF-16-LE-BOM.ini -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/UTF-8-BOM.ini: -------------------------------------------------------------------------------- 1 | [author] 2 | E-MAIL = example@email.com -------------------------------------------------------------------------------- /src/idcos.io/osinstall/vendor/gopkg.in/ini.v1/testdata/minimal.ini: -------------------------------------------------------------------------------- 1 | [author] 2 | E-MAIL = u@gogs.io --------------------------------------------------------------------------------