├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── cfg ├── config.go └── environment.go ├── correlation └── manager.go ├── cortex.yaml ├── go.mod ├── go.sum ├── main.go ├── project.toml ├── renderer └── chrome.go ├── storage ├── encrypted_disk.go ├── memory.go ├── s3.go ├── s3__test.go └── storage.go ├── vendor ├── .DS_Store ├── github.com │ ├── .DS_Store │ ├── aws │ │ ├── .DS_Store │ │ └── aws-sdk-go │ │ │ ├── .DS_Store │ │ │ ├── LICENSE.txt │ │ │ ├── NOTICE.txt │ │ │ ├── aws │ │ │ ├── arn │ │ │ │ └── arn.go │ │ │ ├── awserr │ │ │ │ ├── error.go │ │ │ │ └── types.go │ │ │ ├── awsutil │ │ │ │ ├── copy.go │ │ │ │ ├── equal.go │ │ │ │ ├── path_value.go │ │ │ │ ├── prettify.go │ │ │ │ └── string_value.go │ │ │ ├── client │ │ │ │ ├── client.go │ │ │ │ ├── default_retryer.go │ │ │ │ ├── logger.go │ │ │ │ ├── metadata │ │ │ │ │ └── client_info.go │ │ │ │ └── no_op_retryer.go │ │ │ ├── config.go │ │ │ ├── context_1_5.go │ │ │ ├── context_1_9.go │ │ │ ├── context_background_1_5.go │ │ │ ├── context_background_1_7.go │ │ │ ├── context_sleep.go │ │ │ ├── convert_types.go │ │ │ ├── corehandlers │ │ │ │ ├── handlers.go │ │ │ │ ├── param_validator.go │ │ │ │ └── user_agent.go │ │ │ ├── credentials │ │ │ │ ├── chain_provider.go │ │ │ │ ├── context_background_go1.5.go │ │ │ │ ├── context_background_go1.7.go │ │ │ │ ├── context_go1.5.go │ │ │ │ ├── context_go1.9.go │ │ │ │ ├── credentials.go │ │ │ │ ├── ec2rolecreds │ │ │ │ │ └── ec2_role_provider.go │ │ │ │ ├── endpointcreds │ │ │ │ │ └── provider.go │ │ │ │ ├── env_provider.go │ │ │ │ ├── example.ini │ │ │ │ ├── processcreds │ │ │ │ │ └── provider.go │ │ │ │ ├── shared_credentials_provider.go │ │ │ │ ├── static_provider.go │ │ │ │ └── stscreds │ │ │ │ │ ├── assume_role_provider.go │ │ │ │ │ └── web_identity_provider.go │ │ │ ├── csm │ │ │ │ ├── doc.go │ │ │ │ ├── enable.go │ │ │ │ ├── metric.go │ │ │ │ ├── metric_chan.go │ │ │ │ ├── metric_exception.go │ │ │ │ └── reporter.go │ │ │ ├── defaults │ │ │ │ ├── defaults.go │ │ │ │ └── shared_config.go │ │ │ ├── doc.go │ │ │ ├── ec2metadata │ │ │ │ ├── api.go │ │ │ │ ├── service.go │ │ │ │ └── token_provider.go │ │ │ ├── endpoints │ │ │ │ ├── decode.go │ │ │ │ ├── defaults.go │ │ │ │ ├── dep_service_ids.go │ │ │ │ ├── doc.go │ │ │ │ ├── endpoints.go │ │ │ │ ├── legacy_regions.go │ │ │ │ ├── v3model.go │ │ │ │ └── v3model_codegen.go │ │ │ ├── errors.go │ │ │ ├── jsonvalue.go │ │ │ ├── logger.go │ │ │ ├── request │ │ │ │ ├── connection_reset_error.go │ │ │ │ ├── handlers.go │ │ │ │ ├── http_request.go │ │ │ │ ├── offset_reader.go │ │ │ │ ├── request.go │ │ │ │ ├── request_1_7.go │ │ │ │ ├── request_1_8.go │ │ │ │ ├── request_context.go │ │ │ │ ├── request_context_1_6.go │ │ │ │ ├── request_pagination.go │ │ │ │ ├── retryer.go │ │ │ │ ├── timeout_read_closer.go │ │ │ │ ├── validation.go │ │ │ │ └── waiter.go │ │ │ ├── session │ │ │ │ ├── cabundle_transport.go │ │ │ │ ├── cabundle_transport_1_5.go │ │ │ │ ├── cabundle_transport_1_6.go │ │ │ │ ├── credentials.go │ │ │ │ ├── doc.go │ │ │ │ ├── env_config.go │ │ │ │ ├── session.go │ │ │ │ └── shared_config.go │ │ │ ├── signer │ │ │ │ └── v4 │ │ │ │ │ ├── header_rules.go │ │ │ │ │ ├── options.go │ │ │ │ │ ├── request_context_go1.5.go │ │ │ │ │ ├── request_context_go1.7.go │ │ │ │ │ ├── stream.go │ │ │ │ │ ├── uri_path.go │ │ │ │ │ └── v4.go │ │ │ ├── types.go │ │ │ ├── url.go │ │ │ ├── url_1_7.go │ │ │ └── version.go │ │ │ ├── internal │ │ │ ├── context │ │ │ │ └── background_go1.5.go │ │ │ ├── ini │ │ │ │ ├── ast.go │ │ │ │ ├── comma_token.go │ │ │ │ ├── comment_token.go │ │ │ │ ├── doc.go │ │ │ │ ├── empty_token.go │ │ │ │ ├── expression.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── ini.go │ │ │ │ ├── ini_lexer.go │ │ │ │ ├── ini_parser.go │ │ │ │ ├── literal_tokens.go │ │ │ │ ├── newline_token.go │ │ │ │ ├── number_helper.go │ │ │ │ ├── op_tokens.go │ │ │ │ ├── parse_error.go │ │ │ │ ├── parse_stack.go │ │ │ │ ├── sep_tokens.go │ │ │ │ ├── skipper.go │ │ │ │ ├── statement.go │ │ │ │ ├── value_util.go │ │ │ │ ├── visitor.go │ │ │ │ ├── walker.go │ │ │ │ └── ws_token.go │ │ │ ├── s3err │ │ │ │ └── error.go │ │ │ ├── sdkio │ │ │ │ ├── byte.go │ │ │ │ ├── io_go1.6.go │ │ │ │ └── io_go1.7.go │ │ │ ├── sdkmath │ │ │ │ ├── floor.go │ │ │ │ └── floor_go1.9.go │ │ │ ├── sdkrand │ │ │ │ ├── locked_source.go │ │ │ │ ├── read.go │ │ │ │ └── read_1_5.go │ │ │ ├── sdkuri │ │ │ │ └── path.go │ │ │ ├── shareddefaults │ │ │ │ ├── ecs_container.go │ │ │ │ └── shared_config.go │ │ │ ├── strings │ │ │ │ └── strings.go │ │ │ └── sync │ │ │ │ └── singleflight │ │ │ │ ├── LICENSE │ │ │ │ └── singleflight.go │ │ │ ├── private │ │ │ └── protocol │ │ │ │ ├── eventstream │ │ │ │ ├── debug.go │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── error.go │ │ │ │ ├── eventstreamapi │ │ │ │ │ ├── error.go │ │ │ │ │ ├── reader.go │ │ │ │ │ ├── shared.go │ │ │ │ │ ├── signer.go │ │ │ │ │ ├── stream_writer.go │ │ │ │ │ └── writer.go │ │ │ │ ├── header.go │ │ │ │ ├── header_value.go │ │ │ │ └── message.go │ │ │ │ ├── host.go │ │ │ │ ├── host_prefix.go │ │ │ │ ├── idempotency.go │ │ │ │ ├── json │ │ │ │ └── jsonutil │ │ │ │ │ ├── build.go │ │ │ │ │ └── unmarshal.go │ │ │ │ ├── jsonvalue.go │ │ │ │ ├── payload.go │ │ │ │ ├── protocol.go │ │ │ │ ├── query │ │ │ │ ├── build.go │ │ │ │ ├── queryutil │ │ │ │ │ └── queryutil.go │ │ │ │ ├── unmarshal.go │ │ │ │ └── unmarshal_error.go │ │ │ │ ├── rest │ │ │ │ ├── build.go │ │ │ │ ├── payload.go │ │ │ │ └── unmarshal.go │ │ │ │ ├── restxml │ │ │ │ └── restxml.go │ │ │ │ ├── timestamp.go │ │ │ │ ├── unmarshal.go │ │ │ │ ├── unmarshal_error.go │ │ │ │ └── xml │ │ │ │ └── xmlutil │ │ │ │ ├── build.go │ │ │ │ ├── sort.go │ │ │ │ ├── unmarshal.go │ │ │ │ └── xml_to_struct.go │ │ │ └── service │ │ │ ├── s3 │ │ │ ├── api.go │ │ │ ├── body_hash.go │ │ │ ├── bucket_location.go │ │ │ ├── customizations.go │ │ │ ├── doc.go │ │ │ ├── doc_custom.go │ │ │ ├── endpoint.go │ │ │ ├── endpoint_errors.go │ │ │ ├── errors.go │ │ │ ├── host_style_bucket.go │ │ │ ├── internal │ │ │ │ └── arn │ │ │ │ │ ├── accesspoint_arn.go │ │ │ │ │ └── arn.go │ │ │ ├── platform_handlers.go │ │ │ ├── platform_handlers_go1.6.go │ │ │ ├── s3iface │ │ │ │ └── interface.go │ │ │ ├── s3manager │ │ │ │ ├── batch.go │ │ │ │ ├── bucket_region.go │ │ │ │ ├── buffered_read_seeker.go │ │ │ │ ├── default_read_seeker_write_to.go │ │ │ │ ├── default_read_seeker_write_to_windows.go │ │ │ │ ├── default_writer_read_from.go │ │ │ │ ├── default_writer_read_from_windows.go │ │ │ │ ├── doc.go │ │ │ │ ├── download.go │ │ │ │ ├── pool.go │ │ │ │ ├── read_seeker_write_to.go │ │ │ │ ├── upload.go │ │ │ │ ├── upload_input.go │ │ │ │ └── writer_read_from.go │ │ │ ├── service.go │ │ │ ├── sse.go │ │ │ ├── statusok_error.go │ │ │ ├── unmarshal_error.go │ │ │ └── waiters.go │ │ │ └── sts │ │ │ ├── api.go │ │ │ ├── customizations.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── service.go │ │ │ └── stsiface │ │ │ └── interface.go │ ├── google │ │ └── uuid │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── dce.go │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── hash.go │ │ │ ├── marshal.go │ │ │ ├── node.go │ │ │ ├── node_js.go │ │ │ ├── node_net.go │ │ │ ├── sql.go │ │ │ ├── time.go │ │ │ ├── util.go │ │ │ ├── uuid.go │ │ │ ├── version1.go │ │ │ └── version4.go │ ├── gorilla │ │ ├── mux │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── middleware.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ ├── route.go │ │ │ └── test_helpers.go │ │ └── websocket │ │ │ ├── .gitignore │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── client.go │ │ │ ├── client_clone.go │ │ │ ├── client_clone_legacy.go │ │ │ ├── compression.go │ │ │ ├── conn.go │ │ │ ├── conn_write.go │ │ │ ├── conn_write_legacy.go │ │ │ ├── doc.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── join.go │ │ │ ├── json.go │ │ │ ├── mask.go │ │ │ ├── mask_safe.go │ │ │ ├── prepared.go │ │ │ ├── proxy.go │ │ │ ├── server.go │ │ │ ├── trace.go │ │ │ ├── trace_17.go │ │ │ ├── util.go │ │ │ └── x_net_proxy.go │ ├── jmespath │ │ └── go-jmespath │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── api.go │ │ │ ├── astnodetype_string.go │ │ │ ├── functions.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── interpreter.go │ │ │ ├── lexer.go │ │ │ ├── parser.go │ │ │ ├── toktype_string.go │ │ │ └── util.go │ ├── konsorten │ │ └── go-windows-terminal-sequences │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.mod │ │ │ └── sequences.go │ ├── mafredri │ │ └── cdp │ │ │ ├── .codecov.yml │ │ │ ├── .editorconfig │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cdp.go │ │ │ ├── cdp_client.go │ │ │ ├── cdp_client_io_stream_reader.go │ │ │ ├── devtool │ │ │ ├── devtool.go │ │ │ ├── doc.go │ │ │ └── headless.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── internal │ │ │ └── errors │ │ │ │ └── errors.go │ │ │ ├── protocol │ │ │ ├── accessibility │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── animation │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── applicationcache │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── audits │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── backgroundservice │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── browser │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── cachestorage │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── cast │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── console │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── css │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── database │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── debugger │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── deviceorientation │ │ │ │ ├── command.go │ │ │ │ └── domain.go │ │ │ ├── dom │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── domdebugger │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── domsnapshot │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── domstorage │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── emulation │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── fetch │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── headlessexperimental │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── heapprofiler │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── indexeddb │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── input │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── inspector │ │ │ │ ├── domain.go │ │ │ │ └── event.go │ │ │ ├── internal │ │ │ │ ├── browser.go │ │ │ │ ├── error.go │ │ │ │ ├── network.go │ │ │ │ └── page.go │ │ │ ├── io │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── stream_reader.go │ │ │ │ └── types.go │ │ │ ├── layertree │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── log │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── media │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── memory │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── network │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ ├── types.go │ │ │ │ └── util.go │ │ │ ├── overlay │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── page │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── performance │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── profiler │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── runtime │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ ├── types.go │ │ │ │ └── util.go │ │ │ ├── schema │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── security │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── serviceworker │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── storage │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── systeminfo │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── target │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── tethering │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── event.go │ │ │ ├── tracing │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ ├── webaudio │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ ├── event.go │ │ │ │ └── types.go │ │ │ └── webauthn │ │ │ │ ├── command.go │ │ │ │ ├── domain.go │ │ │ │ └── types.go │ │ │ ├── rpcc │ │ │ ├── call.go │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── socket.go │ │ │ ├── stream.go │ │ │ └── stream_sync.go │ │ │ ├── session │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── manager.go │ │ │ └── session.go │ │ │ └── sync.go │ └── sirupsen │ │ └── logrus │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── appveyor.yml │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_check_appengine.go │ │ ├── terminal_check_bsd.go │ │ ├── terminal_check_js.go │ │ ├── terminal_check_no_terminal.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_check_solaris.go │ │ ├── terminal_check_unix.go │ │ ├── terminal_check_windows.go │ │ ├── text_formatter.go │ │ └── writer.go ├── golang.org │ └── x │ │ └── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_freebsd_arm64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_netbsd_arm64.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mksysctl_openbsd.pl │ │ ├── openbsd_pledge.go │ │ ├── openbsd_unveil.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_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_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── timestruct.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_386.1_11.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_386.s │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm.1_11.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm.s │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_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_freebsd_arm64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go └── modules.txt └── web └── server.go /.gitignore: -------------------------------------------------------------------------------- 1 | pdf-renderer.iml 2 | debug 3 | pdf-renderer 4 | pdf-renderer_darwin_amd64 5 | pdf-renderer_linux_amd64 6 | .idea 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | COPYRIGHT (C) 2018, Rapid7 LLC, Boston, MA, USA. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | GOCMD=go 2 | GOBUILD=$(GOCMD) build -trimpath 3 | GOCLEAN=$(GOCMD) clean 4 | GOTEST=$(GOCMD) test 5 | GOGET=$(GOCMD) get 6 | BINARY_NAME=pdf-renderer 7 | 8 | all: test build 9 | build: 10 | $(GOBUILD) -o $(BINARY_NAME) -v 11 | test: 12 | $(GOTEST) -v ./... 13 | clean: 14 | $(GOCLEAN) 15 | rm -f $(BINARY_NAME) 16 | rm -f $(BINARY_LINUX) 17 | 18 | run: 19 | $(GOBUILD) -o $(BINARY_NAME) -v 20 | ./$(BINARY_NAME) 21 | 22 | build-darwin: 23 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_darwin_amd64 -v 24 | 25 | build-linux: 26 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_linux_amd64 -v 27 | -------------------------------------------------------------------------------- /cfg/config.go: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * COPYRIGHT (C) 2018, Rapid7 LLC, Boston, MA, USA. 3 | * This code is licensed under MIT license (see LICENSE for details) 4 | **************************************************************************/ 5 | package cfg 6 | 7 | import "time" 8 | 9 | const defaultKey = "JKNV29t8yYEy21TO0UzvDsX2KgiWrOVy" 10 | const defaultWebServerPort = 9766 11 | const defaultStorageStrategy = "memory" 12 | const defaultStorageDirectory = "/tmp/pdf-renderer/" 13 | const defaultCorrelationStorageDirectory = "/tmp/pdf-renderer-correlation/" 14 | const defaultCorrelationRetentionDuration = "1h" 15 | const defaultRequestPollRetries = 10 16 | const defaultRequestPollInterval = "1s" 17 | const defaultPrintDeadline = "10m" 18 | const defaultBrowserContextDeadline = "10m" 19 | 20 | type config interface { 21 | Debug() bool 22 | Key() []byte 23 | WebServerPort() int 24 | StorageStrategy() string 25 | StorageDirectory() string 26 | CorrelationStorageDirectory() string 27 | CorrelationRetentionDuration() time.Duration 28 | RequestPollRetries() int 29 | RequestPollInterval() time.Duration 30 | PrintDeadline() time.Duration 31 | BrowserContextDeadline() time.Duration 32 | S3Bucket() string 33 | } 34 | 35 | var envCfg = envConfig{} 36 | 37 | func Config() config { 38 | return &envCfg 39 | } 40 | -------------------------------------------------------------------------------- /cortex.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | info: 3 | title: Pdf Renderer 4 | description: Golang based app that will render an html page and create a pdf. 5 | x-cortex-git: 6 | github: 7 | alias: r7org 8 | repository: rapid7/pdf-renderer 9 | x-cortex-tag: pdf-renderer 10 | x-cortex-type: service 11 | x-cortex-group: 12 | - status:deprecated 13 | - target:stemcell 14 | x-cortex-domain-parents: 15 | - tag: vm-reporting 16 | openapi: 3.0.1 17 | servers: 18 | - url: "/" 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/rapid7/pdf-renderer 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/aws/aws-sdk-go v1.30.7 7 | github.com/google/uuid v1.1.1 8 | github.com/gorilla/mux v1.7.4 9 | github.com/mafredri/cdp v0.28.0 10 | github.com/sirupsen/logrus v1.5.0 11 | ) 12 | -------------------------------------------------------------------------------- /project.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "pdf-renderer" 3 | 4 | [build] 5 | builder = "docker.artifacts.corp.rapid7.com/r7buildpacks/amazonlinux2023/builder:base" 6 | 7 | [[build.buildpacks]] 8 | uri = "docker.artifacts.corp.rapid7.com/r7buildpacks/multiarch/r7buildpacks-go:latest" 9 | -------------------------------------------------------------------------------- /storage/memory.go: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * COPYRIGHT (C) 2018, Rapid7 LLC, Boston, MA, USA. 3 | * This code is licensed under MIT license (see LICENSE for details) 4 | **************************************************************************/ 5 | package storage 6 | 7 | type memory struct { 8 | fileName string 9 | data []byte 10 | } 11 | 12 | func NewMemory(filename string) *memory { 13 | return &memory{ 14 | fileName: filename, 15 | } 16 | } 17 | 18 | func (m *memory) FileName() string { 19 | return m.fileName 20 | } 21 | 22 | func (m *memory) Write(data []byte) error { 23 | m.data = append([]byte(nil), data...) 24 | 25 | return nil 26 | } 27 | 28 | func (m *memory) Read() ([]byte, error) { 29 | return m.data, nil 30 | } 31 | 32 | func (m *memory) Exists() bool { 33 | return m.data != nil 34 | } 35 | -------------------------------------------------------------------------------- /storage/storage.go: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * COPYRIGHT (C) 2018, Rapid7 LLC, Boston, MA, USA. 3 | * This code is licensed under MIT license (see LICENSE for details) 4 | **************************************************************************/ 5 | package storage 6 | 7 | import ( 8 | "errors" 9 | "os" 10 | 11 | "github.com/rapid7/pdf-renderer/cfg" 12 | ) 13 | 14 | func init() { 15 | os.MkdirAll(cfg.Config().StorageDirectory(), os.ModePerm) 16 | } 17 | 18 | type StoredFile interface { 19 | FileName() string 20 | Write(data []byte) error 21 | Read() ([]byte, error) 22 | Exists() bool 23 | } 24 | 25 | func NewStoredFile(fileName string) (StoredFile, error) { 26 | switch storageStrategy := cfg.Config().StorageStrategy(); storageStrategy { 27 | 28 | case "memory": 29 | return NewMemory(fileName), nil 30 | case "disk": 31 | return NewEncryptedFile(fileName), nil 32 | case "s3": 33 | return NewS3Object(fileName) 34 | default: 35 | return nil, errors.New("illegal storage strategy") 36 | } 37 | } 38 | 39 | func NewCorrelationFile(fileName string) (StoredFile, error) { 40 | return &encryptedFile{ 41 | filePath: cfg.Config().CorrelationStorageDirectory(), 42 | fileName: fileName, 43 | }, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/pdf-renderer/1e58b782ce13a6e2102f2228938875c039828284/vendor/.DS_Store -------------------------------------------------------------------------------- /vendor/github.com/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/pdf-renderer/1e58b782ce13a6e2102f2228938875c039828284/vendor/github.com/.DS_Store -------------------------------------------------------------------------------- /vendor/github.com/aws/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/pdf-renderer/1e58b782ce13a6e2102f2228938875c039828284/vendor/github.com/aws/.DS_Store -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/pdf-renderer/1e58b782ce13a6e2102f2228938875c039828284/vendor/github.com/aws/aws-sdk-go/.DS_Store -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS SDK for Go 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Copyright 2014-2015 Stripe, Inc. 4 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go: -------------------------------------------------------------------------------- 1 | package awsutil 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. 8 | // In addition to this, this method will also dereference the input values if 9 | // possible so the DeepEqual performed will not fail if one parameter is a 10 | // pointer and the other is not. 11 | // 12 | // DeepEqual will not perform indirection of nested values of the input parameters. 13 | func DeepEqual(a, b interface{}) bool { 14 | ra := reflect.Indirect(reflect.ValueOf(a)) 15 | rb := reflect.Indirect(reflect.ValueOf(b)) 16 | 17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { 18 | // If the elements are both nil, and of the same type they are equal 19 | // If they are of different types they are not equal 20 | return reflect.TypeOf(a) == reflect.TypeOf(b) 21 | } else if raValid != rbValid { 22 | // Both values must be valid to be equal 23 | return false 24 | } 25 | 26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | // ClientInfo wraps immutable data from the client.Client structure. 4 | type ClientInfo struct { 5 | ServiceName string 6 | ServiceID string 7 | APIVersion string 8 | PartitionID string 9 | Endpoint string 10 | SigningName string 11 | SigningRegion string 12 | JSONVersion string 13 | TargetPrefix string 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/aws/aws-sdk-go/aws/request" 7 | ) 8 | 9 | // NoOpRetryer provides a retryer that performs no retries. 10 | // It should be used when we do not want retries to be performed. 11 | type NoOpRetryer struct{} 12 | 13 | // MaxRetries returns the number of maximum returns the service will use to make 14 | // an individual API; For NoOpRetryer the MaxRetries will always be zero. 15 | func (d NoOpRetryer) MaxRetries() int { 16 | return 0 17 | } 18 | 19 | // ShouldRetry will always return false for NoOpRetryer, as it should never retry. 20 | func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { 21 | return false 22 | } 23 | 24 | // RetryRules returns the delay duration before retrying this request again; 25 | // since NoOpRetryer does not retry, RetryRules always returns 0. 26 | func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { 27 | return 0 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package aws 4 | 5 | import "context" 6 | 7 | // Context is an alias of the Go stdlib's context.Context interface. 8 | // It can be used within the SDK's API operation "WithContext" methods. 9 | // 10 | // See https://golang.org/pkg/context on how to use contexts. 11 | type Context = context.Context 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package aws 4 | 5 | import ( 6 | "github.com/aws/aws-sdk-go/internal/context" 7 | ) 8 | 9 | // BackgroundContext returns a context that will never be canceled, has no 10 | // values, and no deadline. This context is used by the SDK to provide 11 | // backwards compatibility with non-context API operations and functionality. 12 | // 13 | // Go 1.6 and before: 14 | // This context function is equivalent to context.Background in the Go stdlib. 15 | // 16 | // Go 1.7 and later: 17 | // The context returned will be the value returned by context.Background() 18 | // 19 | // See https://golang.org/pkg/context for more information on Contexts. 20 | func BackgroundContext() Context { 21 | return context.BackgroundCtx 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package aws 4 | 5 | import "context" 6 | 7 | // BackgroundContext returns a context that will never be canceled, has no 8 | // values, and no deadline. This context is used by the SDK to provide 9 | // backwards compatibility with non-context API operations and functionality. 10 | // 11 | // Go 1.6 and before: 12 | // This context function is equivalent to context.Background in the Go stdlib. 13 | // 14 | // Go 1.7 and later: 15 | // The context returned will be the value returned by context.Background() 16 | // 17 | // See https://golang.org/pkg/context for more information on Contexts. 18 | func BackgroundContext() Context { 19 | return context.Background() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // SleepWithContext will wait for the timer duration to expire, or the context 8 | // is canceled. Which ever happens first. If the context is canceled the Context's 9 | // error will be returned. 10 | // 11 | // Expects Context to always return a non-nil error if the Done channel is closed. 12 | func SleepWithContext(ctx Context, dur time.Duration) error { 13 | t := time.NewTimer(dur) 14 | defer t.Stop() 15 | 16 | select { 17 | case <-t.C: 18 | break 19 | case <-ctx.Done(): 20 | return ctx.Err() 21 | } 22 | 23 | return nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | // ValidateParametersHandler is a request handler to validate the input parameters. 6 | // Validating parameters only has meaning if done prior to the request being sent. 7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { 8 | if !r.ParamsFilled() { 9 | return 10 | } 11 | 12 | if v, ok := r.Params.(request.Validator); ok { 13 | if err := v.Validate(); err != nil { 14 | r.Error = err 15 | } 16 | } 17 | }} 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/aws/aws-sdk-go/aws" 8 | "github.com/aws/aws-sdk-go/aws/request" 9 | ) 10 | 11 | // SDKVersionUserAgentHandler is a request handler for adding the SDK Version 12 | // to the user agent. 13 | var SDKVersionUserAgentHandler = request.NamedHandler{ 14 | Name: "core.SDKVersionUserAgentHandler", 15 | Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, 16 | runtime.Version(), runtime.GOOS, runtime.GOARCH), 17 | } 18 | 19 | const execEnvVar = `AWS_EXECUTION_ENV` 20 | const execEnvUAKey = `exec-env` 21 | 22 | // AddHostExecEnvUserAgentHander is a request handler appending the SDK's 23 | // execution environment to the user agent. 24 | // 25 | // If the environment variable AWS_EXECUTION_ENV is set, its value will be 26 | // appended to the user agent string. 27 | var AddHostExecEnvUserAgentHander = request.NamedHandler{ 28 | Name: "core.AddHostExecEnvUserAgentHander", 29 | Fn: func(r *request.Request) { 30 | v := os.Getenv(execEnvVar) 31 | if len(v) == 0 { 32 | return 33 | } 34 | 35 | request.AddToUserAgent(r, execEnvUAKey+"/"+v) 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package credentials 4 | 5 | import ( 6 | "github.com/aws/aws-sdk-go/internal/context" 7 | ) 8 | 9 | // backgroundContext returns a context that will never be canceled, has no 10 | // values, and no deadline. This context is used by the SDK to provide 11 | // backwards compatibility with non-context API operations and functionality. 12 | // 13 | // Go 1.6 and before: 14 | // This context function is equivalent to context.Background in the Go stdlib. 15 | // 16 | // Go 1.7 and later: 17 | // The context returned will be the value returned by context.Background() 18 | // 19 | // See https://golang.org/pkg/context for more information on Contexts. 20 | func backgroundContext() Context { 21 | return context.BackgroundCtx 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package credentials 4 | 5 | import "context" 6 | 7 | // backgroundContext returns a context that will never be canceled, has no 8 | // values, and no deadline. This context is used by the SDK to provide 9 | // backwards compatibility with non-context API operations and functionality. 10 | // 11 | // Go 1.6 and before: 12 | // This context function is equivalent to context.Background in the Go stdlib. 13 | // 14 | // Go 1.7 and later: 15 | // The context returned will be the value returned by context.Background() 16 | // 17 | // See https://golang.org/pkg/context for more information on Contexts. 18 | func backgroundContext() Context { 19 | return context.Background() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package credentials 4 | 5 | import "context" 6 | 7 | // Context is an alias of the Go stdlib's context.Context interface. 8 | // It can be used within the SDK's API operation "WithContext" methods. 9 | // 10 | // This type, aws.Context, and context.Context are equivalent. 11 | // 12 | // See https://golang.org/pkg/context on how to use contexts. 13 | type Context = context.Context 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini: -------------------------------------------------------------------------------- 1 | [default] 2 | aws_access_key_id = accessKey 3 | aws_secret_access_key = secret 4 | aws_session_token = token 5 | 6 | [no_token] 7 | aws_access_key_id = accessKey 8 | aws_secret_access_key = secret 9 | 10 | [with_colon] 11 | aws_access_key_id: accessKey 12 | aws_secret_access_key: secret 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go: -------------------------------------------------------------------------------- 1 | package csm 2 | 3 | import ( 4 | "sync/atomic" 5 | ) 6 | 7 | const ( 8 | runningEnum = iota 9 | pausedEnum 10 | ) 11 | 12 | var ( 13 | // MetricsChannelSize of metrics to hold in the channel 14 | MetricsChannelSize = 100 15 | ) 16 | 17 | type metricChan struct { 18 | ch chan metric 19 | paused *int64 20 | } 21 | 22 | func newMetricChan(size int) metricChan { 23 | return metricChan{ 24 | ch: make(chan metric, size), 25 | paused: new(int64), 26 | } 27 | } 28 | 29 | func (ch *metricChan) Pause() { 30 | atomic.StoreInt64(ch.paused, pausedEnum) 31 | } 32 | 33 | func (ch *metricChan) Continue() { 34 | atomic.StoreInt64(ch.paused, runningEnum) 35 | } 36 | 37 | func (ch *metricChan) IsPaused() bool { 38 | v := atomic.LoadInt64(ch.paused) 39 | return v == pausedEnum 40 | } 41 | 42 | // Push will push metrics to the metric channel if the channel 43 | // is not paused 44 | func (ch *metricChan) Push(m metric) bool { 45 | if ch.IsPaused() { 46 | return false 47 | } 48 | 49 | select { 50 | case ch.ch <- m: 51 | return true 52 | default: 53 | return false 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go: -------------------------------------------------------------------------------- 1 | package csm 2 | 3 | type metricException interface { 4 | Exception() string 5 | Message() string 6 | } 7 | 8 | type requestException struct { 9 | exception string 10 | message string 11 | } 12 | 13 | func (e requestException) Exception() string { 14 | return e.exception 15 | } 16 | func (e requestException) Message() string { 17 | return e.message 18 | } 19 | 20 | type awsException struct { 21 | requestException 22 | } 23 | 24 | type sdkException struct { 25 | requestException 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/internal/shareddefaults" 5 | ) 6 | 7 | // SharedCredentialsFilename returns the SDK's default file path 8 | // for the shared credentials file. 9 | // 10 | // Builds the shared config file path based on the OS's platform. 11 | // 12 | // - Linux/Unix: $HOME/.aws/credentials 13 | // - Windows: %USERPROFILE%\.aws\credentials 14 | func SharedCredentialsFilename() string { 15 | return shareddefaults.SharedCredentialsFilename() 16 | } 17 | 18 | // SharedConfigFilename returns the SDK's default file path for 19 | // the shared config file. 20 | // 21 | // Builds the shared config file path based on the OS's platform. 22 | // 23 | // - Linux/Unix: $HOME/.aws/config 24 | // - Windows: %USERPROFILE%\.aws\config 25 | func SharedConfigFilename() string { 26 | return shareddefaults.SharedConfigFilename() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | var legacyGlobalRegions = map[string]map[string]struct{}{ 4 | "sts": { 5 | "ap-northeast-1": {}, 6 | "ap-south-1": {}, 7 | "ap-southeast-1": {}, 8 | "ap-southeast-2": {}, 9 | "ca-central-1": {}, 10 | "eu-central-1": {}, 11 | "eu-north-1": {}, 12 | "eu-west-1": {}, 13 | "eu-west-2": {}, 14 | "eu-west-3": {}, 15 | "sa-east-1": {}, 16 | "us-east-1": {}, 17 | "us-east-2": {}, 18 | "us-west-1": {}, 19 | "us-west-2": {}, 20 | }, 21 | "s3": { 22 | "us-east-1": {}, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/errors.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import "github.com/aws/aws-sdk-go/aws/awserr" 4 | 5 | var ( 6 | // ErrMissingRegion is an error that is returned if region configuration is 7 | // not found. 8 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) 9 | 10 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be 11 | // resolved for a service. 12 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | // JSONValue is a representation of a grab bag type that will be marshaled 4 | // into a json string. This type can be used just like any other map. 5 | // 6 | // Example: 7 | // 8 | // values := aws.JSONValue{ 9 | // "Foo": "Bar", 10 | // } 11 | // values["Baz"] = "Qux" 12 | type JSONValue map[string]interface{} 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | func isErrConnectionReset(err error) bool { 8 | if strings.Contains(err.Error(), "read: connection reset") { 9 | return false 10 | } 11 | 12 | if strings.Contains(err.Error(), "connection reset") || 13 | strings.Contains(err.Error(), "broken pipe") { 14 | return true 15 | } 16 | 17 | return false 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | ) 8 | 9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { 10 | req := new(http.Request) 11 | *req = *r 12 | req.URL = &url.URL{} 13 | *req.URL = *r.URL 14 | req.Body = body 15 | 16 | req.Header = http.Header{} 17 | for k, v := range r.Header { 18 | for _, vv := range v { 19 | req.Header.Add(k, vv) 20 | } 21 | } 22 | 23 | return req 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package request 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | ) 10 | 11 | // NoBody is a http.NoBody reader instructing Go HTTP client to not include 12 | // and body in the HTTP request. 13 | var NoBody = http.NoBody 14 | 15 | // ResetBody rewinds the request body back to its starting position, and 16 | // sets the HTTP Request body reference. When the body is read prior 17 | // to being sent in the HTTP request it will need to be rewound. 18 | // 19 | // ResetBody will automatically be called by the SDK's build handler, but if 20 | // the request is being used directly ResetBody must be called before the request 21 | // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically 22 | // call ResetBody. 23 | // 24 | // Will also set the Go 1.8's http.Request.GetBody member to allow retrying 25 | // PUT/POST redirects. 26 | func (r *Request) ResetBody() { 27 | body, err := r.getNextRequestBody() 28 | if err != nil { 29 | r.Error = awserr.New(ErrCodeSerialization, 30 | "failed to reset request body", err) 31 | return 32 | } 33 | 34 | r.HTTPRequest.Body = body 35 | r.HTTPRequest.GetBody = r.getNextRequestBody 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest = r.HTTPRequest.WithContext(ctx) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest.Cancel = ctx.Done() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package session 4 | 5 | import ( 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | // Transport that should be used when a custom CA bundle is specified with the 12 | // SDK. 13 | func getCABundleTransport() *http.Transport { 14 | return &http.Transport{ 15 | Proxy: http.ProxyFromEnvironment, 16 | DialContext: (&net.Dialer{ 17 | Timeout: 30 * time.Second, 18 | KeepAlive: 30 * time.Second, 19 | DualStack: true, 20 | }).DialContext, 21 | MaxIdleConns: 100, 22 | IdleConnTimeout: 90 * time.Second, 23 | TLSHandshakeTimeout: 10 * time.Second, 24 | ExpectContinueTimeout: 1 * time.Second, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6,go1.5 2 | 3 | package session 4 | 5 | import ( 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | // Transport that should be used when a custom CA bundle is specified with the 12 | // SDK. 13 | func getCABundleTransport() *http.Transport { 14 | return &http.Transport{ 15 | Proxy: http.ProxyFromEnvironment, 16 | Dial: (&net.Dialer{ 17 | Timeout: 30 * time.Second, 18 | KeepAlive: 30 * time.Second, 19 | }).Dial, 20 | TLSHandshakeTimeout: 10 * time.Second, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7,go1.6 2 | 3 | package session 4 | 5 | import ( 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | // Transport that should be used when a custom CA bundle is specified with the 12 | // SDK. 13 | func getCABundleTransport() *http.Transport { 14 | return &http.Transport{ 15 | Proxy: http.ProxyFromEnvironment, 16 | Dial: (&net.Dialer{ 17 | Timeout: 30 * time.Second, 18 | KeepAlive: 30 * time.Second, 19 | }).Dial, 20 | TLSHandshakeTimeout: 10 * time.Second, 21 | ExpectContinueTimeout: 1 * time.Second, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go: -------------------------------------------------------------------------------- 1 | package v4 2 | 3 | // WithUnsignedPayload will enable and set the UnsignedPayload field to 4 | // true of the signer. 5 | func WithUnsignedPayload(v4 *Signer) { 6 | v4.UnsignedPayload = true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package v4 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/aws/aws-sdk-go/aws" 9 | ) 10 | 11 | func requestContext(r *http.Request) aws.Context { 12 | return aws.BackgroundContext() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package v4 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/aws/aws-sdk-go/aws" 9 | ) 10 | 11 | func requestContext(r *http.Request) aws.Context { 12 | return r.Context() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package v4 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func getURIPath(u *url.URL) string { 11 | var uri string 12 | 13 | if len(u.Opaque) > 0 { 14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") 15 | } else { 16 | uri = u.EscapedPath() 17 | } 18 | 19 | if len(uri) == 0 { 20 | uri = "/" 21 | } 22 | 23 | return uri 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package aws 4 | 5 | import "net/url" 6 | 7 | // URLHostname will extract the Hostname without port from the URL value. 8 | // 9 | // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. 10 | func URLHostname(url *url.URL) string { 11 | return url.Hostname() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package aws 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | // URLHostname will extract the Hostname without port from the URL value. 11 | // 12 | // Copy of Go 1.8's net/url#URL.Hostname functionality. 13 | func URLHostname(url *url.URL) string { 14 | return stripPort(url.Host) 15 | 16 | } 17 | 18 | // stripPort is copy of Go 1.8 url#URL.Hostname functionality. 19 | // https://golang.org/src/net/url/url.go 20 | func stripPort(hostport string) string { 21 | colon := strings.IndexByte(hostport, ':') 22 | if colon == -1 { 23 | return hostport 24 | } 25 | if i := strings.IndexByte(hostport, ']'); i != -1 { 26 | return strings.TrimPrefix(hostport[:i], "[") 27 | } 28 | return hostport[:colon] 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/version.go: -------------------------------------------------------------------------------- 1 | // Package aws provides core functionality for making requests to AWS services. 2 | package aws 3 | 4 | // SDKName is the name of this AWS SDK 5 | const SDKName = "aws-sdk-go" 6 | 7 | // SDKVersion is the version of this SDK 8 | const SDKVersion = "1.30.7" 9 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package context 4 | 5 | import "time" 6 | 7 | // An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to 8 | // provide a 1.6 and 1.5 safe version of context that is compatible with Go 9 | // 1.7's Context. 10 | // 11 | // An emptyCtx is never canceled, has no values, and has no deadline. It is not 12 | // struct{}, since vars of this type must have distinct addresses. 13 | type emptyCtx int 14 | 15 | func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { 16 | return 17 | } 18 | 19 | func (*emptyCtx) Done() <-chan struct{} { 20 | return nil 21 | } 22 | 23 | func (*emptyCtx) Err() error { 24 | return nil 25 | } 26 | 27 | func (*emptyCtx) Value(key interface{}) interface{} { 28 | return nil 29 | } 30 | 31 | func (e *emptyCtx) String() string { 32 | switch e { 33 | case BackgroundCtx: 34 | return "aws.BackgroundContext" 35 | } 36 | return "unknown empty Context" 37 | } 38 | 39 | // BackgroundCtx is the common base context. 40 | var BackgroundCtx = new(emptyCtx) 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | var commaRunes = []rune(",") 4 | 5 | func isComma(b rune) bool { 6 | return b == ',' 7 | } 8 | 9 | func newCommaToken() Token { 10 | return newToken(TokenComma, commaRunes, NoneType) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // isComment will return whether or not the next byte(s) is a 4 | // comment. 5 | func isComment(b []rune) bool { 6 | if len(b) == 0 { 7 | return false 8 | } 9 | 10 | switch b[0] { 11 | case ';': 12 | return true 13 | case '#': 14 | return true 15 | } 16 | 17 | return false 18 | } 19 | 20 | // newCommentToken will create a comment token and 21 | // return how many bytes were read. 22 | func newCommentToken(b []rune) (Token, int, error) { 23 | i := 0 24 | for ; i < len(b); i++ { 25 | if b[i] == '\n' { 26 | break 27 | } 28 | 29 | if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { 30 | break 31 | } 32 | } 33 | 34 | return newToken(TokenComment, b[:i], NoneType), i, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go: -------------------------------------------------------------------------------- 1 | // Package ini is an LL(1) parser for configuration files. 2 | // 3 | // Example: 4 | // sections, err := ini.OpenFile("/path/to/file") 5 | // if err != nil { 6 | // panic(err) 7 | // } 8 | // 9 | // profile := "foo" 10 | // section, ok := sections.GetSection(profile) 11 | // if !ok { 12 | // fmt.Printf("section %q could not be found", profile) 13 | // } 14 | // 15 | // Below is the BNF that describes this parser 16 | // Grammar: 17 | // stmt -> value stmt' 18 | // stmt' -> epsilon | op stmt 19 | // value -> number | string | boolean | quoted_string 20 | // 21 | // section -> [ section' 22 | // section' -> value section_close 23 | // section_close -> ] 24 | // 25 | // SkipState will skip (NL WS)+ 26 | // 27 | // comment -> # comment' | ; comment' 28 | // comment' -> epsilon | value 29 | package ini 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // emptyToken is used to satisfy the Token interface 4 | var emptyToken = newToken(TokenNone, []rune{}, NoneType) 5 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // newExpression will return an expression AST. 4 | // Expr represents an expression 5 | // 6 | // grammar: 7 | // expr -> string | number 8 | func newExpression(tok Token) AST { 9 | return newASTWithRootToken(ASTKindExpr, tok) 10 | } 11 | 12 | func newEqualExpr(left AST, tok Token) AST { 13 | return newASTWithRootToken(ASTKindEqualExpr, tok, left) 14 | } 15 | 16 | // EqualExprKey will return a LHS value in the equal expr 17 | func EqualExprKey(ast AST) string { 18 | children := ast.GetChildren() 19 | if len(children) == 0 || ast.Kind != ASTKindEqualExpr { 20 | return "" 21 | } 22 | 23 | return string(children[0].Root.Raw()) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package ini 4 | 5 | import ( 6 | "bytes" 7 | ) 8 | 9 | func Fuzz(data []byte) int { 10 | b := bytes.NewReader(data) 11 | 12 | if _, err := Parse(b); err != nil { 13 | return 0 14 | } 15 | 16 | return 1 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "io" 5 | "os" 6 | 7 | "github.com/aws/aws-sdk-go/aws/awserr" 8 | ) 9 | 10 | // OpenFile takes a path to a given file, and will open and parse 11 | // that file. 12 | func OpenFile(path string) (Sections, error) { 13 | f, err := os.Open(path) 14 | if err != nil { 15 | return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err) 16 | } 17 | defer f.Close() 18 | 19 | return Parse(f) 20 | } 21 | 22 | // Parse will parse the given file using the shared config 23 | // visitor. 24 | func Parse(f io.Reader) (Sections, error) { 25 | tree, err := ParseAST(f) 26 | if err != nil { 27 | return Sections{}, err 28 | } 29 | 30 | v := NewDefaultVisitor() 31 | if err = Walk(tree, v); err != nil { 32 | return Sections{}, err 33 | } 34 | 35 | return v.Sections, nil 36 | } 37 | 38 | // ParseBytes will parse the given bytes and return the parsed sections. 39 | func ParseBytes(b []byte) (Sections, error) { 40 | tree, err := ParseASTBytes(b) 41 | if err != nil { 42 | return Sections{}, err 43 | } 44 | 45 | v := NewDefaultVisitor() 46 | if err = Walk(tree, v); err != nil { 47 | return Sections{}, err 48 | } 49 | 50 | return v.Sections, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | func isNewline(b []rune) bool { 4 | if len(b) == 0 { 5 | return false 6 | } 7 | 8 | if b[0] == '\n' { 9 | return true 10 | } 11 | 12 | if len(b) < 2 { 13 | return false 14 | } 15 | 16 | return b[0] == '\r' && b[1] == '\n' 17 | } 18 | 19 | func newNewlineToken(b []rune) (Token, int, error) { 20 | i := 1 21 | if b[0] == '\r' && isNewline(b[1:]) { 22 | i++ 23 | } 24 | 25 | if !isNewline([]rune(b[:i])) { 26 | return emptyToken, 0, NewParseError("invalid new line token") 27 | } 28 | 29 | return newToken(TokenNL, b[:i], NoneType), i, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var ( 8 | equalOp = []rune("=") 9 | equalColonOp = []rune(":") 10 | ) 11 | 12 | func isOp(b []rune) bool { 13 | if len(b) == 0 { 14 | return false 15 | } 16 | 17 | switch b[0] { 18 | case '=': 19 | return true 20 | case ':': 21 | return true 22 | default: 23 | return false 24 | } 25 | } 26 | 27 | func newOpToken(b []rune) (Token, int, error) { 28 | tok := Token{} 29 | 30 | switch b[0] { 31 | case '=': 32 | tok = newToken(TokenOp, equalOp, NoneType) 33 | case ':': 34 | tok = newToken(TokenOp, equalColonOp, NoneType) 35 | default: 36 | return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) 37 | } 38 | return tok, 1, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import "fmt" 4 | 5 | const ( 6 | // ErrCodeParseError is returned when a parsing error 7 | // has occurred. 8 | ErrCodeParseError = "INIParseError" 9 | ) 10 | 11 | // ParseError is an error which is returned during any part of 12 | // the parsing process. 13 | type ParseError struct { 14 | msg string 15 | } 16 | 17 | // NewParseError will return a new ParseError where message 18 | // is the description of the error. 19 | func NewParseError(message string) *ParseError { 20 | return &ParseError{ 21 | msg: message, 22 | } 23 | } 24 | 25 | // Code will return the ErrCodeParseError 26 | func (err *ParseError) Code() string { 27 | return ErrCodeParseError 28 | } 29 | 30 | // Message returns the error's message 31 | func (err *ParseError) Message() string { 32 | return err.msg 33 | } 34 | 35 | // OrigError return nothing since there will never be any 36 | // original error. 37 | func (err *ParseError) OrigError() error { 38 | return nil 39 | } 40 | 41 | func (err *ParseError) Error() string { 42 | return fmt.Sprintf("%s: %s", err.Code(), err.Message()) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var ( 8 | emptyRunes = []rune{} 9 | ) 10 | 11 | func isSep(b []rune) bool { 12 | if len(b) == 0 { 13 | return false 14 | } 15 | 16 | switch b[0] { 17 | case '[', ']': 18 | return true 19 | default: 20 | return false 21 | } 22 | } 23 | 24 | var ( 25 | openBrace = []rune("[") 26 | closeBrace = []rune("]") 27 | ) 28 | 29 | func newSepToken(b []rune) (Token, int, error) { 30 | tok := Token{} 31 | 32 | switch b[0] { 33 | case '[': 34 | tok = newToken(TokenSep, openBrace, NoneType) 35 | case ']': 36 | tok = newToken(TokenSep, closeBrace, NoneType) 37 | default: 38 | return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) 39 | } 40 | return tok, 1, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // skipper is used to skip certain blocks of an ini file. 4 | // Currently skipper is used to skip nested blocks of ini 5 | // files. See example below 6 | // 7 | // [ foo ] 8 | // nested = ; this section will be skipped 9 | // a=b 10 | // c=d 11 | // bar=baz ; this will be included 12 | type skipper struct { 13 | shouldSkip bool 14 | TokenSet bool 15 | prevTok Token 16 | } 17 | 18 | func newSkipper() skipper { 19 | return skipper{ 20 | prevTok: emptyToken, 21 | } 22 | } 23 | 24 | func (s *skipper) ShouldSkip(tok Token) bool { 25 | // should skip state will be modified only if previous token was new line (NL); 26 | // and the current token is not WhiteSpace (WS). 27 | if s.shouldSkip && 28 | s.prevTok.Type() == TokenNL && 29 | tok.Type() != TokenWS { 30 | s.Continue() 31 | return false 32 | } 33 | s.prevTok = tok 34 | return s.shouldSkip 35 | } 36 | 37 | func (s *skipper) Skip() { 38 | s.shouldSkip = true 39 | } 40 | 41 | func (s *skipper) Continue() { 42 | s.shouldSkip = false 43 | // empty token is assigned as we return to default state, when should skip is false 44 | s.prevTok = emptyToken 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // Statement is an empty AST mostly used for transitioning states. 4 | func newStatement() AST { 5 | return newAST(ASTKindStatement, AST{}) 6 | } 7 | 8 | // SectionStatement represents a section AST 9 | func newSectionStatement(tok Token) AST { 10 | return newASTWithRootToken(ASTKindSectionStatement, tok) 11 | } 12 | 13 | // ExprStatement represents a completed expression AST 14 | func newExprStatement(ast AST) AST { 15 | return newAST(ASTKindExprStatement, ast) 16 | } 17 | 18 | // CommentStatement represents a comment in the ini definition. 19 | // 20 | // grammar: 21 | // comment -> #comment' | ;comment' 22 | // comment' -> epsilon | value 23 | func newCommentStatement(tok Token) AST { 24 | return newAST(ASTKindCommentStatement, newExpression(tok)) 25 | } 26 | 27 | // CompletedSectionStatement represents a completed section 28 | func newCompletedSectionStatement(ast AST) AST { 29 | return newAST(ASTKindCompletedSectionStatement, ast) 30 | } 31 | 32 | // SkipStatement is used to skip whole statements 33 | func newSkipStatement(ast AST) AST { 34 | return newAST(ASTKindSkipStatement, ast) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // Walk will traverse the AST using the v, the Visitor. 4 | func Walk(tree []AST, v Visitor) error { 5 | for _, node := range tree { 6 | switch node.Kind { 7 | case ASTKindExpr, 8 | ASTKindExprStatement: 9 | 10 | if err := v.VisitExpr(node); err != nil { 11 | return err 12 | } 13 | case ASTKindStatement, 14 | ASTKindCompletedSectionStatement, 15 | ASTKindNestedSectionStatement, 16 | ASTKindCompletedNestedSectionStatement: 17 | 18 | if err := v.VisitStatement(node); err != nil { 19 | return err 20 | } 21 | } 22 | } 23 | 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "unicode" 5 | ) 6 | 7 | // isWhitespace will return whether or not the character is 8 | // a whitespace character. 9 | // 10 | // Whitespace is defined as a space or tab. 11 | func isWhitespace(c rune) bool { 12 | return unicode.IsSpace(c) && c != '\n' && c != '\r' 13 | } 14 | 15 | func newWSToken(b []rune) (Token, int, error) { 16 | i := 0 17 | for ; i < len(b); i++ { 18 | if !isWhitespace(b[i]) { 19 | break 20 | } 21 | } 22 | 23 | return newToken(TokenWS, b[:i], NoneType), i, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go: -------------------------------------------------------------------------------- 1 | package sdkio 2 | 3 | const ( 4 | // Byte is 8 bits 5 | Byte int64 = 1 6 | // KibiByte (KiB) is 1024 Bytes 7 | KibiByte = Byte * 1024 8 | // MebiByte (MiB) is 1024 KiB 9 | MebiByte = KibiByte * 1024 10 | // GibiByte (GiB) is 1024 MiB 11 | GibiByte = MebiByte * 1024 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package sdkio 4 | 5 | // Copy of Go 1.7 io package's Seeker constants. 6 | const ( 7 | SeekStart = 0 // seek relative to the origin of the file 8 | SeekCurrent = 1 // seek relative to the current offset 9 | SeekEnd = 2 // seek relative to the end 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package sdkio 4 | 5 | import "io" 6 | 7 | // Alias for Go 1.7 io package Seeker constants 8 | const ( 9 | SeekStart = io.SeekStart // seek relative to the origin of the file 10 | SeekCurrent = io.SeekCurrent // seek relative to the current offset 11 | SeekEnd = io.SeekEnd // seek relative to the end 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package sdkmath 4 | 5 | import "math" 6 | 7 | // Round returns the nearest integer, rounding half away from zero. 8 | // 9 | // Special cases are: 10 | // Round(±0) = ±0 11 | // Round(±Inf) = ±Inf 12 | // Round(NaN) = NaN 13 | func Round(x float64) float64 { 14 | return math.Round(x) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go: -------------------------------------------------------------------------------- 1 | package sdkrand 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | // lockedSource is a thread-safe implementation of rand.Source 10 | type lockedSource struct { 11 | lk sync.Mutex 12 | src rand.Source 13 | } 14 | 15 | func (r *lockedSource) Int63() (n int64) { 16 | r.lk.Lock() 17 | n = r.src.Int63() 18 | r.lk.Unlock() 19 | return 20 | } 21 | 22 | func (r *lockedSource) Seed(seed int64) { 23 | r.lk.Lock() 24 | r.src.Seed(seed) 25 | r.lk.Unlock() 26 | } 27 | 28 | // SeededRand is a new RNG using a thread safe implementation of rand.Source 29 | var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package sdkrand 4 | 5 | import "math/rand" 6 | 7 | // Read provides the stub for math.Rand.Read method support for go version's 8 | // 1.6 and greater. 9 | func Read(r *rand.Rand, p []byte) (int, error) { 10 | return r.Read(p) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package sdkrand 4 | 5 | import "math/rand" 6 | 7 | // Read backfills Go 1.6's math.Rand.Reader for Go 1.5 8 | func Read(r *rand.Rand, p []byte) (n int, err error) { 9 | // Copy of Go standard libraries math package's read function not added to 10 | // standard library until Go 1.6. 11 | var pos int8 12 | var val int64 13 | for n = 0; n < len(p); n++ { 14 | if pos == 0 { 15 | val = r.Int63() 16 | pos = 7 17 | } 18 | p[n] = byte(val) 19 | val >>= 8 20 | pos-- 21 | } 22 | 23 | return n, err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go: -------------------------------------------------------------------------------- 1 | package sdkuri 2 | 3 | import ( 4 | "path" 5 | "strings" 6 | ) 7 | 8 | // PathJoin will join the elements of the path delimited by the "/" 9 | // character. Similar to path.Join with the exception the trailing "/" 10 | // character is preserved if present. 11 | func PathJoin(elems ...string) string { 12 | if len(elems) == 0 { 13 | return "" 14 | } 15 | 16 | hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/") 17 | str := path.Join(elems...) 18 | if hasTrailing && str != "/" { 19 | str += "/" 20 | } 21 | 22 | return str 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | const ( 4 | // ECSCredsProviderEnvVar is an environmental variable key used to 5 | // determine which path needs to be hit. 6 | ECSCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" 7 | ) 8 | 9 | // ECSContainerCredentialsURI is the endpoint to retrieve container 10 | // credentials. This can be overridden to test to ensure the credential process 11 | // is behaving correctly. 12 | var ECSContainerCredentialsURI = "http://169.254.170.2" 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "runtime" 7 | ) 8 | 9 | // SharedCredentialsFilename returns the SDK's default file path 10 | // for the shared credentials file. 11 | // 12 | // Builds the shared config file path based on the OS's platform. 13 | // 14 | // - Linux/Unix: $HOME/.aws/credentials 15 | // - Windows: %USERPROFILE%\.aws\credentials 16 | func SharedCredentialsFilename() string { 17 | return filepath.Join(UserHomeDir(), ".aws", "credentials") 18 | } 19 | 20 | // SharedConfigFilename returns the SDK's default file path for 21 | // the shared config file. 22 | // 23 | // Builds the shared config file path based on the OS's platform. 24 | // 25 | // - Linux/Unix: $HOME/.aws/config 26 | // - Windows: %USERPROFILE%\.aws\config 27 | func SharedConfigFilename() string { 28 | return filepath.Join(UserHomeDir(), ".aws", "config") 29 | } 30 | 31 | // UserHomeDir returns the home directory for the user the process is 32 | // running under. 33 | func UserHomeDir() string { 34 | if runtime.GOOS == "windows" { // Windows 35 | return os.Getenv("USERPROFILE") 36 | } 37 | 38 | // *nix 39 | return os.Getenv("HOME") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go: -------------------------------------------------------------------------------- 1 | package strings 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings, 8 | // under Unicode case-folding. 9 | func HasPrefixFold(s, prefix string) bool { 10 | return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go: -------------------------------------------------------------------------------- 1 | package eventstream 2 | 3 | import "fmt" 4 | 5 | // LengthError provides the error for items being larger than a maximum length. 6 | type LengthError struct { 7 | Part string 8 | Want int 9 | Have int 10 | Value interface{} 11 | } 12 | 13 | func (e LengthError) Error() string { 14 | return fmt.Sprintf("%s length invalid, %d/%d, %v", 15 | e.Part, e.Want, e.Have, e.Value) 16 | } 17 | 18 | // ChecksumError provides the error for message checksum invalidation errors. 19 | type ChecksumError struct{} 20 | 21 | func (e ChecksumError) Error() string { 22 | return "message checksum mismatch" 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go: -------------------------------------------------------------------------------- 1 | package eventstreamapi 2 | 3 | // EventStream headers with specific meaning to async API functionality. 4 | const ( 5 | ChunkSignatureHeader = `:chunk-signature` // chunk signature for message 6 | DateHeader = `:date` // Date header for signature 7 | 8 | // Message header and values 9 | MessageTypeHeader = `:message-type` // Identifies type of message. 10 | EventMessageType = `event` 11 | ErrorMessageType = `error` 12 | ExceptionMessageType = `exception` 13 | 14 | // Message Events 15 | EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". 16 | 17 | // Message Error 18 | ErrorCodeHeader = `:error-code` 19 | ErrorMessageHeader = `:error-message` 20 | 21 | // Message Exception 22 | ExceptionTypeHeader = `:exception-type` 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go: -------------------------------------------------------------------------------- 1 | // Package query provides serialization of AWS query requests, and responses. 2 | package query 3 | 4 | //go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/query.json build_test.go 5 | 6 | import ( 7 | "net/url" 8 | 9 | "github.com/aws/aws-sdk-go/aws/awserr" 10 | "github.com/aws/aws-sdk-go/aws/request" 11 | "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" 12 | ) 13 | 14 | // BuildHandler is a named request handler for building query protocol requests 15 | var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} 16 | 17 | // Build builds a request for an AWS Query service. 18 | func Build(r *request.Request) { 19 | body := url.Values{ 20 | "Action": {r.Operation.Name}, 21 | "Version": {r.ClientInfo.APIVersion}, 22 | } 23 | if err := queryutil.Parse(body, r.Params, false); err != nil { 24 | r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err) 25 | return 26 | } 27 | 28 | if !r.IsPresigned() { 29 | r.HTTPRequest.Method = "POST" 30 | r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") 31 | r.SetBufferBody([]byte(body.Encode())) 32 | } else { // This is a pre-signed request 33 | r.HTTPRequest.Method = "GET" 34 | r.HTTPRequest.URL.RawQuery = body.Encode() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "reflect" 4 | 5 | // PayloadMember returns the payload field member of i if there is one, or nil. 6 | func PayloadMember(i interface{}) interface{} { 7 | if i == nil { 8 | return nil 9 | } 10 | 11 | v := reflect.ValueOf(i).Elem() 12 | if !v.IsValid() { 13 | return nil 14 | } 15 | if field, ok := v.Type().FieldByName("_"); ok { 16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 17 | field, _ := v.Type().FieldByName(payloadName) 18 | if field.Tag.Get("type") != "structure" { 19 | return nil 20 | } 21 | 22 | payload := v.FieldByName(payloadName) 23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { 24 | return payload.Interface() 25 | } 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | // PayloadType returns the type of a payload field member of i if there is one, or "". 32 | func PayloadType(i interface{}) string { 33 | v := reflect.Indirect(reflect.ValueOf(i)) 34 | if !v.IsValid() { 35 | return "" 36 | } 37 | if field, ok := v.Type().FieldByName("_"); ok { 38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 39 | if member, ok := v.Type().FieldByName(payloadName); ok { 40 | return member.Tag.Get("type") 41 | } 42 | } 43 | } 44 | return "" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body 11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} 12 | 13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. 14 | func UnmarshalDiscardBody(r *request.Request) { 15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { 16 | return 17 | } 18 | 19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) 20 | r.HTTPResponse.Body.Close() 21 | } 22 | 23 | // ResponseMetadata provides the SDK response metadata attributes. 24 | type ResponseMetadata struct { 25 | StatusCode int 26 | RequestID string 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go: -------------------------------------------------------------------------------- 1 | package xmlutil 2 | 3 | import ( 4 | "encoding/xml" 5 | "strings" 6 | ) 7 | 8 | type xmlAttrSlice []xml.Attr 9 | 10 | func (x xmlAttrSlice) Len() int { 11 | return len(x) 12 | } 13 | 14 | func (x xmlAttrSlice) Less(i, j int) bool { 15 | spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space 16 | localI, localJ := x[i].Name.Local, x[j].Name.Local 17 | valueI, valueJ := x[i].Value, x[j].Value 18 | 19 | spaceCmp := strings.Compare(spaceI, spaceJ) 20 | localCmp := strings.Compare(localI, localJ) 21 | valueCmp := strings.Compare(valueI, valueJ) 22 | 23 | if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | 30 | func (x xmlAttrSlice) Swap(i, j int) { 31 | x[i], x[j] = x[j], x[i] 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 | 3 | // Package s3 provides the client and types for making API 4 | // requests to Amazon Simple Storage Service. 5 | // 6 | // See https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 for more information on this service. 7 | // 8 | // See s3 package documentation for more information. 9 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ 10 | // 11 | // Using the Client 12 | // 13 | // To contact Amazon Simple Storage Service with the SDK use the New function to create 14 | // a new service client. With that client you can make API requests to the service. 15 | // These clients are safe to use concurrently. 16 | // 17 | // See the SDK's documentation for more information on how to use the SDK. 18 | // https://docs.aws.amazon.com/sdk-for-go/api/ 19 | // 20 | // See aws.Config documentation for more information on configuring SDK clients. 21 | // https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config 22 | // 23 | // See the Amazon Simple Storage Service client S3 for more 24 | // information on creating client for this service. 25 | // https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#New 26 | package s3 27 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn.go: -------------------------------------------------------------------------------- 1 | package arn 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/aws/aws-sdk-go/aws/arn" 7 | ) 8 | 9 | // AccessPointARN provides representation 10 | type AccessPointARN struct { 11 | arn.ARN 12 | AccessPointName string 13 | } 14 | 15 | // GetARN returns the base ARN for the Access Point resource 16 | func (a AccessPointARN) GetARN() arn.ARN { 17 | return a.ARN 18 | } 19 | 20 | // ParseAccessPointResource attempts to parse the ARN's resource as an 21 | // AccessPoint resource. 22 | func ParseAccessPointResource(a arn.ARN, resParts []string) (AccessPointARN, error) { 23 | if len(a.Region) == 0 { 24 | return AccessPointARN{}, InvalidARNError{a, "region not set"} 25 | } 26 | if len(a.AccountID) == 0 { 27 | return AccessPointARN{}, InvalidARNError{a, "account-id not set"} 28 | } 29 | if len(resParts) == 0 { 30 | return AccessPointARN{}, InvalidARNError{a, "resource-id not set"} 31 | } 32 | if len(resParts) > 1 { 33 | return AccessPointARN{}, InvalidARNError{a, "sub resource not supported"} 34 | } 35 | 36 | resID := resParts[0] 37 | if len(strings.TrimSpace(resID)) == 0 { 38 | return AccessPointARN{}, InvalidARNError{a, "resource-id not set"} 39 | } 40 | 41 | return AccessPointARN{ 42 | ARN: a, 43 | AccessPointName: resID, 44 | }, nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package s3 4 | 5 | import "github.com/aws/aws-sdk-go/aws/request" 6 | 7 | func platformRequestHandlers(r *request.Request) { 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package s3 4 | 5 | import ( 6 | "github.com/aws/aws-sdk-go/aws" 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | func platformRequestHandlers(r *request.Request) { 11 | if r.Operation.HTTPMethod == "PUT" { 12 | // 100-Continue should only be used on put requests. 13 | r.Handlers.Sign.PushBack(add100Continue) 14 | } 15 | } 16 | 17 | func add100Continue(r *request.Request) { 18 | if aws.BoolValue(r.Config.S3Disable100Continue) { 19 | return 20 | } 21 | if r.HTTPRequest.ContentLength < 1024*1024*2 { 22 | // Ignore requests smaller than 2MB. This helps prevent delaying 23 | // requests unnecessarily. 24 | return 25 | } 26 | 27 | r.HTTPRequest.Header.Set("Expect", "100-Continue") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/default_read_seeker_write_to.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package s3manager 4 | 5 | func defaultUploadBufferProvider() ReadSeekerWriteToProvider { 6 | return nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/default_read_seeker_write_to_windows.go: -------------------------------------------------------------------------------- 1 | package s3manager 2 | 3 | func defaultUploadBufferProvider() ReadSeekerWriteToProvider { 4 | return NewBufferedReadSeekerWriteToPool(1024 * 1024) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/default_writer_read_from.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package s3manager 4 | 5 | func defaultDownloadBufferProvider() WriterReadFromProvider { 6 | return nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/default_writer_read_from_windows.go: -------------------------------------------------------------------------------- 1 | package s3manager 2 | 3 | func defaultDownloadBufferProvider() WriterReadFromProvider { 4 | return NewPooledBufferedWriterReadFromProvider(1024 * 1024) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/doc.go: -------------------------------------------------------------------------------- 1 | // Package s3manager provides utilities to upload and download objects from 2 | // S3 concurrently. Helpful for when working with large objects. 3 | package s3manager 4 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "net/http" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | "github.com/aws/aws-sdk-go/internal/sdkio" 11 | ) 12 | 13 | func copyMultipartStatusOKUnmarhsalError(r *request.Request) { 14 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) 15 | if err != nil { 16 | r.Error = awserr.NewRequestFailure( 17 | awserr.New(request.ErrCodeSerialization, "unable to read response body", err), 18 | r.HTTPResponse.StatusCode, 19 | r.RequestID, 20 | ) 21 | return 22 | } 23 | body := bytes.NewReader(b) 24 | r.HTTPResponse.Body = ioutil.NopCloser(body) 25 | defer body.Seek(0, sdkio.SeekStart) 26 | 27 | if body.Len() == 0 { 28 | // If there is no body don't attempt to parse the body. 29 | return 30 | } 31 | 32 | unmarshalError(r) 33 | if err, ok := r.Error.(awserr.Error); ok && err != nil { 34 | if err.Code() == request.ErrCodeSerialization { 35 | r.Error = nil 36 | return 37 | } 38 | r.HTTPResponse.StatusCode = http.StatusServiceUnavailable 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go: -------------------------------------------------------------------------------- 1 | package sts 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | func init() { 6 | initRequest = customizeRequest 7 | } 8 | 9 | func customizeRequest(r *request.Request) { 10 | r.RetryErrorCodes = append(r.RetryErrorCodes, ErrCodeIDPCommunicationErrorException) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4.3 5 | - 1.5.3 6 | - tip 7 | 8 | script: 9 | - go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Legal requirements 6 | 7 | In order to protect both you and ourselves, you will need to sign the 8 | [Contributor License Agreement](https://cla.developers.google.com/clas). 9 | 10 | You may have already signed it for other Google projects. 11 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid ![build status](https://travis-ci.org/google/uuid.svg?branch=master) 2 | The uuid package generates and inspects UUIDs based on 3 | [RFC 4122](http://tools.ietf.org/html/rfc4122) 4 | and DCE 1.1: Authentication and Security Services. 5 | 6 | This package is based on the github.com/pborman/uuid package (previously named 7 | code.google.com/p/go-uuid). It differs from these earlier packages in that 8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this 9 | change is the ability to represent an invalid UUID (vs a NIL UUID). 10 | 11 | ###### Install 12 | `go get github.com/google/uuid` 13 | 14 | ###### Documentation 15 | [![GoDoc](https://godoc.org/github.com/google/uuid?status.svg)](http://godoc.org/github.com/google/uuid) 16 | 17 | Full `go doc` style documentation for the package can be viewed online without 18 | installing this package by using the GoDoc site here: 19 | http://godoc.org/github.com/google/uuid 20 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/google/uuid 2 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/marshal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uuid 6 | 7 | import "fmt" 8 | 9 | // MarshalText implements encoding.TextMarshaler. 10 | func (uuid UUID) MarshalText() ([]byte, error) { 11 | var js [36]byte 12 | encodeHex(js[:], uuid) 13 | return js[:], nil 14 | } 15 | 16 | // UnmarshalText implements encoding.TextUnmarshaler. 17 | func (uuid *UUID) UnmarshalText(data []byte) error { 18 | id, err := ParseBytes(data) 19 | if err == nil { 20 | *uuid = id 21 | } 22 | return err 23 | } 24 | 25 | // MarshalBinary implements encoding.BinaryMarshaler. 26 | func (uuid UUID) MarshalBinary() ([]byte, error) { 27 | return uuid[:], nil 28 | } 29 | 30 | // UnmarshalBinary implements encoding.BinaryUnmarshaler. 31 | func (uuid *UUID) UnmarshalBinary(data []byte) error { 32 | if len(data) != 16 { 33 | return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) 34 | } 35 | copy(uuid[:], data) 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This remvoves the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !js 6 | 7 | package uuid 8 | 9 | import "net" 10 | 11 | var interfaces []net.Interface // cached list of interfaces 12 | 13 | // getHardwareInterface returns the name and hardware address of interface name. 14 | // If name is "" then the name and hardware address of one of the system's 15 | // interfaces is returned. If no interfaces are found (name does not exist or 16 | // there are no interfaces) then "", nil is returned. 17 | // 18 | // Only addresses of at least 6 bytes are returned. 19 | func getHardwareInterface(name string) (string, []byte) { 20 | if interfaces == nil { 21 | var err error 22 | interfaces, err = net.Interfaces() 23 | if err != nil { 24 | return "", nil 25 | } 26 | } 27 | for _, ifs := range interfaces { 28 | if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { 29 | return ifs.Name, ifs.HardwareAddr 30 | } 31 | } 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/version1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uuid 6 | 7 | import ( 8 | "encoding/binary" 9 | ) 10 | 11 | // NewUUID returns a Version 1 UUID based on the current NodeID and clock 12 | // sequence, and the current time. If the NodeID has not been set by SetNodeID 13 | // or SetNodeInterface then it will be set automatically. If the NodeID cannot 14 | // be set NewUUID returns nil. If clock sequence has not been set by 15 | // SetClockSequence then it will be set automatically. If GetTime fails to 16 | // return the current NewUUID returns nil and an error. 17 | // 18 | // In most cases, New should be used. 19 | func NewUUID() (UUID, error) { 20 | nodeMu.Lock() 21 | if nodeID == zeroID { 22 | setNodeInterface("") 23 | } 24 | nodeMu.Unlock() 25 | 26 | var uuid UUID 27 | now, seq, err := GetTime() 28 | if err != nil { 29 | return uuid, err 30 | } 31 | 32 | timeLow := uint32(now & 0xffffffff) 33 | timeMid := uint16((now >> 32) & 0xffff) 34 | timeHi := uint16((now >> 48) & 0x0fff) 35 | timeHi |= 0x1000 // Version 1 36 | 37 | binary.BigEndian.PutUint32(uuid[0:], timeLow) 38 | binary.BigEndian.PutUint16(uuid[4:], timeMid) 39 | binary.BigEndian.PutUint16(uuid[6:], timeHi) 40 | binary.BigEndian.PutUint16(uuid[8:], seq) 41 | copy(uuid[10:], nodeID[:]) 42 | 43 | return uuid, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/version4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package uuid 6 | 7 | import "io" 8 | 9 | // New creates a new random UUID or panics. New is equivalent to 10 | // the expression 11 | // 12 | // uuid.Must(uuid.NewRandom()) 13 | func New() UUID { 14 | return Must(NewRandom()) 15 | } 16 | 17 | // NewRandom returns a Random (Version 4) UUID. 18 | // 19 | // The strength of the UUIDs is based on the strength of the crypto/rand 20 | // package. 21 | // 22 | // A note about uniqueness derived from the UUID Wikipedia entry: 23 | // 24 | // Randomly generated UUIDs have 122 random bits. One's annual risk of being 25 | // hit by a meteorite is estimated to be one chance in 17 billion, that 26 | // means the probability is about 0.00000000006 (6 × 10−11), 27 | // equivalent to the odds of creating a few tens of trillions of UUIDs in a 28 | // year and having one duplicate. 29 | func NewRandom() (UUID, error) { 30 | var uuid UUID 31 | _, err := io.ReadFull(rander, uuid[:]) 32 | if err != nil { 33 | return Nil, err 34 | } 35 | uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 36 | uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 37 | return uuid, nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of gorilla/mux authors for copyright purposes. 2 | # 3 | # Please keep the list sorted. 4 | 5 | Google LLC (https://opensource.google.com/) 6 | Kamil Kisielk 7 | Matt Silverlock 8 | Rodrigo Moraes (https://github.com/moraes) 9 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gorilla/mux 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 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 mux 6 | 7 | import "net/http" 8 | 9 | // SetURLVars sets the URL variables for the given request, to be accessed via 10 | // mux.Vars for testing route behaviour. Arguments are not modified, a shallow 11 | // copy is returned. 12 | // 13 | // This API should only be used for testing purposes; it provides a way to 14 | // inject variables into the request context. Alternatively, URL variables 15 | // can be set by making a route that captures the required variables, 16 | // starting a server and sending the request to that server. 17 | func SetURLVars(r *http.Request, val map[string]string) *http.Request { 18 | return requestWithVars(r, val) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .idea/ 25 | *.iml 26 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Gorilla WebSocket authors for copyright 2 | # purposes. 3 | # 4 | # Please keep the list sorted. 5 | 6 | Gary Burd 7 | Google LLC (https://opensource.google.com/) 8 | Joachim Bauch 9 | 10 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/client_clone.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 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.8 6 | 7 | package websocket 8 | 9 | import "crypto/tls" 10 | 11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 12 | if cfg == nil { 13 | return &tls.Config{} 14 | } 15 | return cfg.Clone() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_write.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 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.8 6 | 7 | package websocket 8 | 9 | import "net" 10 | 11 | func (c *Conn) writeBufs(bufs ...[]byte) error { 12 | b := net.Buffers(bufs) 13 | _, err := b.WriteTo(c.conn) 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_write_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 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.8 6 | 7 | package websocket 8 | 9 | func (c *Conn) writeBufs(bufs ...[]byte) error { 10 | for _, buf := range bufs { 11 | if len(buf) > 0 { 12 | if _, err := c.conn.Write(buf); err != nil { 13 | return err 14 | } 15 | } 16 | } 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gorilla/websocket 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapid7/pdf-renderer/1e58b782ce13a6e2102f2228938875c039828284/vendor/github.com/gorilla/websocket/go.sum -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/join.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Gorilla WebSocket Authors. All rights reserved. 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 websocket 6 | 7 | import ( 8 | "io" 9 | "strings" 10 | ) 11 | 12 | // JoinMessages concatenates received messages to create a single io.Reader. 13 | // The string term is appended to each message. The returned reader does not 14 | // support concurrent calls to the Read method. 15 | func JoinMessages(c *Conn, term string) io.Reader { 16 | return &joinReader{c: c, term: term} 17 | } 18 | 19 | type joinReader struct { 20 | c *Conn 21 | term string 22 | r io.Reader 23 | } 24 | 25 | func (r *joinReader) Read(p []byte) (int, error) { 26 | if r.r == nil { 27 | var err error 28 | _, r.r, err = r.c.NextReader() 29 | if err != nil { 30 | return 0, err 31 | } 32 | if r.term != "" { 33 | r.r = io.MultiReader(r.r, strings.NewReader(r.term)) 34 | } 35 | } 36 | n, err := r.r.Read(p) 37 | if err == io.EOF { 38 | err = nil 39 | r.r = nil 40 | } 41 | return n, err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package websocket 8 | 9 | import "unsafe" 10 | 11 | const wordSize = int(unsafe.Sizeof(uintptr(0))) 12 | 13 | func maskBytes(key [4]byte, pos int, b []byte) int { 14 | // Mask one byte at a time for small buffers. 15 | if len(b) < 2*wordSize { 16 | for i := range b { 17 | b[i] ^= key[pos&3] 18 | pos++ 19 | } 20 | return pos & 3 21 | } 22 | 23 | // Mask one byte at a time to word boundary. 24 | if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { 25 | n = wordSize - n 26 | for i := range b[:n] { 27 | b[i] ^= key[pos&3] 28 | pos++ 29 | } 30 | b = b[n:] 31 | } 32 | 33 | // Create aligned word size key. 34 | var k [wordSize]byte 35 | for i := range k { 36 | k[i] = key[(pos+i)&3] 37 | } 38 | kw := *(*uintptr)(unsafe.Pointer(&k)) 39 | 40 | // Mask one word at a time. 41 | n := (len(b) / wordSize) * wordSize 42 | for i := 0; i < n; i += wordSize { 43 | *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw 44 | } 45 | 46 | // Mask one byte at a time for remaining bytes. 47 | b = b[n:] 48 | for i := range b { 49 | b[i] ^= key[pos&3] 50 | pos++ 51 | } 52 | 53 | return pos & 3 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package websocket 8 | 9 | func maskBytes(key [4]byte, pos int, b []byte) int { 10 | for i := range b { 11 | b[i] ^= key[pos&3] 12 | pos++ 13 | } 14 | return pos & 3 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/trace.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package websocket 4 | 5 | import ( 6 | "crypto/tls" 7 | "net/http/httptrace" 8 | ) 9 | 10 | func doHandshakeWithTrace(trace *httptrace.ClientTrace, tlsConn *tls.Conn, cfg *tls.Config) error { 11 | if trace.TLSHandshakeStart != nil { 12 | trace.TLSHandshakeStart() 13 | } 14 | err := doHandshake(tlsConn, cfg) 15 | if trace.TLSHandshakeDone != nil { 16 | trace.TLSHandshakeDone(tlsConn.ConnectionState(), err) 17 | } 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/trace_17.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package websocket 4 | 5 | import ( 6 | "crypto/tls" 7 | "net/http/httptrace" 8 | ) 9 | 10 | func doHandshakeWithTrace(trace *httptrace.ClientTrace, tlsConn *tls.Conn, cfg *tls.Config) error { 11 | return doHandshake(tlsConn, cfg) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.gitignore: -------------------------------------------------------------------------------- 1 | /jpgo 2 | jmespath-fuzz.zip 3 | cpu.out 4 | go-jmespath.test 5 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.5.x 7 | - 1.6.x 8 | - 1.7.x 9 | - 1.8.x 10 | - 1.9.x 11 | - 1.10.x 12 | - 1.11.x 13 | - 1.12.x 14 | - 1.13.x 15 | 16 | install: go get -v -t ./... 17 | script: make test 18 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 James Saryerwinnie 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CMD = jpgo 3 | 4 | help: 5 | @echo "Please use \`make ' where is one of" 6 | @echo " test to run all the tests" 7 | @echo " build to build the library and jp executable" 8 | @echo " generate to run codegen" 9 | 10 | 11 | generate: 12 | go generate ./... 13 | 14 | build: 15 | rm -f $(CMD) 16 | go build ./... 17 | rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./... 18 | mv cmd/$(CMD)/$(CMD) . 19 | 20 | test: 21 | go test -v ./... 22 | 23 | check: 24 | go vet ./... 25 | @echo "golint ./..." 26 | @lint=`golint ./...`; \ 27 | lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \ 28 | echo "$$lint"; \ 29 | if [ "$$lint" != "" ]; then exit 1; fi 30 | 31 | htmlc: 32 | go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov 33 | 34 | buildfuzz: 35 | go-fuzz-build github.com/jmespath/go-jmespath/fuzz 36 | 37 | fuzz: buildfuzz 38 | go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata 39 | 40 | bench: 41 | go test -bench . -cpuprofile cpu.out 42 | 43 | pprof-cpu: 44 | go tool pprof ./go-jmespath.test ./cpu.out 45 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jmespath/go-jmespath 2 | 3 | go 1.14 4 | 5 | require github.com/stretchr/testify v1.5.1 6 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 4 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 5 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 6 | github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= 7 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 8 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 9 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 10 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 11 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 12 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/konsorten/go-windows-terminal-sequences 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | # Ignore coverage for generated code. 3 | - "protocol/**/command([0-9]*)?.go" 4 | - "protocol/**/domain([0-9]*)?.go" 5 | - "protocol/**/types([0-9]*)?.go" 6 | - "protocol/**/event([0-9]*)?.go" 7 | - "protocol/page18.go" 8 | - "protocol/internal/page19.go" 9 | 10 | coverage: 11 | range: 70..100 12 | round: nearest 13 | precision: 1 14 | 15 | status: 16 | project: 17 | default: 18 | enabled: yes 19 | threshold: 2% 20 | patch: no 21 | changes: no 22 | 23 | comment: 24 | layout: "header, diff" 25 | behavior: once 26 | require_changes: yes 27 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = tab 9 | 10 | [*.md] 11 | indent_style = space 12 | indent_size = 4 13 | 14 | [*.{yml,json}] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | addons: 6 | chrome: stable 7 | 8 | go: 9 | - 1.12.x 10 | - 1.13.x 11 | - 1.14.x 12 | - master 13 | 14 | before_install: 15 | # Use --disable-setuid-sandbox to avoid core dump on Travis. 16 | # And --no-sandbox (https://github.com/travis-ci/travis-ci/issues/8836). 17 | - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 --disable-setuid-sandbox --no-sandbox about:blank & 18 | 19 | script: 20 | - go list -f '{{if len .TestGoFiles}}-coverprofile={{.Name}}_coverage.out {{.ImportPath}}{{end}}' ./... | xargs -L1 go test -race -covermode=atomic 21 | - go test ./session -browser -race -covermode=atomic -coverprofile=session_coverage.out 22 | - go test . -browser 23 | 24 | after_success: 25 | - bash <(curl -s https://codecov.io/bash) 26 | - killall google-chrome-stable 27 | 28 | matrix: 29 | fast_finish: true 30 | allow_failures: 31 | - go: master 32 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Mathias Fredriksson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/cdp_client_io_stream_reader.go: -------------------------------------------------------------------------------- 1 | package cdp 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/mafredri/cdp/protocol/io" 7 | ) 8 | 9 | // NewIOStreamReader returns a reader for io.Stream that implements io.Reader 10 | // from the standard library. 11 | func (c *Client) NewIOStreamReader(ctx context.Context, handle io.StreamHandle) *io.StreamReader { 12 | return io.NewStreamReader(ctx, c.IO, handle) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/devtool/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Package devtool provides methods for interacting with a DevTools 4 | endpoint. 5 | 6 | To activate the DevTools endpoint, a browser (or other debug target) 7 | should be started with debugging enabled: 8 | 9 | chromium --remote-debugging-port=9222 10 | .//EdgeDiagnosticsAdapter.exe --port 9223 11 | node --inspect=9224 12 | 13 | Create a new DevTools instance that interacts with the given URL: 14 | 15 | devt := devtool.New("http://127.0.0.1:9222") 16 | 17 | Get the active page or create a new one: 18 | 19 | devt := devtool.New("http://127.0.0.1:9222") 20 | page, err := devt.Get(context.Background(), devtool.Page) 21 | if err != nil { 22 | page, err = devt.Create(context.Background()) 23 | if err != nil { 24 | // Handle error. 25 | } 26 | } 27 | // ... 28 | 29 | Set request timeouts via contexts: 30 | 31 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) 32 | defer cancel() 33 | 34 | devt := devtool.New("http://127.0.0.1:9222") 35 | list, err := devt.List(ctx) 36 | if err != nil { 37 | // Handle error. 38 | } 39 | // ... 40 | 41 | */ 42 | package devtool 43 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/error.go: -------------------------------------------------------------------------------- 1 | package cdp 2 | 3 | import ( 4 | "github.com/mafredri/cdp/internal/errors" 5 | ) 6 | 7 | // ErrorCause returns the underlying cause for this error, if possible. 8 | // If err does not implement causer.Cause(), then err is returned. 9 | func ErrorCause(err error) error { return errors.Cause(err) } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mafredri/cdp 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/client9/misspell v0.3.4 7 | github.com/google/go-cmp v0.4.0 8 | github.com/gorilla/websocket v1.4.2 9 | github.com/mafredri/go-lint v0.0.0-20180911205320-920981dfc79e 10 | golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a 11 | golang.org/x/tools v0.0.0-20200330183114-f8bfb4ee3038 // indirect 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/applicationcache/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package applicationcache 4 | 5 | import ( 6 | "github.com/mafredri/cdp/protocol/page" 7 | ) 8 | 9 | // Resource Detailed application cache resource information. 10 | type Resource struct { 11 | URL string `json:"url"` // Resource url. 12 | Size int `json:"size"` // Resource size. 13 | Type string `json:"type"` // Resource type. 14 | } 15 | 16 | // ApplicationCache Detailed application cache information. 17 | type ApplicationCache struct { 18 | ManifestURL string `json:"manifestURL"` // Manifest URL. 19 | Size float64 `json:"size"` // Application cache size. 20 | CreationTime float64 `json:"creationTime"` // Application cache creation time. 21 | UpdateTime float64 `json:"updateTime"` // Application cache update time. 22 | Resources []Resource `json:"resources"` // Application cache resources. 23 | } 24 | 25 | // FrameWithManifest Frame identifier - manifest URL pair. 26 | type FrameWithManifest struct { 27 | FrameID page.FrameID `json:"frameId"` // Frame identifier. 28 | ManifestURL string `json:"manifestURL"` // Manifest URL. 29 | Status int `json:"status"` // Application cache status. 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/audits/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package audits 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // IssueAddedClient is a client for IssueAdded events. 10 | type IssueAddedClient interface { 11 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 12 | // triggered, context canceled or connection closed. 13 | Recv() (*IssueAddedReply, error) 14 | rpcc.Stream 15 | } 16 | 17 | // IssueAddedReply is the reply for IssueAdded events. 18 | type IssueAddedReply struct { 19 | Issue InspectorIssue `json:"issue"` // No description. 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/cast/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package cast 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // SinksUpdatedClient is a client for SinksUpdated events. This is fired 10 | // whenever the list of available sinks changes. A sink is a device or a 11 | // software surface that you can cast to. 12 | type SinksUpdatedClient interface { 13 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 14 | // triggered, context canceled or connection closed. 15 | Recv() (*SinksUpdatedReply, error) 16 | rpcc.Stream 17 | } 18 | 19 | // SinksUpdatedReply is the reply for SinksUpdated events. 20 | type SinksUpdatedReply struct { 21 | Sinks []Sink `json:"sinks"` // No description. 22 | } 23 | 24 | // IssueUpdatedClient is a client for IssueUpdated events. This is fired 25 | // whenever the outstanding issue/error message changes. |issueMessage| is 26 | // empty if there is no issue. 27 | type IssueUpdatedClient interface { 28 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 29 | // triggered, context canceled or connection closed. 30 | Recv() (*IssueUpdatedReply, error) 31 | rpcc.Stream 32 | } 33 | 34 | // IssueUpdatedReply is the reply for IssueUpdated events. 35 | type IssueUpdatedReply struct { 36 | IssueMessage string `json:"issueMessage"` // No description. 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/cast/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package cast 4 | 5 | // Sink 6 | type Sink struct { 7 | Name string `json:"name"` // No description. 8 | ID string `json:"id"` // No description. 9 | Session *string `json:"session,omitempty"` // Text describing the current session. Present only if there is an active session on the sink. 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/console/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package console 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // MessageAddedClient is a client for MessageAdded events. Issued when new 10 | // console message is added. 11 | type MessageAddedClient interface { 12 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 13 | // triggered, context canceled or connection closed. 14 | Recv() (*MessageAddedReply, error) 15 | rpcc.Stream 16 | } 17 | 18 | // MessageAddedReply is the reply for MessageAdded events. 19 | type MessageAddedReply struct { 20 | Message Message `json:"message"` // Console message that has been added. 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/console/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package console 4 | 5 | // Message Console message. 6 | type Message struct { 7 | // Source Message source. 8 | // 9 | // Values: "xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "security", "other", "deprecation", "worker". 10 | Source string `json:"source"` 11 | // Level Message severity. 12 | // 13 | // Values: "log", "warning", "error", "debug", "info". 14 | Level string `json:"level"` 15 | Text string `json:"text"` // Message text. 16 | URL *string `json:"url,omitempty"` // URL of the message origin. 17 | Line *int `json:"line,omitempty"` // Line number in the resource that generated this message (1-based). 18 | Column *int `json:"column,omitempty"` // Column number in the resource that generated this message (1-based). 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/database/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package database 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // AddDatabaseClient is a client for AddDatabase events. 10 | type AddDatabaseClient interface { 11 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 12 | // triggered, context canceled or connection closed. 13 | Recv() (*AddDatabaseReply, error) 14 | rpcc.Stream 15 | } 16 | 17 | // AddDatabaseReply is the reply for AddDatabase events. 18 | type AddDatabaseReply struct { 19 | Database Database `json:"database"` // No description. 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/database/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package database 4 | 5 | // ID Unique identifier of Database object. 6 | type ID string 7 | 8 | // Database Database object. 9 | type Database struct { 10 | ID ID `json:"id"` // Database ID. 11 | Domain string `json:"domain"` // Database domain. 12 | Name string `json:"name"` // Database name. 13 | Version string `json:"version"` // Database version. 14 | } 15 | 16 | // Error Database error. 17 | type Error struct { 18 | Message string `json:"message"` // Error message. 19 | Code int `json:"code"` // Error code. 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/deviceorientation/command.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package deviceorientation 4 | 5 | // SetDeviceOrientationOverrideArgs represents the arguments for SetDeviceOrientationOverride in the DeviceOrientation domain. 6 | type SetDeviceOrientationOverrideArgs struct { 7 | Alpha float64 `json:"alpha"` // Mock alpha 8 | Beta float64 `json:"beta"` // Mock beta 9 | Gamma float64 `json:"gamma"` // Mock gamma 10 | } 11 | 12 | // NewSetDeviceOrientationOverrideArgs initializes SetDeviceOrientationOverrideArgs with the required arguments. 13 | func NewSetDeviceOrientationOverrideArgs(alpha float64, beta float64, gamma float64) *SetDeviceOrientationOverrideArgs { 14 | args := new(SetDeviceOrientationOverrideArgs) 15 | args.Alpha = alpha 16 | args.Beta = beta 17 | args.Gamma = gamma 18 | return args 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/domstorage/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package domstorage 4 | 5 | // StorageID DOM Storage identifier. 6 | type StorageID struct { 7 | SecurityOrigin string `json:"securityOrigin"` // Security origin for the storage. 8 | IsLocalStorage bool `json:"isLocalStorage"` // Whether the storage is local storage (not session storage). 9 | } 10 | 11 | // Item DOM Storage item. 12 | type Item []string 13 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/emulation/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package emulation 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // VirtualTimeBudgetExpiredClient is a client for VirtualTimeBudgetExpired events. 10 | // Notification sent after the virtual time budget for the current 11 | // VirtualTimePolicy has run out. 12 | type VirtualTimeBudgetExpiredClient interface { 13 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 14 | // triggered, context canceled or connection closed. 15 | Recv() (*VirtualTimeBudgetExpiredReply, error) 16 | rpcc.Stream 17 | } 18 | 19 | // VirtualTimeBudgetExpiredReply is the reply for VirtualTimeBudgetExpired events. 20 | type VirtualTimeBudgetExpiredReply struct { 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/headlessexperimental/event.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package headlessexperimental 4 | 5 | import ( 6 | "github.com/mafredri/cdp/rpcc" 7 | ) 8 | 9 | // NeedsBeginFramesChangedClient is a client for NeedsBeginFramesChanged events. 10 | // Issued when the target starts or stops needing BeginFrames. Deprecated. 11 | // Issue beginFrame unconditionally instead and use result from beginFrame to 12 | // detect whether the frames were suppressed. 13 | type NeedsBeginFramesChangedClient interface { 14 | // Recv calls RecvMsg on rpcc.Stream, blocks until the event is 15 | // triggered, context canceled or connection closed. 16 | Recv() (*NeedsBeginFramesChangedReply, error) 17 | rpcc.Stream 18 | } 19 | 20 | // NeedsBeginFramesChangedReply is the reply for NeedsBeginFramesChanged events. 21 | type NeedsBeginFramesChangedReply struct { 22 | NeedsBeginFrames bool `json:"needsBeginFrames"` // True if BeginFrames are needed, false otherwise. 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/headlessexperimental/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package headlessexperimental 4 | 5 | // ScreenshotParams Encoding options for a screenshot. 6 | type ScreenshotParams struct { 7 | // Format Image compression format (defaults to png). 8 | // 9 | // Values: "jpeg", "png". 10 | Format *string `json:"format,omitempty"` 11 | Quality *int `json:"quality,omitempty"` // Compression quality from range [0..100] (jpeg only). 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/internal/browser.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package internal 4 | 5 | // BrowserContextID 6 | // 7 | // This type cannot be used directly. Use browser.ContextID instead. 8 | // 9 | // Note: This type is experimental. 10 | type BrowserContextID string 11 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/internal/error.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // OpError represents an operational error. 8 | type OpError struct { 9 | Domain string 10 | Op string 11 | Err error 12 | } 13 | 14 | // Cause implements error causer. 15 | func (e *OpError) Cause() error { 16 | return e.Err 17 | } 18 | 19 | func (e OpError) Error() string { 20 | return fmt.Sprintf("cdp.%s: %s: %s", e.Domain, e.Op, e.Err.Error()) 21 | } 22 | 23 | type causer interface { 24 | Cause() error 25 | } 26 | 27 | var ( 28 | _ error = (*OpError)(nil) 29 | _ causer = (*OpError)(nil) 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/internal/page.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package internal 4 | 5 | // PageFrameID Unique frame identifier. 6 | // 7 | // This type cannot be used directly. Use page.FrameID instead. 8 | type PageFrameID string 9 | -------------------------------------------------------------------------------- /vendor/github.com/mafredri/cdp/protocol/io/types.go: -------------------------------------------------------------------------------- 1 | // Code generated by cdpgen. DO NOT EDIT. 2 | 3 | package io 4 | 5 | // StreamHandle This is either obtained from another method or specified as 6 | // `blob:` where `> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 aix 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | 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) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | 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) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 aix 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_unveil.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 openbsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | // Unveil implements the unveil syscall. 15 | // For more information see unveil(2). 16 | // Note that the special case of blocking further 17 | // unveil calls is handled by UnveilBlock. 18 | func Unveil(path string, flags string) error { 19 | pathPtr, err := syscall.BytePtrFromString(path) 20 | if err != nil { 21 | return err 22 | } 23 | flagsPtr, err := syscall.BytePtrFromString(flags) 24 | if err != nil { 25 | return err 26 | } 27 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 28 | if e != 0 { 29 | return e 30 | } 31 | return nil 32 | } 33 | 34 | // UnveilBlock blocks future unveil calls. 35 | // For more information see unveil(2). 36 | func UnveilBlock() error { 37 | // Both pointers must be nil. 38 | var pathUnsafe, flagsUnsafe unsafe.Pointer 39 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 40 | if e != 0 { 41 | return e 42 | } 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.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,go1.12 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | 19 | //go:linkname syscall_syscall syscall.syscall 20 | //go:linkname syscall_syscall6 syscall.syscall6 21 | //go:linkname syscall_syscall6X syscall.syscall6X 22 | //go:linkname syscall_syscall9 syscall.syscall9 23 | //go:linkname syscall_rawSyscall syscall.rawSyscall 24 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 25 | 26 | // Find the entry point for f. See comments in runtime/proc.go for the 27 | // function of the same name. 28 | //go:nosplit 29 | func funcPC(f func()) uintptr { 30 | return **(**uintptr)(unsafe.Pointer(&f)) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_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,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +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 | -------------------------------------------------------------------------------- /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 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | --------------------------------------------------------------------------------