├── .github └── workflows │ └── release.yml ├── .gitignore ├── .goreleaser.yaml ├── Makefile ├── README.md ├── banner.go ├── fofa_stat.go ├── go.mod ├── go.sum ├── main.go ├── result.go ├── type.go └── vendor ├── github.com ├── chromedp │ ├── cdproto │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── accessibility │ │ │ ├── accessibility.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── animation │ │ │ ├── animation.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── audits │ │ │ ├── audits.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── backgroundservice │ │ │ ├── backgroundservice.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── browser │ │ │ ├── browser.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── cachestorage │ │ │ ├── cachestorage.go │ │ │ ├── easyjson.go │ │ │ └── types.go │ │ ├── cast │ │ │ ├── cast.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── cdp │ │ │ ├── easyjson.go │ │ │ └── types.go │ │ ├── cdproto.go │ │ ├── css │ │ │ ├── css.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── database │ │ │ ├── database.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── debugger │ │ │ ├── debugger.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── deviceorientation │ │ │ ├── deviceorientation.go │ │ │ └── easyjson.go │ │ ├── dom │ │ │ ├── dom.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── domdebugger │ │ │ ├── domdebugger.go │ │ │ ├── easyjson.go │ │ │ └── types.go │ │ ├── domsnapshot │ │ │ ├── domsnapshot.go │ │ │ ├── easyjson.go │ │ │ └── types.go │ │ ├── domstorage │ │ │ ├── domstorage.go │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── easyjson.go │ │ ├── emulation │ │ │ ├── easyjson.go │ │ │ ├── emulation.go │ │ │ ├── events.go │ │ │ └── types.go │ │ ├── eventbreakpoints │ │ │ ├── easyjson.go │ │ │ └── eventbreakpoints.go │ │ ├── fetch │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── fetch.go │ │ │ └── types.go │ │ ├── headlessexperimental │ │ │ ├── easyjson.go │ │ │ ├── headlessexperimental.go │ │ │ └── types.go │ │ ├── heapprofiler │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── heapprofiler.go │ │ │ └── types.go │ │ ├── indexeddb │ │ │ ├── easyjson.go │ │ │ ├── indexeddb.go │ │ │ └── types.go │ │ ├── input │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── input.go │ │ │ └── types.go │ │ ├── inspector │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── inspector.go │ │ │ └── types.go │ │ ├── io │ │ │ ├── easyjson.go │ │ │ ├── io.go │ │ │ └── types.go │ │ ├── layertree │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── layertree.go │ │ │ └── types.go │ │ ├── log │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── log.go │ │ │ └── types.go │ │ ├── media │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── media.go │ │ │ └── types.go │ │ ├── memory │ │ │ ├── easyjson.go │ │ │ ├── memory.go │ │ │ └── types.go │ │ ├── network │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── network.go │ │ │ └── types.go │ │ ├── overlay │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── overlay.go │ │ │ └── types.go │ │ ├── page │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── page.go │ │ │ └── types.go │ │ ├── performance │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── performance.go │ │ │ └── types.go │ │ ├── performancetimeline │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── performancetimeline.go │ │ │ └── types.go │ │ ├── profiler │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── profiler.go │ │ │ └── types.go │ │ ├── runtime │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── runtime.go │ │ │ └── types.go │ │ ├── security │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── security.go │ │ │ └── types.go │ │ ├── serviceworker │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── serviceworker.go │ │ │ └── types.go │ │ ├── storage │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── storage.go │ │ │ └── types.go │ │ ├── systeminfo │ │ │ ├── easyjson.go │ │ │ ├── systeminfo.go │ │ │ └── types.go │ │ ├── target │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── target.go │ │ │ └── types.go │ │ ├── tethering │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ └── tethering.go │ │ ├── tracing │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── tracing.go │ │ │ └── types.go │ │ ├── webaudio │ │ │ ├── easyjson.go │ │ │ ├── events.go │ │ │ ├── types.go │ │ │ └── webaudio.go │ │ └── webauthn │ │ │ ├── easyjson.go │ │ │ ├── types.go │ │ │ └── webauthn.go │ ├── chromedp │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── allocate.go │ │ ├── allocate_linux.go │ │ ├── allocate_other.go │ │ ├── browser.go │ │ ├── call.go │ │ ├── chromedp.go │ │ ├── conn.go │ │ ├── device │ │ │ ├── device.go │ │ │ └── types.go │ │ ├── emulate.go │ │ ├── errors.go │ │ ├── eval.go │ │ ├── input.go │ │ ├── js.go │ │ ├── kb │ │ │ ├── kb.go │ │ │ └── keys.go │ │ ├── nav.go │ │ ├── poll.go │ │ ├── query.go │ │ ├── screenshot.go │ │ ├── target.go │ │ └── util.go │ └── sysutil │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── sysutil.go │ │ ├── sysutil_bsd.go │ │ ├── sysutil_linux.go │ │ ├── sysutil_other.go │ │ ├── sysutil_windows.go │ │ ├── timeval.go │ │ └── timeval32.go ├── gobwas │ ├── httphead │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cookie.go │ │ ├── head.go │ │ ├── httphead.go │ │ ├── lexer.go │ │ ├── octet.go │ │ ├── option.go │ │ └── writer.go │ ├── pool │ │ ├── LICENSE │ │ ├── README.md │ │ ├── generic.go │ │ ├── internal │ │ │ └── pmath │ │ │ │ └── pmath.go │ │ ├── option.go │ │ ├── pbufio │ │ │ ├── pbufio.go │ │ │ ├── pbufio_go110.go │ │ │ └── pbufio_go19.go │ │ ├── pbytes │ │ │ ├── pbytes.go │ │ │ ├── pool.go │ │ │ └── pool_sanitize.go │ │ └── pool.go │ └── ws │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── check.go │ │ ├── cipher.go │ │ ├── dialer.go │ │ ├── dialer_tls_go17.go │ │ ├── dialer_tls_go18.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── frame.go │ │ ├── http.go │ │ ├── nonce.go │ │ ├── read.go │ │ ├── server.go │ │ ├── server_test.s │ │ ├── util.go │ │ ├── write.go │ │ └── wsutil │ │ ├── cipher.go │ │ ├── dialer.go │ │ ├── extenstion.go │ │ ├── handler.go │ │ ├── helper.go │ │ ├── reader.go │ │ ├── upgrader.go │ │ ├── utf8.go │ │ ├── writer.go │ │ └── wsutil.go ├── josharian │ └── intern │ │ ├── README.md │ │ ├── intern.go │ │ └── license.md └── mailru │ └── easyjson │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── buffer │ └── pool.go │ ├── helpers.go │ ├── jlexer │ ├── bytestostr.go │ ├── bytestostr_nounsafe.go │ ├── error.go │ └── lexer.go │ ├── jwriter │ └── writer.go │ ├── raw.go │ └── unknown_fields.go ├── golang.org └── x │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── internal │ └── unsafeheader │ │ └── unsafeheader.go │ └── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── asm_bsd_386.s │ ├── asm_bsd_amd64.s │ ├── asm_bsd_arm.s │ ├── asm_bsd_arm64.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_riscv64.s │ ├── asm_linux_s390x.s │ ├── asm_openbsd_mips64.s │ ├── asm_solaris_amd64.s │ ├── asm_zos_s390x.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 │ ├── dev_zos.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── epoll_zos.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── errors_freebsd_arm64.go │ ├── fcntl.go │ ├── fcntl_darwin.go │ ├── fcntl_linux_32bit.go │ ├── fdset.go │ ├── fstatfs_zos.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ifreq_linux.go │ ├── ioctl.go │ ├── ioctl_linux.go │ ├── ioctl_zos.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── pagesize_unix.go │ ├── pledge_openbsd.go │ ├── ptrace_darwin.go │ ├── ptrace_ios.go │ ├── race.go │ ├── race0.go │ ├── readdirent_getdents.go │ ├── readdirent_getdirentries.go │ ├── sockcmsg_dragonfly.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── sockcmsg_unix_other.go │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.1_12.go │ ├── syscall_darwin.1_13.go │ ├── syscall_darwin.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_freebsd_arm64.go │ ├── syscall_illumos.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gc_arm.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_netbsd_arm64.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_openbsd_arm64.go │ ├── syscall_openbsd_mips64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── syscall_zos_s390x.go │ ├── sysvshm_linux.go │ ├── sysvshm_unix.go │ ├── sysvshm_unix_other.go │ ├── timestruct.go │ ├── unveil_openbsd.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_freebsd_arm64.go │ ├── zerrors_linux.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_riscv64.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_netbsd_arm64.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_openbsd_arm64.go │ ├── zerrors_openbsd_mips64.go │ ├── zerrors_solaris_amd64.go │ ├── zerrors_zos_s390x.go │ ├── zptrace_armnn_linux.go │ ├── zptrace_linux_arm64.go │ ├── zptrace_mipsnn_linux.go │ ├── zptrace_mipsnnle_linux.go │ ├── zptrace_x86_linux.go │ ├── zsyscall_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_amd64.1_13.go │ ├── zsyscall_darwin_amd64.1_13.s │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm64.1_13.go │ ├── zsyscall_darwin_arm64.1_13.s │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.go │ ├── zsyscall_illumos_amd64.go │ ├── zsyscall_linux.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_riscv64.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_netbsd_arm64.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_openbsd_arm64.go │ ├── zsyscall_openbsd_mips64.go │ ├── zsyscall_solaris_amd64.go │ ├── zsyscall_zos_s390x.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysctl_openbsd_arm64.go │ ├── zsysctl_openbsd_mips64.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_freebsd_arm64.go │ ├── zsysnum_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_ppc.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_riscv64.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_netbsd_arm64.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── zsysnum_openbsd_arm64.go │ ├── zsysnum_openbsd_mips64.go │ ├── zsysnum_zos_s390x.go │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_freebsd_arm64.go │ ├── ztypes_illumos_amd64.go │ ├── ztypes_linux.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_riscv64.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_netbsd_arm64.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ ├── ztypes_openbsd_arm64.go │ ├── ztypes_openbsd_mips64.go │ ├── ztypes_solaris_amd64.go │ └── ztypes_zos_s390x.go └── modules.txt /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - 12 | name: Checkout 13 | uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - 17 | name: Set up Go 18 | uses: actions/setup-go@v2 19 | with: 20 | go-version: 1.17 21 | - 22 | name: Cache Go modules 23 | uses: actions/cache@v1 24 | with: 25 | path: ~/go/pkg/mod 26 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 27 | restore-keys: | 28 | ${{ runner.os }}-go- 29 | - 30 | name: Run GoReleaser 31 | uses: goreleaser/goreleaser-action@v2 32 | if: success() && startsWith(github.ref, 'refs/tags/') 33 | with: 34 | version: latest 35 | args: release --rm-dist 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | # This is an example goreleaser.yaml file with some sane defaults. 2 | # Make sure to check the documentation at http://goreleaser.com 3 | # https://goreleaser.com/customization/build/ 4 | project_name: sylas 5 | gomod: 6 | proxy: false 7 | builds: 8 | - env: [CGO_ENABLED=0] 9 | binary: sylas 10 | main: ./ 11 | ldflags: 12 | - -s -w -X main.Version={{.Version}} 13 | goos: 14 | - linux 15 | - windows 16 | - darwin 17 | goarch: 18 | - amd64 19 | - 386 20 | - arm64 21 | checksum: 22 | name_template: 'checksums.txt' 23 | snapshot: 24 | name_template: "{{ .Tag }}-next" 25 | archives: 26 | - files: 27 | - none* 28 | changelog: 29 | sort: asc 30 | filters: 31 | exclude: 32 | - '^docs:' 33 | - '^test:' -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL:=help 2 | 3 | COLOR_ENABLE=$(shell tput colors > /dev/null; echo $$?) 4 | ifeq "$(COLOR_ENABLE)" "0" 5 | CRED:=$(shell tput setaf 1 2>/dev/null) 6 | CGREEN:=$(shell tput setaf 2 2>/dev/null) 7 | CYELLOW:=$(shell tput setaf 3 2>/dev/null) 8 | CBLUE:=$(shell tput setaf 4 2>/dev/null) 9 | CMAGENTA:=$(shell tput setaf 5 2>/dev/null) 10 | CCYAN:=$(shell tput setaf 6 2>/dev/null) 11 | CWHITE:=$(shell tput setaf 7 2>/dev/null) 12 | CEND:=$(shell tput sgr0 2>/dev/null) 13 | endif 14 | 15 | .PHONY: deps 16 | deps: ## deps check 17 | @echo "$(CGREEN)deps check ...$(CEND)" 18 | @/bin/bash script/deps.sh 19 | 20 | .PHONY: check 21 | check: deps ## code check 22 | @echo "$(CGREEN)sylas code check ...$(CEND)" 23 | @golangci-lint run ./... 24 | 25 | .PHONY: build 26 | build: ## build snapshot 27 | @echo "$(CGREEN)sylas build snapshot no publish ...$(CEND)" 28 | @goreleaser build --snapshot --rm-dist 29 | 30 | .PHONY: snapshot 31 | snapshot: ## pre snapshot 32 | @echo "$(CGREEN)sylas release snapshot no publish ...$(CEND)" 33 | @goreleaser release --skip-publish --snapshot --rm-dist 34 | .PHONY: release 35 | release: check ## release no publish 36 | @echo "$(CGREEN)sylas release no publish ...$(CEND)" 37 | @goreleaser release --skip-publish --rm-dist 38 | 39 | .PHONY: clean 40 | clean: ## clean up 41 | @echo "$(CGREEN)clean up dist ...$(CEND)" 42 | @rm -rf ./dist 43 | .PHONY: help 44 | help: ## Show this help. 45 | @echo "$(CGREEN)sylas project$(CEND)" 46 | @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make $(CYELLOW)$(CEND) (default: help)\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " $(CCYAN)%-12s$(CEND) %s\n", $$1, $$2 }' $(MAKEFILE_LIST) 47 | -------------------------------------------------------------------------------- /banner.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | const banner = ` 9 | _____ __ 10 | / ___/__ __/ /___ ______ 11 | \__ \/ / / / / __ / ___/ 12 | ___/ / /_/ / / /_/ (__ ) 13 | /____/\__, /_/\__,_/____/ 14 | /____/ %s 15 | ` 16 | 17 | // showBanner is used to show the banner to the user 18 | func showBanner() { 19 | fmt.Fprintf(os.Stderr, "%s\n", fmt.Sprintf(banner, Version)) 20 | } 21 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module sylas 2 | 3 | go 1.17 4 | 5 | require ( 6 | github.com/chromedp/cdproto v0.0.0-20220106001210-12edfdeb56f8 7 | github.com/chromedp/chromedp v0.7.6 8 | ) 9 | 10 | require ( 11 | github.com/chromedp/sysutil v1.0.0 // indirect 12 | github.com/gobwas/httphead v0.1.0 // indirect 13 | github.com/gobwas/pool v0.2.1 // indirect 14 | github.com/gobwas/ws v1.1.0 // indirect 15 | github.com/josharian/intern v1.0.0 // indirect 16 | github.com/mailru/easyjson v0.7.7 // indirect 17 | golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/chromedp/cdproto v0.0.0-20211126220118-81fa0469ad77/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= 2 | github.com/chromedp/cdproto v0.0.0-20220106001210-12edfdeb56f8 h1:Pa8y3sSjaE3KMHZwoqJONTQyrleSvymjhvSRBLfQ2fg= 3 | github.com/chromedp/cdproto v0.0.0-20220106001210-12edfdeb56f8/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= 4 | github.com/chromedp/chromedp v0.7.6 h1:2juGaktzjwULlsn+DnvIZXFUckEp5xs+GOBroaea+jA= 5 | github.com/chromedp/chromedp v0.7.6/go.mod h1:ayT4YU/MGAALNfOg9gNrpGSAdnU51PMx+FCeuT1iXzo= 6 | github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= 7 | github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= 8 | github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= 9 | github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= 10 | github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= 11 | github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= 12 | github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= 13 | github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= 14 | github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= 15 | github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= 16 | github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= 17 | github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= 18 | github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5 h1:1SoBaSPudixRecmlHXb/GxmaD3fLMtHIDN13QujwQuc= 19 | github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= 20 | golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 21 | golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc= 22 | golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 23 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | "os" 7 | ) 8 | 9 | var ( 10 | h bool 11 | debug bool 12 | fquery string 13 | isFull string 14 | fwfile string 15 | fofaDomain string 16 | fofaSize int 17 | chromePath string 18 | Version = "v0.0.6" 19 | ) 20 | 21 | func init() { 22 | flag.BoolVar(&h, "h", false, "show help") 23 | flag.BoolVar(&debug, "debug", false, "debug") 24 | flag.StringVar(&fquery, "q", "", "fofa query") 25 | flag.StringVar(&isFull, "f", "false", "full data") 26 | flag.StringVar(&fofaDomain, "fofa-domain", "soall.org", "fofa domain") 27 | flag.IntVar(&fofaSize, "size", 10000, "fofa query size") 28 | flag.StringVar(&chromePath, "p", "", "chrome path") 29 | flag.Parse() 30 | 31 | showBanner() 32 | if h || len(os.Args) == 1 { 33 | flag.Usage() 34 | os.Exit(0) 35 | } 36 | if fquery == "" { 37 | log.Print("fquery not empty") 38 | os.Exit(1) 39 | } 40 | } 41 | func main() { 42 | getResult(fquery) 43 | } 44 | -------------------------------------------------------------------------------- /type.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/base64" 5 | "log" 6 | ) 7 | 8 | type b64str string 9 | 10 | func (b b64str) String() string { 11 | bckd, err := base64.StdEncoding.DecodeString(string(b)) 12 | if err != nil { 13 | log.Print(err) 14 | } 15 | return string(bckd) 16 | } 17 | 18 | type common struct { 19 | Code b64str `json:"code"` 20 | Count int `json:"count"` 21 | Name string `json:"name"` 22 | } 23 | 24 | type Country struct { 25 | Code b64str `json:"code"` 26 | Count int `json:"count"` 27 | Ename string `json:"ename"` 28 | Name string `json:"name"` 29 | NameCode string `json:"name_code"` 30 | Regions []common `json:"regions"` 31 | } 32 | type CountryChartData struct { 33 | Cname string `json:"cname"` 34 | Code b64str `json:"code"` 35 | Name string `json:"name"` 36 | Value int `json:"value"` 37 | } 38 | type List struct { 39 | hash []common `json:"hash"` 40 | port []common `json:"port"` 41 | protocol []common `json:"protocol"` 42 | server []common `json:"server"` 43 | title []common `json:"title"` 44 | } 45 | type Ranks struct { 46 | List List `json:"List"` 47 | } 48 | 49 | type Data struct { 50 | Countries []Country `json:"countries"` 51 | CountryChartData []CountryChartData `json:"country_chart_data"` 52 | DistinctIps int `json:"distinct_ips"` 53 | Query string `json:"q"` 54 | Ranks Ranks `json:"ranks"` 55 | } 56 | 57 | type FoFaStatusResp struct { 58 | Code int `json:"code"` 59 | Message string `json:"message"` 60 | TTL int `json:"ttl"` 61 | Data Data `json:"data"` 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/.gitignore: -------------------------------------------------------------------------------- 1 | *.json 2 | *.pdl 3 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2021 Kenneth Shaw 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/chromedp/cdproto/README.md: -------------------------------------------------------------------------------- 1 | # About cdproto 2 | 3 | Package `cdproto` contains the generated commands, types, and events for the 4 | [Chrome DevTools Protocol domains][devtools-protocol]. 5 | 6 | [![Unit Tests][cdproto-ci-status]][cdproto-ci] 7 | [![Go Reference][goref-cdproto-status]][goref-cdproto] 8 | 9 | This package is generated by the [`cdproto-gen`][cdproto-gen] command. Please 10 | refer to that project and to the main [`chromedp`][chromedp] project for 11 | information on using the commands, types, and events available here. 12 | 13 | ## API 14 | 15 | Please see the [Go Reference][goref-cdproto]. 16 | 17 | ## Contributing 18 | 19 | If you would like to submit a change to the code in this package, please submit 20 | your Pull Request to the [`cdproto-gen`][cdproto-gen] project. Any Issues and 21 | Pull Requests submitted to this project will be closed without being reviewed. 22 | 23 | [cdproto-ci]: https://github.com/chromedp/cdproto/actions/workflows/build.yml (Build CI) 24 | [cdproto-ci-status]: https://github.com/chromedp/cdproto/actions/workflows/build.yml/badge.svg (Build CI) 25 | [cdproto-gen]: https://github.com/chromedp/cdproto-gen 26 | [chromedp]: https://github.com/chromedp/chromedp 27 | [devtools-protocol]: https://chromedevtools.github.io/devtools-protocol/ 28 | [goref-cdproto]: https://pkg.go.dev/github.com/chromedp/cdproto 29 | [goref-cdproto-status]: https://pkg.go.dev/badge/github.com/chromedp/chromedp.svg 30 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/accessibility/events.go: -------------------------------------------------------------------------------- 1 | package accessibility 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventLoadComplete the loadComplete event mirrors the load complete event 6 | // sent by the browser to assistive technology when the web page has finished 7 | // loading. 8 | // 9 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#event-loadComplete 10 | type EventLoadComplete struct { 11 | Root *Node `json:"root"` // New document root node. 12 | } 13 | 14 | // EventNodesUpdated the nodesUpdated event is sent every time a previously 15 | // requested node has changed the in tree. 16 | // 17 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Accessibility#event-nodesUpdated 18 | type EventNodesUpdated struct { 19 | Nodes []*Node `json:"nodes"` // Updated node data. 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/animation/events.go: -------------------------------------------------------------------------------- 1 | package animation 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventAnimationCanceled event for when an animation has been cancelled. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationCanceled 8 | type EventAnimationCanceled struct { 9 | ID string `json:"id"` // Id of the animation that was cancelled. 10 | } 11 | 12 | // EventAnimationCreated event for each animation that has been created. 13 | // 14 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationCreated 15 | type EventAnimationCreated struct { 16 | ID string `json:"id"` // Id of the animation that was created. 17 | } 18 | 19 | // EventAnimationStarted event for animation that has been started. 20 | // 21 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Animation#event-animationStarted 22 | type EventAnimationStarted struct { 23 | Animation *Animation `json:"animation"` // Animation that was started. 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/audits/events.go: -------------------------------------------------------------------------------- 1 | package audits 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventIssueAdded [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#event-issueAdded 8 | type EventIssueAdded struct { 9 | Issue *InspectorIssue `json:"issue"` 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/backgroundservice/events.go: -------------------------------------------------------------------------------- 1 | package backgroundservice 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventRecordingStateChanged called when the recording state for the service 6 | // has been updated. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-recordingStateChanged 9 | type EventRecordingStateChanged struct { 10 | IsRecording bool `json:"isRecording"` 11 | Service ServiceName `json:"service"` 12 | } 13 | 14 | // EventBackgroundServiceEventReceived called with all existing 15 | // backgroundServiceEvents when enabled, and all new events afterwards if 16 | // enabled and recording. 17 | // 18 | // See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-backgroundServiceEventReceived 19 | type EventBackgroundServiceEventReceived struct { 20 | BackgroundServiceEvent *Event `json:"backgroundServiceEvent"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/browser/events.go: -------------------------------------------------------------------------------- 1 | package browser 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/cdp" 7 | ) 8 | 9 | // EventDownloadWillBegin fired when page is about to start a download. 10 | // 11 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#event-downloadWillBegin 12 | type EventDownloadWillBegin struct { 13 | FrameID cdp.FrameID `json:"frameId"` // Id of the frame that caused the download to begin. 14 | GUID string `json:"guid"` // Global unique identifier of the download. 15 | URL string `json:"url"` // URL of the resource being downloaded. 16 | SuggestedFilename string `json:"suggestedFilename"` // Suggested file name of the resource (the actual name of the file saved on disk may differ). 17 | } 18 | 19 | // EventDownloadProgress fired when download makes progress. Last call has 20 | // |done| == true. 21 | // 22 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Browser#event-downloadProgress 23 | type EventDownloadProgress struct { 24 | GUID string `json:"guid"` // Global unique identifier of the download. 25 | TotalBytes float64 `json:"totalBytes"` // Total expected bytes to download. 26 | ReceivedBytes float64 `json:"receivedBytes"` // Total bytes received. 27 | State DownloadProgressState `json:"state"` // Download status. 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/cast/events.go: -------------------------------------------------------------------------------- 1 | package cast 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventSinksUpdated this is fired whenever the list of available sinks 6 | // changes. A sink is a device or a software surface that you can cast to. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#event-sinksUpdated 9 | type EventSinksUpdated struct { 10 | Sinks []*Sink `json:"sinks"` 11 | } 12 | 13 | // EventIssueUpdated this is fired whenever the outstanding issue/error 14 | // message changes. |issueMessage| is empty if there is no issue. 15 | // 16 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#event-issueUpdated 17 | type EventIssueUpdated struct { 18 | IssueMessage string `json:"issueMessage"` 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/cast/types.go: -------------------------------------------------------------------------------- 1 | package cast 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // Sink [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Cast#type-Sink 8 | type Sink struct { 9 | Name string `json:"name"` 10 | ID string `json:"id"` 11 | Session string `json:"session,omitempty"` // Text describing the current session. Present only if there is an active session on the sink. 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/css/events.go: -------------------------------------------------------------------------------- 1 | package css 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventFontsUpdated fires whenever a web font is updated. A non-empty font 6 | // parameter indicates a successfully loaded web font. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#event-fontsUpdated 9 | type EventFontsUpdated struct { 10 | Font *FontFace `json:"font,omitempty"` // The web font that has loaded. 11 | } 12 | 13 | // EventMediaQueryResultChanged fires whenever a MediaQuery result changes 14 | // (for example, after a browser window has been resized.) The current 15 | // implementation considers only viewport-dependent media features. 16 | // 17 | // See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#event-mediaQueryResultChanged 18 | type EventMediaQueryResultChanged struct{} 19 | 20 | // EventStyleSheetAdded fired whenever an active document stylesheet is 21 | // added. 22 | // 23 | // See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#event-styleSheetAdded 24 | type EventStyleSheetAdded struct { 25 | Header *StyleSheetHeader `json:"header"` // Added stylesheet metainfo. 26 | } 27 | 28 | // EventStyleSheetChanged fired whenever a stylesheet is changed as a result 29 | // of the client operation. 30 | // 31 | // See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#event-styleSheetChanged 32 | type EventStyleSheetChanged struct { 33 | StyleSheetID StyleSheetID `json:"styleSheetId"` 34 | } 35 | 36 | // EventStyleSheetRemoved fired whenever an active document stylesheet is 37 | // removed. 38 | // 39 | // See: https://chromedevtools.github.io/devtools-protocol/tot/CSS#event-styleSheetRemoved 40 | type EventStyleSheetRemoved struct { 41 | StyleSheetID StyleSheetID `json:"styleSheetId"` // Identifier of the removed stylesheet. 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/database/events.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventAddDatabase [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Database#event-addDatabase 8 | type EventAddDatabase struct { 9 | Database *Database `json:"database"` 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/database/types.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // ID unique identifier of Database object. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Database#type-DatabaseId 8 | type ID string 9 | 10 | // String returns the ID as string value. 11 | func (t ID) String() string { 12 | return string(t) 13 | } 14 | 15 | // Database database object. 16 | // 17 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Database#type-Database 18 | type Database struct { 19 | ID ID `json:"id"` // Database ID. 20 | Domain string `json:"domain"` // Database domain. 21 | Name string `json:"name"` // Database name. 22 | Version string `json:"version"` // Database version. 23 | } 24 | 25 | // Error database error. 26 | // 27 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Database#type-Error 28 | type Error struct { 29 | Message string `json:"message"` // Error message. 30 | Code int64 `json:"code"` // Error code. 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/domstorage/events.go: -------------------------------------------------------------------------------- 1 | package domstorage 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventDomStorageItemAdded [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#event-domStorageItemAdded 8 | type EventDomStorageItemAdded struct { 9 | StorageID *StorageID `json:"storageId"` 10 | Key string `json:"key"` 11 | NewValue string `json:"newValue"` 12 | } 13 | 14 | // EventDomStorageItemRemoved [no description]. 15 | // 16 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#event-domStorageItemRemoved 17 | type EventDomStorageItemRemoved struct { 18 | StorageID *StorageID `json:"storageId"` 19 | Key string `json:"key"` 20 | } 21 | 22 | // EventDomStorageItemUpdated [no description]. 23 | // 24 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#event-domStorageItemUpdated 25 | type EventDomStorageItemUpdated struct { 26 | StorageID *StorageID `json:"storageId"` 27 | Key string `json:"key"` 28 | OldValue string `json:"oldValue"` 29 | NewValue string `json:"newValue"` 30 | } 31 | 32 | // EventDomStorageItemsCleared [no description]. 33 | // 34 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#event-domStorageItemsCleared 35 | type EventDomStorageItemsCleared struct { 36 | StorageID *StorageID `json:"storageId"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/domstorage/types.go: -------------------------------------------------------------------------------- 1 | package domstorage 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // StorageID DOM Storage identifier. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#type-StorageId 8 | type StorageID struct { 9 | SecurityOrigin string `json:"securityOrigin"` // Security origin for the storage. 10 | IsLocalStorage bool `json:"isLocalStorage"` // Whether the storage is local storage (not session storage). 11 | } 12 | 13 | // Item DOM Storage item. 14 | // 15 | // See: https://chromedevtools.github.io/devtools-protocol/tot/DOMStorage#type-Item 16 | type Item []string 17 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/emulation/events.go: -------------------------------------------------------------------------------- 1 | package emulation 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventVirtualTimeBudgetExpired notification sent after the virtual time 6 | // budget for the current VirtualTimePolicy has run out. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Emulation#event-virtualTimeBudgetExpired 9 | type EventVirtualTimeBudgetExpired struct{} 10 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/heapprofiler/events.go: -------------------------------------------------------------------------------- 1 | package heapprofiler 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventAddHeapSnapshotChunk [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#event-addHeapSnapshotChunk 8 | type EventAddHeapSnapshotChunk struct { 9 | Chunk string `json:"chunk"` 10 | } 11 | 12 | // EventHeapStatsUpdate if heap objects tracking has been started then 13 | // backend may send update for one or more fragments. 14 | // 15 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#event-heapStatsUpdate 16 | type EventHeapStatsUpdate struct { 17 | StatsUpdate []int64 `json:"statsUpdate"` // An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. 18 | } 19 | 20 | // EventLastSeenObjectID if heap objects tracking has been started then 21 | // backend regularly sends a current value for last seen object id and 22 | // corresponding timestamp. If the were changes in the heap since last event 23 | // then one or more heapStatsUpdate events will be sent before a new 24 | // lastSeenObjectId event. 25 | // 26 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#event-lastSeenObjectId 27 | type EventLastSeenObjectID struct { 28 | LastSeenObjectID int64 `json:"lastSeenObjectId"` 29 | Timestamp float64 `json:"timestamp"` 30 | } 31 | 32 | // EventReportHeapSnapshotProgress [no description]. 33 | // 34 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#event-reportHeapSnapshotProgress 35 | type EventReportHeapSnapshotProgress struct { 36 | Done int64 `json:"done"` 37 | Total int64 `json:"total"` 38 | Finished bool `json:"finished,omitempty"` 39 | } 40 | 41 | // EventResetProfiles [no description]. 42 | // 43 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#event-resetProfiles 44 | type EventResetProfiles struct{} 45 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/heapprofiler/types.go: -------------------------------------------------------------------------------- 1 | package heapprofiler 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/runtime" 7 | ) 8 | 9 | // HeapSnapshotObjectID heap snapshot object id. 10 | // 11 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#type-HeapSnapshotObjectId 12 | type HeapSnapshotObjectID string 13 | 14 | // String returns the HeapSnapshotObjectID as string value. 15 | func (t HeapSnapshotObjectID) String() string { 16 | return string(t) 17 | } 18 | 19 | // SamplingHeapProfileNode sampling Heap Profile node. Holds callsite 20 | // information, allocation statistics and child nodes. 21 | // 22 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#type-SamplingHeapProfileNode 23 | type SamplingHeapProfileNode struct { 24 | CallFrame *runtime.CallFrame `json:"callFrame"` // Function location. 25 | SelfSize float64 `json:"selfSize"` // Allocations size in bytes for the node excluding children. 26 | ID int64 `json:"id"` // Node id. Ids are unique across all profiles collected between startSampling and stopSampling. 27 | Children []*SamplingHeapProfileNode `json:"children"` // Child nodes. 28 | } 29 | 30 | // SamplingHeapProfileSample a single sample from a sampling profile. 31 | // 32 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#type-SamplingHeapProfileSample 33 | type SamplingHeapProfileSample struct { 34 | Size float64 `json:"size"` // Allocation size in bytes attributed to the sample. 35 | NodeID int64 `json:"nodeId"` // Id of the corresponding profile tree node. 36 | Ordinal float64 `json:"ordinal"` // Time-ordered sample ordinal number. It is unique across all profiles retrieved between startSampling and stopSampling. 37 | } 38 | 39 | // SamplingHeapProfile sampling profile. 40 | // 41 | // See: https://chromedevtools.github.io/devtools-protocol/tot/HeapProfiler#type-SamplingHeapProfile 42 | type SamplingHeapProfile struct { 43 | Head *SamplingHeapProfileNode `json:"head"` 44 | Samples []*SamplingHeapProfileSample `json:"samples"` 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/input/events.go: -------------------------------------------------------------------------------- 1 | package input 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventDragIntercepted emitted only when Input.setInterceptDrags is enabled. 6 | // Use this data with Input.dispatchDragEvent to restore normal drag and drop 7 | // behavior. 8 | // 9 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Input#event-dragIntercepted 10 | type EventDragIntercepted struct { 11 | Data *DragData `json:"data"` 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/inspector/events.go: -------------------------------------------------------------------------------- 1 | package inspector 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventDetached fired when remote debugging connection is about to be 6 | // terminated. Contains detach reason. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Inspector#event-detached 9 | type EventDetached struct { 10 | Reason DetachReason `json:"reason"` // The reason why connection has been terminated. 11 | } 12 | 13 | // EventTargetCrashed fired when debugging target has crashed. 14 | // 15 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Inspector#event-targetCrashed 16 | type EventTargetCrashed struct{} 17 | 18 | // EventTargetReloadedAfterCrash fired when debugging target has reloaded 19 | // after crash. 20 | // 21 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Inspector#event-targetReloadedAfterCrash 22 | type EventTargetReloadedAfterCrash struct{} 23 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/inspector/inspector.go: -------------------------------------------------------------------------------- 1 | // Package inspector provides the Chrome DevTools Protocol 2 | // commands, types, and events for the Inspector domain. 3 | // 4 | // Generated by the cdproto-gen command. 5 | package inspector 6 | 7 | // Code generated by cdproto-gen. DO NOT EDIT. 8 | 9 | import ( 10 | "context" 11 | 12 | "github.com/chromedp/cdproto/cdp" 13 | ) 14 | 15 | // DisableParams disables inspector domain notifications. 16 | type DisableParams struct{} 17 | 18 | // Disable disables inspector domain notifications. 19 | // 20 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Inspector#method-disable 21 | func Disable() *DisableParams { 22 | return &DisableParams{} 23 | } 24 | 25 | // Do executes Inspector.disable against the provided context. 26 | func (p *DisableParams) Do(ctx context.Context) (err error) { 27 | return cdp.Execute(ctx, CommandDisable, nil, nil) 28 | } 29 | 30 | // EnableParams enables inspector domain notifications. 31 | type EnableParams struct{} 32 | 33 | // Enable enables inspector domain notifications. 34 | // 35 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Inspector#method-enable 36 | func Enable() *EnableParams { 37 | return &EnableParams{} 38 | } 39 | 40 | // Do executes Inspector.enable against the provided context. 41 | func (p *EnableParams) Do(ctx context.Context) (err error) { 42 | return cdp.Execute(ctx, CommandEnable, nil, nil) 43 | } 44 | 45 | // Command names. 46 | const ( 47 | CommandDisable = "Inspector.disable" 48 | CommandEnable = "Inspector.enable" 49 | ) 50 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/inspector/types.go: -------------------------------------------------------------------------------- 1 | package inspector 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "errors" 7 | 8 | "github.com/mailru/easyjson" 9 | "github.com/mailru/easyjson/jlexer" 10 | "github.com/mailru/easyjson/jwriter" 11 | ) 12 | 13 | // DetachReason detach reason. 14 | // 15 | // See: ( -- none -- ) 16 | type DetachReason string 17 | 18 | // String returns the DetachReason as string value. 19 | func (t DetachReason) String() string { 20 | return string(t) 21 | } 22 | 23 | // DetachReason values. 24 | const ( 25 | DetachReasonTargetClosed DetachReason = "target_closed" 26 | DetachReasonCanceledByUser DetachReason = "canceled_by_user" 27 | DetachReasonReplacedWithDevtools DetachReason = "replaced_with_devtools" 28 | DetachReasonRenderProcessGone DetachReason = "Render process gone." 29 | ) 30 | 31 | // MarshalEasyJSON satisfies easyjson.Marshaler. 32 | func (t DetachReason) MarshalEasyJSON(out *jwriter.Writer) { 33 | out.String(string(t)) 34 | } 35 | 36 | // MarshalJSON satisfies json.Marshaler. 37 | func (t DetachReason) MarshalJSON() ([]byte, error) { 38 | return easyjson.Marshal(t) 39 | } 40 | 41 | // UnmarshalEasyJSON satisfies easyjson.Unmarshaler. 42 | func (t *DetachReason) UnmarshalEasyJSON(in *jlexer.Lexer) { 43 | switch DetachReason(in.String()) { 44 | case DetachReasonTargetClosed: 45 | *t = DetachReasonTargetClosed 46 | case DetachReasonCanceledByUser: 47 | *t = DetachReasonCanceledByUser 48 | case DetachReasonReplacedWithDevtools: 49 | *t = DetachReasonReplacedWithDevtools 50 | case DetachReasonRenderProcessGone: 51 | *t = DetachReasonRenderProcessGone 52 | 53 | default: 54 | in.AddError(errors.New("unknown DetachReason value")) 55 | } 56 | } 57 | 58 | // UnmarshalJSON satisfies json.Unmarshaler. 59 | func (t *DetachReason) UnmarshalJSON(buf []byte) error { 60 | return easyjson.Unmarshal(buf, t) 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/io/types.go: -------------------------------------------------------------------------------- 1 | package io 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // StreamHandle this is either obtained from another method or specified as 6 | // blob: where is an UUID of a Blob. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/IO#type-StreamHandle 9 | type StreamHandle string 10 | 11 | // String returns the StreamHandle as string value. 12 | func (t StreamHandle) String() string { 13 | return string(t) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/layertree/events.go: -------------------------------------------------------------------------------- 1 | package layertree 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/dom" 7 | ) 8 | 9 | // EventLayerPainted [no description]. 10 | // 11 | // See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerPainted 12 | type EventLayerPainted struct { 13 | LayerID LayerID `json:"layerId"` // The id of the painted layer. 14 | Clip *dom.Rect `json:"clip"` // Clip rectangle. 15 | } 16 | 17 | // EventLayerTreeDidChange [no description]. 18 | // 19 | // See: https://chromedevtools.github.io/devtools-protocol/tot/LayerTree#event-layerTreeDidChange 20 | type EventLayerTreeDidChange struct { 21 | Layers []*Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode. 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/log/events.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventEntryAdded issued when new message was logged. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Log#event-entryAdded 8 | type EventEntryAdded struct { 9 | Entry *Entry `json:"entry"` // The entry. 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/media/events.go: -------------------------------------------------------------------------------- 1 | package media 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventPlayerPropertiesChanged this can be called multiple times, and can be 6 | // used to set / override / remove player properties. A null propValue indicates 7 | // removal. 8 | // 9 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerPropertiesChanged 10 | type EventPlayerPropertiesChanged struct { 11 | PlayerID PlayerID `json:"playerId"` 12 | Properties []*PlayerProperty `json:"properties"` 13 | } 14 | 15 | // EventPlayerEventsAdded send events as a list, allowing them to be batched 16 | // on the browser for less congestion. If batched, events must ALWAYS be in 17 | // chronological order. 18 | // 19 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerEventsAdded 20 | type EventPlayerEventsAdded struct { 21 | PlayerID PlayerID `json:"playerId"` 22 | Events []*PlayerEvent `json:"events"` 23 | } 24 | 25 | // EventPlayerMessagesLogged send a list of any messages that need to be 26 | // delivered. 27 | // 28 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerMessagesLogged 29 | type EventPlayerMessagesLogged struct { 30 | PlayerID PlayerID `json:"playerId"` 31 | Messages []*PlayerMessage `json:"messages"` 32 | } 33 | 34 | // EventPlayerErrorsRaised send a list of any errors that need to be 35 | // delivered. 36 | // 37 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playerErrorsRaised 38 | type EventPlayerErrorsRaised struct { 39 | PlayerID PlayerID `json:"playerId"` 40 | Errors []*PlayerError `json:"errors"` 41 | } 42 | 43 | // EventPlayersCreated called whenever a player is created, or when a new 44 | // agent joins and receives a list of active players. If an agent is restored, 45 | // it will receive the full list of player ids and all events again. 46 | // 47 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#event-playersCreated 48 | type EventPlayersCreated struct { 49 | Players []PlayerID `json:"players"` 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/media/media.go: -------------------------------------------------------------------------------- 1 | // Package media provides the Chrome DevTools Protocol 2 | // commands, types, and events for the Media domain. 3 | // 4 | // This domain allows detailed inspection of media elements. 5 | // 6 | // Generated by the cdproto-gen command. 7 | package media 8 | 9 | // Code generated by cdproto-gen. DO NOT EDIT. 10 | 11 | import ( 12 | "context" 13 | 14 | "github.com/chromedp/cdproto/cdp" 15 | ) 16 | 17 | // EnableParams enables the Media domain. 18 | type EnableParams struct{} 19 | 20 | // Enable enables the Media domain. 21 | // 22 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#method-enable 23 | func Enable() *EnableParams { 24 | return &EnableParams{} 25 | } 26 | 27 | // Do executes Media.enable against the provided context. 28 | func (p *EnableParams) Do(ctx context.Context) (err error) { 29 | return cdp.Execute(ctx, CommandEnable, nil, nil) 30 | } 31 | 32 | // DisableParams disables the Media domain. 33 | type DisableParams struct{} 34 | 35 | // Disable disables the Media domain. 36 | // 37 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Media#method-disable 38 | func Disable() *DisableParams { 39 | return &DisableParams{} 40 | } 41 | 42 | // Do executes Media.disable against the provided context. 43 | func (p *DisableParams) Do(ctx context.Context) (err error) { 44 | return cdp.Execute(ctx, CommandDisable, nil, nil) 45 | } 46 | 47 | // Command names. 48 | const ( 49 | CommandEnable = "Media.enable" 50 | CommandDisable = "Media.disable" 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/overlay/events.go: -------------------------------------------------------------------------------- 1 | package overlay 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/cdp" 7 | "github.com/chromedp/cdproto/page" 8 | ) 9 | 10 | // EventInspectNodeRequested fired when the node should be inspected. This 11 | // happens after call to setInspectMode or when user manually inspects an 12 | // element. 13 | // 14 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#event-inspectNodeRequested 15 | type EventInspectNodeRequested struct { 16 | BackendNodeID cdp.BackendNodeID `json:"backendNodeId"` // Id of the node to inspect. 17 | } 18 | 19 | // EventNodeHighlightRequested fired when the node should be highlighted. 20 | // This happens after call to setInspectMode. 21 | // 22 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#event-nodeHighlightRequested 23 | type EventNodeHighlightRequested struct { 24 | NodeID cdp.NodeID `json:"nodeId"` 25 | } 26 | 27 | // EventScreenshotRequested fired when user asks to capture screenshot of 28 | // some area on the page. 29 | // 30 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#event-screenshotRequested 31 | type EventScreenshotRequested struct { 32 | Viewport *page.Viewport `json:"viewport"` // Viewport to capture, in device independent pixels (dip). 33 | } 34 | 35 | // EventInspectModeCanceled fired when user cancels the inspect mode. 36 | // 37 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Overlay#event-inspectModeCanceled 38 | type EventInspectModeCanceled struct{} 39 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/performance/events.go: -------------------------------------------------------------------------------- 1 | package performance 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventMetrics current values of the metrics. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#event-metrics 8 | type EventMetrics struct { 9 | Metrics []*Metric `json:"metrics"` // Current values of the metrics. 10 | Title string `json:"title"` // Timestamp title. 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/performance/types.go: -------------------------------------------------------------------------------- 1 | package performance 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "errors" 7 | 8 | "github.com/mailru/easyjson" 9 | "github.com/mailru/easyjson/jlexer" 10 | "github.com/mailru/easyjson/jwriter" 11 | ) 12 | 13 | // Metric run-time execution metric. 14 | // 15 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#type-Metric 16 | type Metric struct { 17 | Name string `json:"name"` // Metric name. 18 | Value float64 `json:"value"` // Metric value. 19 | } 20 | 21 | // EnableTimeDomain time domain to use for collecting and reporting duration 22 | // metrics. 23 | // 24 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Performance#method-enable 25 | type EnableTimeDomain string 26 | 27 | // String returns the EnableTimeDomain as string value. 28 | func (t EnableTimeDomain) String() string { 29 | return string(t) 30 | } 31 | 32 | // EnableTimeDomain values. 33 | const ( 34 | EnableTimeDomainTimeTicks EnableTimeDomain = "timeTicks" 35 | EnableTimeDomainThreadTicks EnableTimeDomain = "threadTicks" 36 | ) 37 | 38 | // MarshalEasyJSON satisfies easyjson.Marshaler. 39 | func (t EnableTimeDomain) MarshalEasyJSON(out *jwriter.Writer) { 40 | out.String(string(t)) 41 | } 42 | 43 | // MarshalJSON satisfies json.Marshaler. 44 | func (t EnableTimeDomain) MarshalJSON() ([]byte, error) { 45 | return easyjson.Marshal(t) 46 | } 47 | 48 | // UnmarshalEasyJSON satisfies easyjson.Unmarshaler. 49 | func (t *EnableTimeDomain) UnmarshalEasyJSON(in *jlexer.Lexer) { 50 | switch EnableTimeDomain(in.String()) { 51 | case EnableTimeDomainTimeTicks: 52 | *t = EnableTimeDomainTimeTicks 53 | case EnableTimeDomainThreadTicks: 54 | *t = EnableTimeDomainThreadTicks 55 | 56 | default: 57 | in.AddError(errors.New("unknown EnableTimeDomain value")) 58 | } 59 | } 60 | 61 | // UnmarshalJSON satisfies json.Unmarshaler. 62 | func (t *EnableTimeDomain) UnmarshalJSON(buf []byte) error { 63 | return easyjson.Unmarshal(buf, t) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/performancetimeline/events.go: -------------------------------------------------------------------------------- 1 | package performancetimeline 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventTimelineEventAdded sent when a performance timeline event is added. 6 | // See reportPerformanceTimeline method. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#event-timelineEventAdded 9 | type EventTimelineEventAdded struct { 10 | Event *TimelineEvent `json:"event"` 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/performancetimeline/performancetimeline.go: -------------------------------------------------------------------------------- 1 | // Package performancetimeline provides the Chrome DevTools Protocol 2 | // commands, types, and events for the PerformanceTimeline domain. 3 | // 4 | // Reporting of performance timeline events, as specified in 5 | // https://w3c.github.io/performance-timeline/#dom-performanceobserver. 6 | // 7 | // Generated by the cdproto-gen command. 8 | package performancetimeline 9 | 10 | // Code generated by cdproto-gen. DO NOT EDIT. 11 | 12 | import ( 13 | "context" 14 | 15 | "github.com/chromedp/cdproto/cdp" 16 | ) 17 | 18 | // EnableParams previously buffered events would be reported before method 19 | // returns. See also: timelineEventAdded. 20 | type EnableParams struct { 21 | EventTypes []string `json:"eventTypes"` // The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported. 22 | } 23 | 24 | // Enable previously buffered events would be reported before method returns. 25 | // See also: timelineEventAdded. 26 | // 27 | // See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#method-enable 28 | // 29 | // parameters: 30 | // eventTypes - The types of event to report, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype The specified filter overrides any previous filters, passing empty filter disables recording. Note that not all types exposed to the web platform are currently supported. 31 | func Enable(eventTypes []string) *EnableParams { 32 | return &EnableParams{ 33 | EventTypes: eventTypes, 34 | } 35 | } 36 | 37 | // Do executes PerformanceTimeline.enable against the provided context. 38 | func (p *EnableParams) Do(ctx context.Context) (err error) { 39 | return cdp.Execute(ctx, CommandEnable, p, nil) 40 | } 41 | 42 | // Command names. 43 | const ( 44 | CommandEnable = "PerformanceTimeline.enable" 45 | ) 46 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/profiler/events.go: -------------------------------------------------------------------------------- 1 | package profiler 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/debugger" 7 | ) 8 | 9 | // EventConsoleProfileFinished [no description]. 10 | // 11 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#event-consoleProfileFinished 12 | type EventConsoleProfileFinished struct { 13 | ID string `json:"id"` 14 | Location *debugger.Location `json:"location"` // Location of console.profileEnd(). 15 | Profile *Profile `json:"profile"` 16 | Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). 17 | } 18 | 19 | // EventConsoleProfileStarted sent when new profile recording is started 20 | // using console.profile() call. 21 | // 22 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#event-consoleProfileStarted 23 | type EventConsoleProfileStarted struct { 24 | ID string `json:"id"` 25 | Location *debugger.Location `json:"location"` // Location of console.profile(). 26 | Title string `json:"title,omitempty"` // Profile title passed as an argument to console.profile(). 27 | } 28 | 29 | // EventPreciseCoverageDeltaUpdate reports coverage delta since the last poll 30 | // (either from an event like this, or from takePreciseCoverage for the current 31 | // isolate. May only be sent if precise code coverage has been started. This 32 | // event can be trigged by the embedder to, for example, trigger collection of 33 | // coverage data immediately at a certain point in time. 34 | // 35 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#event-preciseCoverageDeltaUpdate 36 | type EventPreciseCoverageDeltaUpdate struct { 37 | Timestamp float64 `json:"timestamp"` // Monotonically increasing time (in seconds) when the coverage update was taken in the backend. 38 | Occasion string `json:"occasion"` // Identifier for distinguishing coverage events. 39 | Result []*ScriptCoverage `json:"result"` // Coverage data for the current isolate. 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/security/events.go: -------------------------------------------------------------------------------- 1 | package security 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventVisibleSecurityStateChanged the security state of the page changed. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Security#event-visibleSecurityStateChanged 8 | type EventVisibleSecurityStateChanged struct { 9 | VisibleSecurityState *VisibleSecurityState `json:"visibleSecurityState"` // Security state information about the page. 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/serviceworker/events.go: -------------------------------------------------------------------------------- 1 | package serviceworker 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventWorkerErrorReported [no description]. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerErrorReported 8 | type EventWorkerErrorReported struct { 9 | ErrorMessage *ErrorMessage `json:"errorMessage"` 10 | } 11 | 12 | // EventWorkerRegistrationUpdated [no description]. 13 | // 14 | // See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerRegistrationUpdated 15 | type EventWorkerRegistrationUpdated struct { 16 | Registrations []*Registration `json:"registrations"` 17 | } 18 | 19 | // EventWorkerVersionUpdated [no description]. 20 | // 21 | // See: https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker#event-workerVersionUpdated 22 | type EventWorkerVersionUpdated struct { 23 | Versions []*Version `json:"versions"` 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/storage/events.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventCacheStorageContentUpdated a cache's contents have been modified. 6 | // 7 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#event-cacheStorageContentUpdated 8 | type EventCacheStorageContentUpdated struct { 9 | Origin string `json:"origin"` // Origin to update. 10 | CacheName string `json:"cacheName"` // Name of cache in origin. 11 | } 12 | 13 | // EventCacheStorageListUpdated a cache has been added/deleted. 14 | // 15 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#event-cacheStorageListUpdated 16 | type EventCacheStorageListUpdated struct { 17 | Origin string `json:"origin"` // Origin to update. 18 | } 19 | 20 | // EventIndexedDBContentUpdated the origin's IndexedDB object store has been 21 | // modified. 22 | // 23 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#event-indexedDBContentUpdated 24 | type EventIndexedDBContentUpdated struct { 25 | Origin string `json:"origin"` // Origin to update. 26 | DatabaseName string `json:"databaseName"` // Database to update. 27 | ObjectStoreName string `json:"objectStoreName"` // ObjectStore to update. 28 | } 29 | 30 | // EventIndexedDBListUpdated the origin's IndexedDB database list has been 31 | // modified. 32 | // 33 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#event-indexedDBListUpdated 34 | type EventIndexedDBListUpdated struct { 35 | Origin string `json:"origin"` // Origin to update. 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/target/types.go: -------------------------------------------------------------------------------- 1 | package target 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/cdp" 7 | ) 8 | 9 | // ID [no description]. 10 | // 11 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-TargetID 12 | type ID string 13 | 14 | // String returns the ID as string value. 15 | func (t ID) String() string { 16 | return string(t) 17 | } 18 | 19 | // SessionID unique identifier of attached debugging session. 20 | // 21 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-SessionID 22 | type SessionID string 23 | 24 | // String returns the SessionID as string value. 25 | func (t SessionID) String() string { 26 | return string(t) 27 | } 28 | 29 | // Info [no description]. 30 | // 31 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-TargetInfo 32 | type Info struct { 33 | TargetID ID `json:"targetId"` 34 | Type string `json:"type"` 35 | Title string `json:"title"` 36 | URL string `json:"url"` 37 | Attached bool `json:"attached"` // Whether the target has an attached client. 38 | OpenerID ID `json:"openerId,omitempty"` // Opener target Id 39 | CanAccessOpener bool `json:"canAccessOpener"` // Whether the target has access to the originating window. 40 | OpenerFrameID cdp.FrameID `json:"openerFrameId,omitempty"` // Frame id of originating window (is only set if target has an opener). 41 | BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty"` 42 | } 43 | 44 | // RemoteLocation [no description]. 45 | // 46 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Target#type-RemoteLocation 47 | type RemoteLocation struct { 48 | Host string `json:"host"` 49 | Port int64 `json:"port"` 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/tethering/events.go: -------------------------------------------------------------------------------- 1 | package tethering 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | // EventAccepted informs that port was successfully bound and got a specified 6 | // connection id. 7 | // 8 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#event-accepted 9 | type EventAccepted struct { 10 | Port int64 `json:"port"` // Port number that was successfully bound. 11 | ConnectionID string `json:"connectionId"` // Connection id to be used. 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/tethering/tethering.go: -------------------------------------------------------------------------------- 1 | // Package tethering provides the Chrome DevTools Protocol 2 | // commands, types, and events for the Tethering domain. 3 | // 4 | // The Tethering domain defines methods and events for browser port binding. 5 | // 6 | // Generated by the cdproto-gen command. 7 | package tethering 8 | 9 | // Code generated by cdproto-gen. DO NOT EDIT. 10 | 11 | import ( 12 | "context" 13 | 14 | "github.com/chromedp/cdproto/cdp" 15 | ) 16 | 17 | // BindParams request browser port binding. 18 | type BindParams struct { 19 | Port int64 `json:"port"` // Port number to bind. 20 | } 21 | 22 | // Bind request browser port binding. 23 | // 24 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-bind 25 | // 26 | // parameters: 27 | // port - Port number to bind. 28 | func Bind(port int64) *BindParams { 29 | return &BindParams{ 30 | Port: port, 31 | } 32 | } 33 | 34 | // Do executes Tethering.bind against the provided context. 35 | func (p *BindParams) Do(ctx context.Context) (err error) { 36 | return cdp.Execute(ctx, CommandBind, p, nil) 37 | } 38 | 39 | // UnbindParams request browser port unbinding. 40 | type UnbindParams struct { 41 | Port int64 `json:"port"` // Port number to unbind. 42 | } 43 | 44 | // Unbind request browser port unbinding. 45 | // 46 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tethering#method-unbind 47 | // 48 | // parameters: 49 | // port - Port number to unbind. 50 | func Unbind(port int64) *UnbindParams { 51 | return &UnbindParams{ 52 | Port: port, 53 | } 54 | } 55 | 56 | // Do executes Tethering.unbind against the provided context. 57 | func (p *UnbindParams) Do(ctx context.Context) (err error) { 58 | return cdp.Execute(ctx, CommandUnbind, p, nil) 59 | } 60 | 61 | // Command names. 62 | const ( 63 | CommandBind = "Tethering.bind" 64 | CommandUnbind = "Tethering.unbind" 65 | ) 66 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/cdproto/tracing/events.go: -------------------------------------------------------------------------------- 1 | package tracing 2 | 3 | // Code generated by cdproto-gen. DO NOT EDIT. 4 | 5 | import ( 6 | "github.com/chromedp/cdproto/io" 7 | "github.com/mailru/easyjson" 8 | ) 9 | 10 | // EventBufferUsage [no description]. 11 | // 12 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-bufferUsage 13 | type EventBufferUsage struct { 14 | PercentFull float64 `json:"percentFull,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. 15 | EventCount float64 `json:"eventCount,omitempty"` // An approximate number of events in the trace log. 16 | Value float64 `json:"value,omitempty"` // A number in range [0..1] that indicates the used size of event buffer as a fraction of its total size. 17 | } 18 | 19 | // EventDataCollected contains an bucket of collected trace events. When 20 | // tracing is stopped collected events will be send as a sequence of 21 | // dataCollected events followed by tracingComplete event. 22 | // 23 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-dataCollected 24 | type EventDataCollected struct { 25 | Value []easyjson.RawMessage `json:"value"` 26 | } 27 | 28 | // EventTracingComplete signals that tracing is stopped and there is no trace 29 | // buffers pending flush, all data were delivered via dataCollected events. 30 | // 31 | // See: https://chromedevtools.github.io/devtools-protocol/tot/Tracing#event-tracingComplete 32 | type EventTracingComplete struct { 33 | DataLossOccurred bool `json:"dataLossOccurred"` // Indicates whether some trace data is known to have been lost, e.g. because the trace ring buffer wrapped around. 34 | Stream io.StreamHandle `json:"stream,omitempty"` // A handle of the stream that holds resulting trace data. 35 | TraceFormat StreamFormat `json:"traceFormat,omitempty"` // Trace data format of returned stream. 36 | StreamCompression StreamCompression `json:"streamCompression,omitempty"` // Compression format of returned stream. 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/chromedp/.gitignore: -------------------------------------------------------------------------------- 1 | out.txt 2 | out*.txt 3 | old*.txt 4 | cdp-*.log 5 | cdp-*.txt 6 | *.out 7 | 8 | /chromedp.test 9 | /chromedp.test.exe 10 | 11 | /*.jpeg 12 | /*.png 13 | /*.pdf 14 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/chromedp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2020 Kenneth Shaw 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/chromedp/chromedp/allocate_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package chromedp 4 | 5 | import ( 6 | "os" 7 | "os/exec" 8 | "syscall" 9 | ) 10 | 11 | func allocateCmdOptions(cmd *exec.Cmd) { 12 | if _, ok := os.LookupEnv("LAMBDA_TASK_ROOT"); ok { 13 | // do nothing on AWS Lambda 14 | return 15 | } 16 | if cmd.SysProcAttr == nil { 17 | cmd.SysProcAttr = new(syscall.SysProcAttr) 18 | } 19 | // When the parent process dies (Go), kill the child as well. 20 | cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/chromedp/allocate_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package chromedp 4 | 5 | import "os/exec" 6 | 7 | func allocateCmdOptions(cmd *exec.Cmd) { 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/chromedp/device/types.go: -------------------------------------------------------------------------------- 1 | // Package device contains device emulation definitions for use with chromedp's 2 | // Emulate action. 3 | package device 4 | 5 | //go:generate go run gen.go 6 | 7 | // Info holds device information for use with chromedp.Emulate. 8 | type Info struct { 9 | // Name is the device name. 10 | Name string 11 | 12 | // UserAgent is the device user agent string. 13 | UserAgent string 14 | 15 | // Width is the viewport width. 16 | Width int64 17 | 18 | // Height is the viewport height. 19 | Height int64 20 | 21 | // Scale is the device viewport scale factor. 22 | Scale float64 23 | 24 | // Landscape indicates whether or not the device is in landscape mode or 25 | // not. 26 | Landscape bool 27 | 28 | // Mobile indicates whether it is a mobile device or not. 29 | Mobile bool 30 | 31 | // Touch indicates whether the device has touch enabled. 32 | Touch bool 33 | } 34 | 35 | // String satisfies fmt.Stringer. 36 | func (i Info) String() string { 37 | return i.Name 38 | } 39 | 40 | // Device satisfies chromedp.Device. 41 | func (i Info) Device() Info { 42 | return i 43 | } 44 | 45 | // infoType provides the enumerated device type. 46 | type infoType int 47 | 48 | // String satisfies fmt.Stringer. 49 | func (i infoType) String() string { 50 | return devices[i].String() 51 | } 52 | 53 | // Device satisfies chromedp.Device. 54 | func (i infoType) Device() Info { 55 | return devices[i] 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/chromedp/errors.go: -------------------------------------------------------------------------------- 1 | package chromedp 2 | 3 | // Error is a chromedp error. 4 | type Error string 5 | 6 | // Error satisfies the error interface. 7 | func (err Error) Error() string { 8 | return string(err) 9 | } 10 | 11 | // Error types. 12 | const ( 13 | // ErrInvalidWebsocketMessage is the invalid websocket message. 14 | ErrInvalidWebsocketMessage Error = "invalid websocket message" 15 | 16 | // ErrInvalidDimensions is the invalid dimensions error. 17 | ErrInvalidDimensions Error = "invalid dimensions" 18 | 19 | // ErrNoResults is the no results error. 20 | ErrNoResults Error = "no results" 21 | 22 | // ErrHasResults is the has results error. 23 | ErrHasResults Error = "has results" 24 | 25 | // ErrNotVisible is the not visible error. 26 | ErrNotVisible Error = "not visible" 27 | 28 | // ErrVisible is the visible error. 29 | ErrVisible Error = "visible" 30 | 31 | // ErrDisabled is the disabled error. 32 | ErrDisabled Error = "disabled" 33 | 34 | // ErrNotSelected is the not selected error. 35 | ErrNotSelected Error = "not selected" 36 | 37 | // ErrInvalidBoxModel is the invalid box model error. 38 | ErrInvalidBoxModel Error = "invalid box model" 39 | 40 | // ErrChannelClosed is the channel closed error. 41 | ErrChannelClosed Error = "channel closed" 42 | 43 | // ErrInvalidTarget is the invalid target error. 44 | ErrInvalidTarget Error = "invalid target" 45 | 46 | // ErrInvalidContext is the invalid context error. 47 | ErrInvalidContext Error = "invalid context" 48 | 49 | // ErrPollingTimeout is the error that the timeout reached before the pageFunction returns a truthy value. 50 | ErrPollingTimeout Error = "waiting for function failed: timeout" 51 | ) 52 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/.travis.yml: -------------------------------------------------------------------------------- 1 | dist: bionic 2 | language: go 3 | go: 4 | - 1.13.x 5 | script: 6 | - go test -v -coverprofile=coverage.out 7 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2017 Kenneth Shaw 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/chromedp/sysutil/README.md: -------------------------------------------------------------------------------- 1 | # About sysutil 2 | 3 | Package sysutil provides some utilities for working with cross platform 4 | systems. 5 | 6 | Inspired by the Go version of Sigar, but written to be "idiomatic" Go. 7 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/sysutil.go: -------------------------------------------------------------------------------- 1 | package sysutil 2 | 3 | import "time" 4 | 5 | var btime time.Time 6 | 7 | // BootTime returns the time the system was started. 8 | func BootTime() time.Time { 9 | return btime 10 | } 11 | 12 | // Uptime returns the duration the system has been up. 13 | func Uptime() time.Duration { 14 | return time.Now().Sub(btime) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/sysutil_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd 2 | 3 | package sysutil 4 | 5 | import ( 6 | "bytes" 7 | "encoding/binary" 8 | "syscall" 9 | "time" 10 | ) 11 | 12 | func init() { 13 | // get boot time 14 | res, err := syscall.Sysctl("kern.boottime") 15 | if err != nil { 16 | btime = time.Now() 17 | return 18 | } 19 | // decode 20 | var t timeval 21 | if err = binary.Read(bytes.NewBuffer([]byte(res)), binary.LittleEndian, &t); err != nil { 22 | btime = time.Now() 23 | return 24 | } 25 | btime = time.Unix(int64(t.Sec), int64(t.Usec)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/sysutil_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package sysutil 4 | 5 | import ( 6 | "bytes" 7 | "io/ioutil" 8 | "strconv" 9 | "time" 10 | ) 11 | 12 | var ( 13 | btimePrefix = []byte("btime ") 14 | lineEnd = []byte("\n") 15 | ) 16 | 17 | func init() { 18 | buf, err := ioutil.ReadFile("/proc/stat") 19 | if err != nil { 20 | btime = time.Now() 21 | return 22 | } 23 | for _, line := range bytes.SplitN(buf, lineEnd, -1) { 24 | if bytes.HasPrefix(line, btimePrefix) { 25 | t, err := strconv.ParseInt(string(line[len(btimePrefix):]), 10, 64) 26 | if err != nil { 27 | btime = time.Now() 28 | return 29 | } 30 | btime = time.Unix(t, 0) 31 | break 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/sysutil_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!darwin,!freebsd,!openbsd,!netbsd 2 | 3 | package sysutil 4 | 5 | import "time" 6 | 7 | func init() { 8 | btime = time.Now() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/sysutil_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package sysutil 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | var ( 11 | kernel32DLL = syscall.MustLoadDLL("kernel32") 12 | procGetTickCount64 = kernel32DLL.MustFindProc("GetTickCount64") 13 | ) 14 | 15 | func init() { 16 | res, _, err := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0) 17 | if err != 0 { 18 | btime = time.Now() 19 | return 20 | } 21 | btime = time.Now().Add(time.Duration(-res) * time.Millisecond) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/timeval.go: -------------------------------------------------------------------------------- 1 | // +build openbsd netbsd 2 | 3 | package sysutil 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | type timeval syscall.Timeval 10 | -------------------------------------------------------------------------------- /vendor/github.com/chromedp/sysutil/timeval32.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package sysutil 4 | 5 | type timeval struct { 6 | Sec int32 7 | Usec int32 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/httphead/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Sergey Kamardin 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/gobwas/httphead/README.md: -------------------------------------------------------------------------------- 1 | # httphead.[go](https://golang.org) 2 | 3 | [![GoDoc][godoc-image]][godoc-url] 4 | 5 | > Tiny HTTP header value parsing library in go. 6 | 7 | ## Overview 8 | 9 | This library contains low-level functions for scanning HTTP RFC2616 compatible header value grammars. 10 | 11 | ## Install 12 | 13 | ```shell 14 | go get github.com/gobwas/httphead 15 | ``` 16 | 17 | ## Example 18 | 19 | The example below shows how multiple-choise HTTP header value could be parsed with this library: 20 | 21 | ```go 22 | options, ok := httphead.ParseOptions([]byte(`foo;bar=1,baz`), nil) 23 | fmt.Println(options, ok) 24 | // Output: [{foo map[bar:1]} {baz map[]}] true 25 | ``` 26 | 27 | The low-level example below shows how to optimize keys skipping and selection 28 | of some key: 29 | 30 | ```go 31 | // The right part of full header line like: 32 | // X-My-Header: key;foo=bar;baz,key;baz 33 | header := []byte(`foo;a=0,foo;a=1,foo;a=2,foo;a=3`) 34 | 35 | // We want to search key "foo" with an "a" parameter that equal to "2". 36 | var ( 37 | foo = []byte(`foo`) 38 | a = []byte(`a`) 39 | v = []byte(`2`) 40 | ) 41 | var found bool 42 | httphead.ScanOptions(header, func(i int, key, param, value []byte) Control { 43 | if !bytes.Equal(key, foo) { 44 | return ControlSkip 45 | } 46 | if !bytes.Equal(param, a) { 47 | if bytes.Equal(value, v) { 48 | // Found it! 49 | found = true 50 | return ControlBreak 51 | } 52 | return ControlSkip 53 | } 54 | return ControlContinue 55 | }) 56 | ``` 57 | 58 | For more usage examples please see [docs][godoc-url] or package tests. 59 | 60 | [godoc-image]: https://godoc.org/github.com/gobwas/httphead?status.svg 61 | [godoc-url]: https://godoc.org/github.com/gobwas/httphead 62 | [travis-image]: https://travis-ci.org/gobwas/httphead.svg?branch=master 63 | [travis-url]: https://travis-ci.org/gobwas/httphead 64 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2019 Sergey Kamardin 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/gobwas/pool/internal/pmath/pmath.go: -------------------------------------------------------------------------------- 1 | package pmath 2 | 3 | const ( 4 | bitsize = 32 << (^uint(0) >> 63) 5 | maxint = int(1<<(bitsize-1) - 1) 6 | maxintHeadBit = 1 << (bitsize - 2) 7 | ) 8 | 9 | // LogarithmicRange iterates from ceiled to power of two min to max, 10 | // calling cb on each iteration. 11 | func LogarithmicRange(min, max int, cb func(int)) { 12 | if min == 0 { 13 | min = 1 14 | } 15 | for n := CeilToPowerOfTwo(min); n <= max; n <<= 1 { 16 | cb(n) 17 | } 18 | } 19 | 20 | // IsPowerOfTwo reports whether given integer is a power of two. 21 | func IsPowerOfTwo(n int) bool { 22 | return n&(n-1) == 0 23 | } 24 | 25 | // Identity is identity. 26 | func Identity(n int) int { 27 | return n 28 | } 29 | 30 | // CeilToPowerOfTwo returns the least power of two integer value greater than 31 | // or equal to n. 32 | func CeilToPowerOfTwo(n int) int { 33 | if n&maxintHeadBit != 0 && n > maxintHeadBit { 34 | panic("argument is too large") 35 | } 36 | if n <= 2 { 37 | return n 38 | } 39 | n-- 40 | n = fillBits(n) 41 | n++ 42 | return n 43 | } 44 | 45 | // FloorToPowerOfTwo returns the greatest power of two integer value less than 46 | // or equal to n. 47 | func FloorToPowerOfTwo(n int) int { 48 | if n <= 2 { 49 | return n 50 | } 51 | n = fillBits(n) 52 | n >>= 1 53 | n++ 54 | return n 55 | } 56 | 57 | func fillBits(n int) int { 58 | n |= n >> 1 59 | n |= n >> 2 60 | n |= n >> 4 61 | n |= n >> 8 62 | n |= n >> 16 63 | n |= n >> 32 64 | return n 65 | } 66 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/option.go: -------------------------------------------------------------------------------- 1 | package pool 2 | 3 | import "github.com/gobwas/pool/internal/pmath" 4 | 5 | // Option configures pool. 6 | type Option func(Config) 7 | 8 | // Config describes generic pool configuration. 9 | type Config interface { 10 | AddSize(n int) 11 | SetSizeMapping(func(int) int) 12 | } 13 | 14 | // WithSizeLogRange returns an Option that will add logarithmic range of 15 | // pooling sizes containing [min, max] values. 16 | func WithLogSizeRange(min, max int) Option { 17 | return func(c Config) { 18 | pmath.LogarithmicRange(min, max, func(n int) { 19 | c.AddSize(n) 20 | }) 21 | } 22 | } 23 | 24 | // WithSize returns an Option that will add given pooling size to the pool. 25 | func WithSize(n int) Option { 26 | return func(c Config) { 27 | c.AddSize(n) 28 | } 29 | } 30 | 31 | func WithSizeMapping(sz func(int) int) Option { 32 | return func(c Config) { 33 | c.SetSizeMapping(sz) 34 | } 35 | } 36 | 37 | func WithLogSizeMapping() Option { 38 | return WithSizeMapping(pmath.CeilToPowerOfTwo) 39 | } 40 | 41 | func WithIdentitySizeMapping() Option { 42 | return WithSizeMapping(pmath.Identity) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/pbufio/pbufio_go110.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package pbufio 4 | 5 | import "bufio" 6 | 7 | func writerSize(bw *bufio.Writer) int { 8 | return bw.Size() 9 | } 10 | 11 | func readerSize(br *bufio.Reader) int { 12 | return br.Size() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/pbufio/pbufio_go19.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package pbufio 4 | 5 | import "bufio" 6 | 7 | func writerSize(bw *bufio.Writer) int { 8 | return bw.Available() + bw.Buffered() 9 | } 10 | 11 | // readerSize returns buffer size of the given buffered reader. 12 | // NOTE: current workaround implementation resets underlying io.Reader. 13 | func readerSize(br *bufio.Reader) int { 14 | br.Reset(sizeReader) 15 | br.ReadByte() 16 | n := br.Buffered() + 1 17 | br.Reset(nil) 18 | return n 19 | } 20 | 21 | var sizeReader optimisticReader 22 | 23 | type optimisticReader struct{} 24 | 25 | func (optimisticReader) Read(p []byte) (int, error) { 26 | return len(p), nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/pbytes/pbytes.go: -------------------------------------------------------------------------------- 1 | // Package pbytes contains tools for pooling byte pool. 2 | // Note that by default it reuse slices with capacity from 128 to 65536 bytes. 3 | package pbytes 4 | 5 | // DefaultPool is used by pacakge level functions. 6 | var DefaultPool = New(128, 65536) 7 | 8 | // Get returns probably reused slice of bytes with at least capacity of c and 9 | // exactly len of n. 10 | // Get is a wrapper around DefaultPool.Get(). 11 | func Get(n, c int) []byte { return DefaultPool.Get(n, c) } 12 | 13 | // GetCap returns probably reused slice of bytes with at least capacity of n. 14 | // GetCap is a wrapper around DefaultPool.GetCap(). 15 | func GetCap(c int) []byte { return DefaultPool.GetCap(c) } 16 | 17 | // GetLen returns probably reused slice of bytes with at least capacity of n 18 | // and exactly len of n. 19 | // GetLen is a wrapper around DefaultPool.GetLen(). 20 | func GetLen(n int) []byte { return DefaultPool.GetLen(n) } 21 | 22 | // Put returns given slice to reuse pool. 23 | // Put is a wrapper around DefaultPool.Put(). 24 | func Put(p []byte) { DefaultPool.Put(p) } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/pbytes/pool.go: -------------------------------------------------------------------------------- 1 | // +build !pool_sanitize 2 | 3 | package pbytes 4 | 5 | import "github.com/gobwas/pool" 6 | 7 | // Pool contains logic of reusing byte slices of various size. 8 | type Pool struct { 9 | pool *pool.Pool 10 | } 11 | 12 | // New creates new Pool that reuses slices which size is in logarithmic range 13 | // [min, max]. 14 | // 15 | // Note that it is a shortcut for Custom() constructor with Options provided by 16 | // pool.WithLogSizeMapping() and pool.WithLogSizeRange(min, max) calls. 17 | func New(min, max int) *Pool { 18 | return &Pool{pool.New(min, max)} 19 | } 20 | 21 | // New creates new Pool with given options. 22 | func Custom(opts ...pool.Option) *Pool { 23 | return &Pool{pool.Custom(opts...)} 24 | } 25 | 26 | // Get returns probably reused slice of bytes with at least capacity of c and 27 | // exactly len of n. 28 | func (p *Pool) Get(n, c int) []byte { 29 | if n > c { 30 | panic("requested length is greater than capacity") 31 | } 32 | 33 | v, x := p.pool.Get(c) 34 | if v != nil { 35 | bts := v.([]byte) 36 | bts = bts[:n] 37 | return bts 38 | } 39 | 40 | return make([]byte, n, x) 41 | } 42 | 43 | // Put returns given slice to reuse pool. 44 | // It does not reuse bytes whose size is not power of two or is out of pool 45 | // min/max range. 46 | func (p *Pool) Put(bts []byte) { 47 | p.pool.Put(bts, cap(bts)) 48 | } 49 | 50 | // GetCap returns probably reused slice of bytes with at least capacity of n. 51 | func (p *Pool) GetCap(c int) []byte { 52 | return p.Get(0, c) 53 | } 54 | 55 | // GetLen returns probably reused slice of bytes with at least capacity of n 56 | // and exactly len of n. 57 | func (p *Pool) GetLen(n int) []byte { 58 | return p.Get(n, n) 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/pool/pool.go: -------------------------------------------------------------------------------- 1 | // Package pool contains helpers for pooling structures distinguishable by 2 | // size. 3 | // 4 | // Quick example: 5 | // 6 | // import "github.com/gobwas/pool" 7 | // 8 | // func main() { 9 | // // Reuse objects in logarithmic range from 0 to 64 (0,1,2,4,6,8,16,32,64). 10 | // p := pool.New(0, 64) 11 | // 12 | // buf, n := p.Get(10) // Returns buffer with 16 capacity. 13 | // if buf == nil { 14 | // buf = bytes.NewBuffer(make([]byte, n)) 15 | // } 16 | // defer p.Put(buf, n) 17 | // 18 | // // Work with buf. 19 | // } 20 | // 21 | // There are non-generic implementations for pooling: 22 | // - pool/pbytes for []byte reuse; 23 | // - pool/pbufio for *bufio.Reader and *bufio.Writer reuse; 24 | // 25 | package pool 26 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | reports/ 3 | cpu.out 4 | mem.out 5 | ws.test 6 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2021 Sergey Kamardin 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/gobwas/ws/Makefile: -------------------------------------------------------------------------------- 1 | BENCH ?=. 2 | BENCH_BASE?=master 3 | 4 | clean: 5 | rm -f bin/reporter 6 | rm -fr autobahn/report/* 7 | 8 | bin/reporter: 9 | go build -o bin/reporter ./autobahn 10 | 11 | bin/gocovmerge: 12 | go build -o bin/gocovmerge github.com/wadey/gocovmerge 13 | 14 | .PHONY: autobahn 15 | autobahn: clean bin/reporter 16 | ./autobahn/script/test.sh --build --follow-logs 17 | bin/reporter $(PWD)/autobahn/report/index.json 18 | 19 | .PHONY: autobahn/report 20 | autobahn/report: bin/reporter 21 | ./bin/reporter -http localhost:5555 ./autobahn/report/index.json 22 | 23 | test: 24 | go test -coverprofile=ws.coverage . 25 | go test -coverprofile=wsutil.coverage ./wsutil 26 | go test -coverprofile=wsfalte.coverage ./wsflate 27 | # No statemenets to cover in ./tests (there are only tests). 28 | go test ./tests 29 | 30 | cover: bin/gocovmerge test autobahn 31 | bin/gocovmerge ws.coverage wsutil.coverage wsflate.coverage autobahn/report/server.coverage > total.coverage 32 | 33 | benchcmp: BENCH_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) 34 | benchcmp: BENCH_OLD:=$(shell mktemp -t old.XXXX) 35 | benchcmp: BENCH_NEW:=$(shell mktemp -t new.XXXX) 36 | benchcmp: 37 | if [ ! -z "$(shell git status -s)" ]; then\ 38 | echo "could not compare with $(BENCH_BASE) – found unstaged changes";\ 39 | exit 1;\ 40 | fi;\ 41 | if [ "$(BENCH_BRANCH)" == "$(BENCH_BASE)" ]; then\ 42 | echo "comparing the same branches";\ 43 | exit 1;\ 44 | fi;\ 45 | echo "benchmarking $(BENCH_BRANCH)...";\ 46 | go test -run=none -bench=$(BENCH) -benchmem > $(BENCH_NEW);\ 47 | echo "benchmarking $(BENCH_BASE)...";\ 48 | git checkout -q $(BENCH_BASE);\ 49 | go test -run=none -bench=$(BENCH) -benchmem > $(BENCH_OLD);\ 50 | git checkout -q $(BENCH_BRANCH);\ 51 | echo "\nresults:";\ 52 | echo "========\n";\ 53 | benchcmp $(BENCH_OLD) $(BENCH_NEW);\ 54 | 55 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/cipher.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | import ( 4 | "encoding/binary" 5 | ) 6 | 7 | // Cipher applies XOR cipher to the payload using mask. 8 | // Offset is used to cipher chunked data (e.g. in io.Reader implementations). 9 | // 10 | // To convert masked data into unmasked data, or vice versa, the following 11 | // algorithm is applied. The same algorithm applies regardless of the 12 | // direction of the translation, e.g., the same steps are applied to 13 | // mask the data as to unmask the data. 14 | func Cipher(payload []byte, mask [4]byte, offset int) { 15 | n := len(payload) 16 | if n < 8 { 17 | for i := 0; i < n; i++ { 18 | payload[i] ^= mask[(offset+i)%4] 19 | } 20 | return 21 | } 22 | 23 | // Calculate position in mask due to previously processed bytes number. 24 | mpos := offset % 4 25 | // Count number of bytes will processed one by one from the beginning of payload. 26 | ln := remain[mpos] 27 | // Count number of bytes will processed one by one from the end of payload. 28 | // This is done to process payload by 8 bytes in each iteration of main loop. 29 | rn := (n - ln) % 8 30 | 31 | for i := 0; i < ln; i++ { 32 | payload[i] ^= mask[(mpos+i)%4] 33 | } 34 | for i := n - rn; i < n; i++ { 35 | payload[i] ^= mask[(mpos+i)%4] 36 | } 37 | 38 | // NOTE: we use here binary.LittleEndian regardless of what is real 39 | // endianness on machine is. To do so, we have to use binary.LittleEndian in 40 | // the masking loop below as well. 41 | var ( 42 | m = binary.LittleEndian.Uint32(mask[:]) 43 | m2 = uint64(m)<<32 | uint64(m) 44 | ) 45 | // Skip already processed right part. 46 | // Get number of uint64 parts remaining to process. 47 | n = (n - ln - rn) >> 3 48 | for i := 0; i < n; i++ { 49 | var ( 50 | j = ln + (i << 3) 51 | chunk = payload[j : j+8] 52 | ) 53 | p := binary.LittleEndian.Uint64(chunk) 54 | p = p ^ m2 55 | binary.LittleEndian.PutUint64(chunk, p) 56 | } 57 | } 58 | 59 | // remain maps position in masking key [0,4) to number 60 | // of bytes that need to be processed manually inside Cipher(). 61 | var remain = [4]int{0, 3, 2, 1} 62 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/dialer_tls_go17.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package ws 4 | 5 | import "crypto/tls" 6 | 7 | func tlsCloneConfig(c *tls.Config) *tls.Config { 8 | // NOTE: we copying SessionTicketsDisabled and SessionTicketKey here 9 | // without calling inner c.initOnceServer somehow because we only could get 10 | // here from the ws.Dialer code, which is obviously a client and makes 11 | // tls.Client() when it gets new net.Conn. 12 | return &tls.Config{ 13 | Rand: c.Rand, 14 | Time: c.Time, 15 | Certificates: c.Certificates, 16 | NameToCertificate: c.NameToCertificate, 17 | GetCertificate: c.GetCertificate, 18 | RootCAs: c.RootCAs, 19 | NextProtos: c.NextProtos, 20 | ServerName: c.ServerName, 21 | ClientAuth: c.ClientAuth, 22 | ClientCAs: c.ClientCAs, 23 | InsecureSkipVerify: c.InsecureSkipVerify, 24 | CipherSuites: c.CipherSuites, 25 | PreferServerCipherSuites: c.PreferServerCipherSuites, 26 | SessionTicketsDisabled: c.SessionTicketsDisabled, 27 | SessionTicketKey: c.SessionTicketKey, 28 | ClientSessionCache: c.ClientSessionCache, 29 | MinVersion: c.MinVersion, 30 | MaxVersion: c.MaxVersion, 31 | CurvePreferences: c.CurvePreferences, 32 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 33 | Renegotiation: c.Renegotiation, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/dialer_tls_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package ws 4 | 5 | import "crypto/tls" 6 | 7 | func tlsCloneConfig(c *tls.Config) *tls.Config { 8 | return c.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package ws implements a client and server for the WebSocket protocol as 3 | specified in RFC 6455. 4 | 5 | The main purpose of this package is to provide simple low-level API for 6 | efficient work with protocol. 7 | 8 | Overview. 9 | 10 | Upgrade to WebSocket (or WebSocket handshake) can be done in two ways. 11 | 12 | The first way is to use `net/http` server: 13 | 14 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 15 | conn, _, _, err := ws.UpgradeHTTP(r, w) 16 | }) 17 | 18 | The second and much more efficient way is so-called "zero-copy upgrade". It 19 | avoids redundant allocations and copying of not used headers or other request 20 | data. User decides by himself which data should be copied. 21 | 22 | ln, err := net.Listen("tcp", ":8080") 23 | if err != nil { 24 | // handle error 25 | } 26 | 27 | conn, err := ln.Accept() 28 | if err != nil { 29 | // handle error 30 | } 31 | 32 | handshake, err := ws.Upgrade(conn) 33 | if err != nil { 34 | // handle error 35 | } 36 | 37 | For customization details see `ws.Upgrader` documentation. 38 | 39 | After WebSocket handshake you can work with connection in multiple ways. 40 | That is, `ws` does not force the only one way of how to work with WebSocket: 41 | 42 | header, err := ws.ReadHeader(conn) 43 | if err != nil { 44 | // handle err 45 | } 46 | 47 | buf := make([]byte, header.Length) 48 | _, err := io.ReadFull(conn, buf) 49 | if err != nil { 50 | // handle err 51 | } 52 | 53 | resp := ws.NewBinaryFrame([]byte("hello, world!")) 54 | if err := ws.WriteFrame(conn, frame); err != nil { 55 | // handle err 56 | } 57 | 58 | As you can see, it stream friendly: 59 | 60 | const N = 42 61 | 62 | ws.WriteHeader(ws.Header{ 63 | Fin: true, 64 | Length: N, 65 | OpCode: ws.OpBinary, 66 | }) 67 | 68 | io.CopyN(conn, rand.Reader, N) 69 | 70 | Or: 71 | 72 | header, err := ws.ReadHeader(conn) 73 | if err != nil { 74 | // handle err 75 | } 76 | 77 | io.CopyN(ioutil.Discard, conn, header.Length) 78 | 79 | For more info see the documentation. 80 | */ 81 | package ws 82 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/errors.go: -------------------------------------------------------------------------------- 1 | package ws 2 | 3 | // RejectOption represents an option used to control the way connection is 4 | // rejected. 5 | type RejectOption func(*ConnectionRejectedError) 6 | 7 | // RejectionReason returns an option that makes connection to be rejected with 8 | // given reason. 9 | func RejectionReason(reason string) RejectOption { 10 | return func(err *ConnectionRejectedError) { 11 | err.reason = reason 12 | } 13 | } 14 | 15 | // RejectionStatus returns an option that makes connection to be rejected with 16 | // given HTTP status code. 17 | func RejectionStatus(code int) RejectOption { 18 | return func(err *ConnectionRejectedError) { 19 | err.code = code 20 | } 21 | } 22 | 23 | // RejectionHeader returns an option that makes connection to be rejected with 24 | // given HTTP headers. 25 | func RejectionHeader(h HandshakeHeader) RejectOption { 26 | return func(err *ConnectionRejectedError) { 27 | err.header = h 28 | } 29 | } 30 | 31 | // RejectConnectionError constructs an error that could be used to control the 32 | // way handshake is rejected by Upgrader. 33 | func RejectConnectionError(options ...RejectOption) error { 34 | err := new(ConnectionRejectedError) 35 | for _, opt := range options { 36 | opt(err) 37 | } 38 | return err 39 | } 40 | 41 | // ConnectionRejectedError represents a rejection of connection during 42 | // WebSocket handshake error. 43 | // 44 | // It can be returned by Upgrader's On* hooks to indicate that WebSocket 45 | // handshake should be rejected. 46 | type ConnectionRejectedError struct { 47 | reason string 48 | code int 49 | header HandshakeHeader 50 | } 51 | 52 | // Error implements error interface. 53 | func (r *ConnectionRejectedError) Error() string { 54 | return r.reason 55 | } 56 | 57 | func (r *ConnectionRejectedError) StatusCode() int { 58 | return r.code 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/server_test.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiecat/sylas/ccca9c5f10c24d4d62028f2b8619efe554839943/vendor/github.com/gobwas/ws/server_test.s -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/wsutil/cipher.go: -------------------------------------------------------------------------------- 1 | package wsutil 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/gobwas/pool/pbytes" 7 | "github.com/gobwas/ws" 8 | ) 9 | 10 | // CipherReader implements io.Reader that applies xor-cipher to the bytes read 11 | // from source. 12 | // It could help to unmask WebSocket frame payload on the fly. 13 | type CipherReader struct { 14 | r io.Reader 15 | mask [4]byte 16 | pos int 17 | } 18 | 19 | // NewCipherReader creates xor-cipher reader from r with given mask. 20 | func NewCipherReader(r io.Reader, mask [4]byte) *CipherReader { 21 | return &CipherReader{r, mask, 0} 22 | } 23 | 24 | // Reset resets CipherReader to read from r with given mask. 25 | func (c *CipherReader) Reset(r io.Reader, mask [4]byte) { 26 | c.r = r 27 | c.mask = mask 28 | c.pos = 0 29 | } 30 | 31 | // Read implements io.Reader interface. It applies mask given during 32 | // initialization to every read byte. 33 | func (c *CipherReader) Read(p []byte) (n int, err error) { 34 | n, err = c.r.Read(p) 35 | ws.Cipher(p[:n], c.mask, c.pos) 36 | c.pos += n 37 | return 38 | } 39 | 40 | // CipherWriter implements io.Writer that applies xor-cipher to the bytes 41 | // written to the destination writer. It does not modify the original bytes. 42 | type CipherWriter struct { 43 | w io.Writer 44 | mask [4]byte 45 | pos int 46 | } 47 | 48 | // NewCipherWriter creates xor-cipher writer to w with given mask. 49 | func NewCipherWriter(w io.Writer, mask [4]byte) *CipherWriter { 50 | return &CipherWriter{w, mask, 0} 51 | } 52 | 53 | // Reset reset CipherWriter to write to w with given mask. 54 | func (c *CipherWriter) Reset(w io.Writer, mask [4]byte) { 55 | c.w = w 56 | c.mask = mask 57 | c.pos = 0 58 | } 59 | 60 | // Write implements io.Writer interface. It applies masking during 61 | // initialization to every sent byte. It does not modify original slice. 62 | func (c *CipherWriter) Write(p []byte) (n int, err error) { 63 | cp := pbytes.GetLen(len(p)) 64 | defer pbytes.Put(cp) 65 | 66 | copy(cp, p) 67 | ws.Cipher(cp, c.mask, c.pos) 68 | n, err = c.w.Write(cp) 69 | c.pos += n 70 | 71 | return 72 | } 73 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/wsutil/extenstion.go: -------------------------------------------------------------------------------- 1 | package wsutil 2 | 3 | import "github.com/gobwas/ws" 4 | 5 | // RecvExtension is an interface for clearing fragment header RSV bits. 6 | type RecvExtension interface { 7 | UnsetBits(ws.Header) (ws.Header, error) 8 | } 9 | 10 | // RecvExtensionFunc is an adapter to allow the use of ordinary functions as 11 | // RecvExtension. 12 | type RecvExtensionFunc func(ws.Header) (ws.Header, error) 13 | 14 | // BitsRecv implements RecvExtension. 15 | func (fn RecvExtensionFunc) UnsetBits(h ws.Header) (ws.Header, error) { 16 | return fn(h) 17 | } 18 | 19 | // SendExtension is an interface for setting fragment header RSV bits. 20 | type SendExtension interface { 21 | SetBits(ws.Header) (ws.Header, error) 22 | } 23 | 24 | // SendExtensionFunc is an adapter to allow the use of ordinary functions as 25 | // SendExtension. 26 | type SendExtensionFunc func(ws.Header) (ws.Header, error) 27 | 28 | // BitsSend implements SendExtension. 29 | func (fn SendExtensionFunc) SetBits(h ws.Header) (ws.Header, error) { 30 | return fn(h) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/wsutil/upgrader.go: -------------------------------------------------------------------------------- 1 | package wsutil 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "io" 7 | "io/ioutil" 8 | "net/http" 9 | 10 | "github.com/gobwas/ws" 11 | ) 12 | 13 | // DebugUpgrader is a wrapper around ws.Upgrader. It tracks I/O of a 14 | // WebSocket handshake. 15 | // 16 | // Note that it must not be used in production applications that requires 17 | // Upgrade() to be efficient. 18 | type DebugUpgrader struct { 19 | // Upgrader contains upgrade to WebSocket options. 20 | Upgrader ws.Upgrader 21 | 22 | // OnRequest and OnResponse are the callbacks that will be called with the 23 | // HTTP request and response respectively. 24 | OnRequest, OnResponse func([]byte) 25 | } 26 | 27 | // Upgrade calls Upgrade() on underlying ws.Upgrader and tracks I/O on conn. 28 | func (d *DebugUpgrader) Upgrade(conn io.ReadWriter) (hs ws.Handshake, err error) { 29 | var ( 30 | // Take the Reader and Writer parts from conn to be probably replaced 31 | // below. 32 | r io.Reader = conn 33 | w io.Writer = conn 34 | ) 35 | if onRequest := d.OnRequest; onRequest != nil { 36 | var buf bytes.Buffer 37 | // First, we must read the entire request. 38 | req, err := http.ReadRequest(bufio.NewReader( 39 | io.TeeReader(conn, &buf), 40 | )) 41 | if err == nil { 42 | // Fulfill the buffer with the response body. 43 | io.Copy(ioutil.Discard, req.Body) 44 | req.Body.Close() 45 | } 46 | onRequest(buf.Bytes()) 47 | 48 | r = io.MultiReader( 49 | &buf, conn, 50 | ) 51 | } 52 | 53 | if onResponse := d.OnResponse; onResponse != nil { 54 | var buf bytes.Buffer 55 | // Intercept the response stream written by the Upgrade(). 56 | w = io.MultiWriter( 57 | conn, &buf, 58 | ) 59 | defer func() { 60 | onResponse(buf.Bytes()) 61 | }() 62 | } 63 | 64 | return d.Upgrader.Upgrade(struct { 65 | io.Reader 66 | io.Writer 67 | }{r, w}) 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/ws/wsutil/wsutil.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package wsutil provides utilities for working with WebSocket protocol. 3 | 4 | Overview: 5 | 6 | // Read masked text message from peer and check utf8 encoding. 7 | header, err := ws.ReadHeader(conn) 8 | if err != nil { 9 | // handle err 10 | } 11 | 12 | // Prepare to read payload. 13 | r := io.LimitReader(conn, header.Length) 14 | r = wsutil.NewCipherReader(r, header.Mask) 15 | r = wsutil.NewUTF8Reader(r) 16 | 17 | payload, err := ioutil.ReadAll(r) 18 | if err != nil { 19 | // handle err 20 | } 21 | 22 | You could get the same behavior using just `wsutil.Reader`: 23 | 24 | r := wsutil.Reader{ 25 | Source: conn, 26 | CheckUTF8: true, 27 | } 28 | 29 | payload, err := ioutil.ReadAll(r) 30 | if err != nil { 31 | // handle err 32 | } 33 | 34 | Or even simplest: 35 | 36 | payload, err := wsutil.ReadClientText(conn) 37 | if err != nil { 38 | // handle err 39 | } 40 | 41 | Package is also exports tools for buffered writing: 42 | 43 | // Create buffered writer, that will buffer output bytes and send them as 44 | // 128-length fragments (with exception on large writes, see the doc). 45 | writer := wsutil.NewWriterSize(conn, ws.StateServerSide, ws.OpText, 128) 46 | 47 | _, err := io.CopyN(writer, rand.Reader, 100) 48 | if err == nil { 49 | err = writer.Flush() 50 | } 51 | if err != nil { 52 | // handle error 53 | } 54 | 55 | For more utils and helpers see the documentation. 56 | */ 57 | package wsutil 58 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/intern/README.md: -------------------------------------------------------------------------------- 1 | Docs: https://godoc.org/github.com/josharian/intern 2 | 3 | See also [Go issue 5160](https://golang.org/issue/5160). 4 | 5 | License: MIT 6 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/intern/intern.go: -------------------------------------------------------------------------------- 1 | // Package intern interns strings. 2 | // Interning is best effort only. 3 | // Interned strings may be removed automatically 4 | // at any time without notification. 5 | // All functions may be called concurrently 6 | // with themselves and each other. 7 | package intern 8 | 9 | import "sync" 10 | 11 | var ( 12 | pool sync.Pool = sync.Pool{ 13 | New: func() interface{} { 14 | return make(map[string]string) 15 | }, 16 | } 17 | ) 18 | 19 | // String returns s, interned. 20 | func String(s string) string { 21 | m := pool.Get().(map[string]string) 22 | c, ok := m[s] 23 | if ok { 24 | pool.Put(m) 25 | return c 26 | } 27 | m[s] = s 28 | pool.Put(m) 29 | return s 30 | } 31 | 32 | // Bytes returns b converted to a string, interned. 33 | func Bytes(b []byte) string { 34 | m := pool.Get().(map[string]string) 35 | c, ok := m[string(b)] 36 | if ok { 37 | pool.Put(m) 38 | return c 39 | } 40 | s := string(b) 41 | m[s] = s 42 | pool.Put(m) 43 | return s 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/josharian/intern/license.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Josh Bleecher Snyder 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/mailru/easyjson/.gitignore: -------------------------------------------------------------------------------- 1 | .root 2 | *_easyjson.go 3 | *.iml 4 | .idea 5 | *.swp 6 | bin/* 7 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/.travis.yml: -------------------------------------------------------------------------------- 1 | arch: 2 | - amd64 3 | - ppc64le 4 | language: go 5 | 6 | go: 7 | - tip 8 | - stable 9 | 10 | matrix: 11 | allow_failures: 12 | - go: tip 13 | 14 | install: 15 | - go get golang.org/x/lint/golint 16 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Mail.Ru Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/Makefile: -------------------------------------------------------------------------------- 1 | all: test 2 | 3 | clean: 4 | rm -rf bin 5 | rm -rf tests/*_easyjson.go 6 | rm -rf benchmark/*_easyjson.go 7 | 8 | build: 9 | go build -i -o ./bin/easyjson ./easyjson 10 | 11 | generate: build 12 | bin/easyjson -stubs \ 13 | ./tests/snake.go \ 14 | ./tests/data.go \ 15 | ./tests/omitempty.go \ 16 | ./tests/nothing.go \ 17 | ./tests/named_type.go \ 18 | ./tests/custom_map_key_type.go \ 19 | ./tests/embedded_type.go \ 20 | ./tests/reference_to_pointer.go \ 21 | ./tests/html.go \ 22 | ./tests/unknown_fields.go \ 23 | ./tests/type_declaration.go \ 24 | ./tests/type_declaration_skip.go \ 25 | ./tests/members_escaped.go \ 26 | ./tests/members_unescaped.go \ 27 | ./tests/intern.go \ 28 | ./tests/nocopy.go \ 29 | ./tests/escaping.go 30 | bin/easyjson -all \ 31 | ./tests/data.go \ 32 | ./tests/nothing.go \ 33 | ./tests/errors.go \ 34 | ./tests/html.go \ 35 | ./tests/type_declaration_skip.go 36 | bin/easyjson \ 37 | ./tests/nested_easy.go \ 38 | ./tests/named_type.go \ 39 | ./tests/custom_map_key_type.go \ 40 | ./tests/embedded_type.go \ 41 | ./tests/reference_to_pointer.go \ 42 | ./tests/key_marshaler_map.go \ 43 | ./tests/unknown_fields.go \ 44 | ./tests/type_declaration.go \ 45 | ./tests/members_escaped.go \ 46 | ./tests/intern.go \ 47 | ./tests/nocopy.go \ 48 | ./tests/escaping.go \ 49 | ./tests/nested_marshaler.go 50 | bin/easyjson -snake_case ./tests/snake.go 51 | bin/easyjson -omit_empty ./tests/omitempty.go 52 | bin/easyjson -build_tags=use_easyjson -disable_members_unescape ./benchmark/data.go 53 | bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go 54 | bin/easyjson -disable_members_unescape ./tests/members_unescaped.go 55 | 56 | test: generate 57 | go test \ 58 | ./tests \ 59 | ./jlexer \ 60 | ./gen \ 61 | ./buffer 62 | cd benchmark && go test -benchmem -tags use_easyjson -bench . 63 | golint -set_exit_status ./tests/*_easyjson.go 64 | 65 | bench-other: generate 66 | cd benchmark && make 67 | 68 | bench-python: 69 | benchmark/ujson.sh 70 | 71 | 72 | .PHONY: clean generate test build 73 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/bytestostr.go: -------------------------------------------------------------------------------- 1 | // This file will only be included to the build if neither 2 | // easyjson_nounsafe nor appengine build tag is set. See README notes 3 | // for more details. 4 | 5 | //+build !easyjson_nounsafe 6 | //+build !appengine 7 | 8 | package jlexer 9 | 10 | import ( 11 | "reflect" 12 | "unsafe" 13 | ) 14 | 15 | // bytesToStr creates a string pointing at the slice to avoid copying. 16 | // 17 | // Warning: the string returned by the function should be used with care, as the whole input data 18 | // chunk may be either blocked from being freed by GC because of a single string or the buffer.Data 19 | // may be garbage-collected even when the string exists. 20 | func bytesToStr(data []byte) string { 21 | h := (*reflect.SliceHeader)(unsafe.Pointer(&data)) 22 | shdr := reflect.StringHeader{Data: h.Data, Len: h.Len} 23 | return *(*string)(unsafe.Pointer(&shdr)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go: -------------------------------------------------------------------------------- 1 | // This file is included to the build if any of the buildtags below 2 | // are defined. Refer to README notes for more details. 3 | 4 | //+build easyjson_nounsafe appengine 5 | 6 | package jlexer 7 | 8 | // bytesToStr creates a string normally from []byte 9 | // 10 | // Note that this method is roughly 1.5x slower than using the 'unsafe' method. 11 | func bytesToStr(data []byte) string { 12 | return string(data) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/jlexer/error.go: -------------------------------------------------------------------------------- 1 | package jlexer 2 | 3 | import "fmt" 4 | 5 | // LexerError implements the error interface and represents all possible errors that can be 6 | // generated during parsing the JSON data. 7 | type LexerError struct { 8 | Reason string 9 | Offset int 10 | Data string 11 | } 12 | 13 | func (l *LexerError) Error() string { 14 | return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/raw.go: -------------------------------------------------------------------------------- 1 | package easyjson 2 | 3 | import ( 4 | "github.com/mailru/easyjson/jlexer" 5 | "github.com/mailru/easyjson/jwriter" 6 | ) 7 | 8 | // RawMessage is a raw piece of JSON (number, string, bool, object, array or 9 | // null) that is extracted without parsing and output as is during marshaling. 10 | type RawMessage []byte 11 | 12 | // MarshalEasyJSON does JSON marshaling using easyjson interface. 13 | func (v *RawMessage) MarshalEasyJSON(w *jwriter.Writer) { 14 | if len(*v) == 0 { 15 | w.RawString("null") 16 | } else { 17 | w.Raw(*v, nil) 18 | } 19 | } 20 | 21 | // UnmarshalEasyJSON does JSON unmarshaling using easyjson interface. 22 | func (v *RawMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { 23 | *v = RawMessage(l.Raw()) 24 | } 25 | 26 | // UnmarshalJSON implements encoding/json.Unmarshaler interface. 27 | func (v *RawMessage) UnmarshalJSON(data []byte) error { 28 | *v = data 29 | return nil 30 | } 31 | 32 | var nullBytes = []byte("null") 33 | 34 | // MarshalJSON implements encoding/json.Marshaler interface. 35 | func (v RawMessage) MarshalJSON() ([]byte, error) { 36 | if len(v) == 0 { 37 | return nullBytes, nil 38 | } 39 | return v, nil 40 | } 41 | 42 | // IsDefined is required for integration with omitempty easyjson logic. 43 | func (v *RawMessage) IsDefined() bool { 44 | return len(*v) > 0 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/mailru/easyjson/unknown_fields.go: -------------------------------------------------------------------------------- 1 | package easyjson 2 | 3 | import ( 4 | jlexer "github.com/mailru/easyjson/jlexer" 5 | "github.com/mailru/easyjson/jwriter" 6 | ) 7 | 8 | // UnknownFieldsProxy implemets UnknownsUnmarshaler and UnknownsMarshaler 9 | // use it as embedded field in your structure to parse and then serialize unknown struct fields 10 | type UnknownFieldsProxy struct { 11 | unknownFields map[string][]byte 12 | } 13 | 14 | func (s *UnknownFieldsProxy) UnmarshalUnknown(in *jlexer.Lexer, key string) { 15 | if s.unknownFields == nil { 16 | s.unknownFields = make(map[string][]byte, 1) 17 | } 18 | s.unknownFields[key] = in.Raw() 19 | } 20 | 21 | func (s UnknownFieldsProxy) MarshalUnknowns(out *jwriter.Writer, first bool) { 22 | for key, val := range s.unknownFields { 23 | if first { 24 | first = false 25 | } else { 26 | out.RawByte(',') 27 | } 28 | out.String(string(key)) 29 | out.RawByte(':') 30 | out.Raw(val, nil) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go 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 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for 386, Linux 12 | // 13 | 14 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 15 | // instead of the glibc-specific "CALL 0x10(GS)". 16 | #define INVOKE_SYSCALL INT $0x80 17 | 18 | // Just jump to package syscall's implementation for all these functions. 19 | // The runtime may know about them. 20 | 21 | TEXT ·Syscall(SB),NOSPLIT,$0-28 22 | JMP syscall·Syscall(SB) 23 | 24 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 25 | JMP syscall·Syscall6(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | CALL runtime·entersyscall(SB) 29 | MOVL trap+0(FP), AX // syscall entry 30 | MOVL a1+4(FP), BX 31 | MOVL a2+8(FP), CX 32 | MOVL a3+12(FP), DX 33 | MOVL $0, SI 34 | MOVL $0, DI 35 | INVOKE_SYSCALL 36 | MOVL AX, r1+16(FP) 37 | MOVL DX, r2+20(FP) 38 | CALL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVL trap+0(FP), AX // syscall entry 49 | MOVL a1+4(FP), BX 50 | MOVL a2+8(FP), CX 51 | MOVL a3+12(FP), DX 52 | MOVL $0, SI 53 | MOVL $0, DI 54 | INVOKE_SYSCALL 55 | MOVL AX, r1+16(FP) 56 | MOVL DX, r2+20(FP) 57 | RET 58 | 59 | TEXT ·socketcall(SB),NOSPLIT,$0-36 60 | JMP syscall·socketcall(SB) 61 | 62 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 63 | JMP syscall·rawsocketcall(SB) 64 | 65 | TEXT ·seek(SB),NOSPLIT,$0-28 66 | JMP syscall·seek(SB) 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for AMD64, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOVQ a1+8(FP), DI 26 | MOVQ a2+16(FP), SI 27 | MOVQ a3+24(FP), DX 28 | MOVQ $0, R10 29 | MOVQ $0, R8 30 | MOVQ $0, R9 31 | MOVQ trap+0(FP), AX // syscall entry 32 | SYSCALL 33 | MOVQ AX, r1+32(FP) 34 | MOVQ DX, r2+40(FP) 35 | CALL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 45 | MOVQ a1+8(FP), DI 46 | MOVQ a2+16(FP), SI 47 | MOVQ a3+24(FP), DX 48 | MOVQ $0, R10 49 | MOVQ $0, R8 50 | MOVQ $0, R9 51 | MOVQ trap+0(FP), AX // syscall entry 52 | SYSCALL 53 | MOVQ AX, r1+32(FP) 54 | MOVQ DX, r2+40(FP) 55 | RET 56 | 57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 58 | JMP syscall·gettimeofday(SB) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for arm, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 24 | BL runtime·entersyscall(SB) 25 | MOVW trap+0(FP), R7 26 | MOVW a1+4(FP), R0 27 | MOVW a2+8(FP), R1 28 | MOVW a3+12(FP), R2 29 | MOVW $0, R3 30 | MOVW $0, R4 31 | MOVW $0, R5 32 | SWI $0 33 | MOVW R0, r1+16(FP) 34 | MOVW $0, R0 35 | MOVW R0, r2+20(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 40 | B syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 43 | B syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 46 | MOVW trap+0(FP), R7 // syscall entry 47 | MOVW a1+4(FP), R0 48 | MOVW a2+8(FP), R1 49 | MOVW a3+12(FP), R2 50 | SWI $0 51 | MOVW R0, r1+16(FP) 52 | MOVW $0, R0 53 | MOVW R0, r2+20(FP) 54 | RET 55 | 56 | TEXT ·seek(SB),NOSPLIT,$0-28 57 | B syscall·seek(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | // +build linux 7 | // +build arm64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // Just jump to package syscall's implementation for all these functions. 13 | // The runtime may know about them. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | B syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | B syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | BL runtime·entersyscall(SB) 23 | MOVD a1+8(FP), R0 24 | MOVD a2+16(FP), R1 25 | MOVD a3+24(FP), R2 26 | MOVD $0, R3 27 | MOVD $0, R4 28 | MOVD $0, R5 29 | MOVD trap+0(FP), R8 // syscall entry 30 | SVC 31 | MOVD R0, r1+32(FP) // r1 32 | MOVD R1, r2+40(FP) // r2 33 | BL runtime·exitsyscall(SB) 34 | RET 35 | 36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 37 | B syscall·RawSyscall(SB) 38 | 39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 40 | B syscall·RawSyscall6(SB) 41 | 42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 43 | MOVD a1+8(FP), R0 44 | MOVD a2+16(FP), R1 45 | MOVD a3+24(FP), R2 46 | MOVD $0, R3 47 | MOVD $0, R4 48 | MOVD $0, R5 49 | MOVD trap+0(FP), R8 // syscall entry 50 | SVC 51 | MOVD R0, r1+32(FP) 52 | MOVD R1, r2+40(FP) 53 | RET 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | // +build linux 7 | // +build mips64 mips64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | JAL runtime·entersyscall(SB) 27 | MOVV a1+8(FP), R4 28 | MOVV a2+16(FP), R5 29 | MOVV a3+24(FP), R6 30 | MOVV R0, R7 31 | MOVV R0, R8 32 | MOVV R0, R9 33 | MOVV trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVV R2, r1+32(FP) 36 | MOVV R3, r2+40(FP) 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVV a1+8(FP), R4 48 | MOVV a2+16(FP), R5 49 | MOVV a3+24(FP), R6 50 | MOVV R0, R7 51 | MOVV R0, R8 52 | MOVV R0, R9 53 | MOVV trap+0(FP), R2 // syscall entry 54 | SYSCALL 55 | MOVV R2, r1+32(FP) 56 | MOVV R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | // +build linux 7 | // +build mips mipsle 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-28 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 26 | JMP syscall·Syscall9(SB) 27 | 28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 29 | JAL runtime·entersyscall(SB) 30 | MOVW a1+4(FP), R4 31 | MOVW a2+8(FP), R5 32 | MOVW a3+12(FP), R6 33 | MOVW R0, R7 34 | MOVW trap+0(FP), R2 // syscall entry 35 | SYSCALL 36 | MOVW R2, r1+16(FP) // r1 37 | MOVW R3, r2+20(FP) // r2 38 | JAL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVW a1+4(FP), R4 49 | MOVW a2+8(FP), R5 50 | MOVW a3+12(FP), R6 51 | MOVW trap+0(FP), R2 // syscall entry 52 | SYSCALL 53 | MOVW R2, r1+16(FP) 54 | MOVW R3, r2+20(FP) 55 | RET 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | // +build linux 7 | // +build ppc64 ppc64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for ppc64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | BL runtime·entersyscall(SB) 21 | MOVD a1+8(FP), R3 22 | MOVD a2+16(FP), R4 23 | MOVD a3+24(FP), R5 24 | MOVD R0, R6 25 | MOVD R0, R7 26 | MOVD R0, R8 27 | MOVD trap+0(FP), R9 // syscall entry 28 | SYSCALL R9 29 | MOVD R3, r1+32(FP) 30 | MOVD R4, r2+40(FP) 31 | BL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 35 | MOVD a1+8(FP), R3 36 | MOVD a2+16(FP), R4 37 | MOVD a3+24(FP), R5 38 | MOVD R0, R6 39 | MOVD R0, R7 40 | MOVD R0, R8 41 | MOVD trap+0(FP), R9 // syscall entry 42 | SYSCALL R9 43 | MOVD R3, r1+32(FP) 44 | MOVD R4, r2+40(FP) 45 | RET 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | // +build riscv64 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for linux/riscv64. 13 | // 14 | // Where available, just jump to package syscall's implementation of 15 | // these functions. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOV a1+8(FP), A0 26 | MOV a2+16(FP), A1 27 | MOV a3+24(FP), A2 28 | MOV trap+0(FP), A7 // syscall entry 29 | ECALL 30 | MOV A0, r1+32(FP) // r1 31 | MOV A1, r2+40(FP) // r2 32 | CALL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | JMP syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | JMP syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOV a1+8(FP), A0 43 | MOV a2+16(FP), A1 44 | MOV a3+24(FP), A2 45 | MOV trap+0(FP), A7 // syscall entry 46 | ECALL 47 | MOV A0, r1+32(FP) 48 | MOV A1, r2+40(FP) 49 | RET 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | // +build linux 7 | // +build s390x 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for s390x, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | BR syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | BR syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | BL runtime·entersyscall(SB) 27 | MOVD a1+8(FP), R2 28 | MOVD a2+16(FP), R3 29 | MOVD a3+24(FP), R4 30 | MOVD $0, R5 31 | MOVD $0, R6 32 | MOVD $0, R7 33 | MOVD trap+0(FP), R1 // syscall entry 34 | SYSCALL 35 | MOVD R2, r1+32(FP) 36 | MOVD R3, r2+40(FP) 37 | BL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | BR syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | BR syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVD a1+8(FP), R2 48 | MOVD a2+16(FP), R3 49 | MOVD a3+24(FP), R4 50 | MOVD $0, R5 51 | MOVD $0, R6 52 | MOVD $0, R7 53 | MOVD trap+0(FP), R1 // syscall entry 54 | SYSCALL 55 | MOVD R2, r1+32(FP) 56 | MOVD R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,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_linux.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 by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 14 | var fcntl64Syscall uintptr = SYS_FCNTL 15 | 16 | func fcntl(fd int, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(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 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 27 | return fcntl(int(fd), cmd, arg) 28 | } 29 | 30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 33 | if errno == 0 { 34 | return nil 35 | } 36 | return errno 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /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 gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 26 | 27 | struct ret 28 | 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) 29 | { 30 | struct ret r; 31 | 32 | errno = 0; 33 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 34 | r.err = errno; 35 | return r; 36 | } 37 | 38 | uintptr_t 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) 39 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 40 | 41 | uintptr_t 42 | 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) 43 | { 44 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | ) 13 | 14 | // Round the length of a raw sockaddr up to align it properly. 15 | func cmsgAlignOf(salen int) int { 16 | salign := SizeofPtr 17 | 18 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 19 | // sockcmsg_dragonfly.go 20 | switch runtime.GOOS { 21 | case "aix": 22 | // There is no alignment on AIX. 23 | salign = 1 24 | case "darwin", "ios", "illumos", "solaris": 25 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 26 | // kernels still require 32-bit aligned access to network 27 | // subsystem. 28 | if SizeofPtr == 8 { 29 | salign = 4 30 | } 31 | case "netbsd", "openbsd": 32 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 33 | if runtime.GOARCH == "arm" { 34 | salign = 8 35 | } 36 | // NetBSD aarch64 requires 128-bit alignment. 37 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 38 | salign = 16 39 | } 40 | case "zos": 41 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 42 | // not pointer width. 43 | salign = SizeofInt 44 | } 45 | 46 | return (salen + salign - 1) & ^(salign - 1) 47 | } 48 | -------------------------------------------------------------------------------- /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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | package unix 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + uitoa(uint(-val)) 13 | } 14 | return uitoa(uint(val)) 15 | } 16 | 17 | func uitoa(val uint) string { 18 | var buf [32]byte // big enough for int64 19 | i := len(buf) - 1 20 | for val >= 10 { 21 | buf[i] = byte(val%10 + '0') 22 | i-- 23 | val /= 10 24 | } 25 | buf[i] = byte(val + '0') 26 | return string(buf[i:]) 27 | } 28 | -------------------------------------------------------------------------------- /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 | //go:build aix && ppc 6 | // +build aix,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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func Fstat(fd int, stat *Stat_t) error { 41 | return fstat(fd, stat) 42 | } 43 | 44 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 45 | return fstatat(dirfd, path, stat, flags) 46 | } 47 | 48 | func Lstat(path string, stat *Stat_t) error { 49 | return lstat(path, stat) 50 | } 51 | 52 | func Stat(path string, statptr *Stat_t) error { 53 | return stat(path, statptr) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 && !go1.13 6 | // +build darwin,go1.12,!go1.13 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const _SYS_GETDIRENTRIES64 = 344 15 | 16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 17 | // To implement this using libSystem we'd need syscall_syscallPtr for 18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 19 | // back to raw syscalls for this func on Go 1.12. 20 | var p unsafe.Pointer 21 | if len(buf) > 0 { 22 | p = unsafe.Pointer(&buf[0]) 23 | } else { 24 | p = unsafe.Pointer(&_zero) 25 | } 26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 27 | n = int(r0) 28 | if e1 != 0 { 29 | return n, errnoErr(e1) 30 | } 31 | return n, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && darwin 6 | // +build amd64,darwin 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: sec, Nsec: nsec} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: sec, Usec: int32(usec)} 18 | } 19 | 20 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 21 | k.Ident = uint64(fd) 22 | k.Filter = int16(mode) 23 | k.Flags = uint16(flags) 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetControllen(length int) { 31 | msghdr.Controllen = uint32(length) 32 | } 33 | 34 | func (msghdr *Msghdr) SetIovlen(length int) { 35 | msghdr.Iovlen = int32(length) 36 | } 37 | 38 | func (cmsg *Cmsghdr) SetLen(length int) { 39 | cmsg.Len = uint32(length) 40 | } 41 | 42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 43 | 44 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 48 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 50 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 51 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && darwin 6 | // +build arm64,darwin 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: sec, Nsec: nsec} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: sec, Usec: int32(usec)} 18 | } 19 | 20 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 21 | k.Ident = uint64(fd) 22 | k.Filter = int16(mode) 23 | k.Flags = uint16(flags) 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetControllen(length int) { 31 | msghdr.Controllen = uint32(length) 32 | } 33 | 34 | func (msghdr *Msghdr) SetIovlen(length int) { 35 | msghdr.Iovlen = int32(length) 36 | } 37 | 38 | func (cmsg *Cmsghdr) SetLen(length int) { 39 | cmsg.Len = uint32(length) 40 | } 41 | 42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 43 | 44 | //sys Fstat(fd int, stat *Stat_t) (err error) 45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 48 | //sys Lstat(path string, stat *Stat_t) (err error) 49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 50 | //sys Stat(path string, stat *Stat_t) (err error) 51 | //sys Statfs(path string, stat *Statfs_t) (err error) 52 | -------------------------------------------------------------------------------- /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 | //go:build darwin && go1.12 6 | // +build darwin,go1.12 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_darwin.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 20 | 21 | //go:linkname syscall_syscall syscall.syscall 22 | //go:linkname syscall_syscall6 syscall.syscall6 23 | //go:linkname syscall_syscall6X syscall.syscall6X 24 | //go:linkname syscall_syscall9 syscall.syscall9 25 | //go:linkname syscall_rawSyscall syscall.rawSyscall 26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 27 | //go:linkname syscall_syscallPtr syscall.syscallPtr 28 | -------------------------------------------------------------------------------- /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 | //go:build amd64 && dragonfly 6 | // +build amd64,dragonfly 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && freebsd 6 | // +build 386,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint32(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 60 | return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) 61 | } 62 | 63 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 64 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} 65 | err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 66 | return int(ioDesc.Len), err 67 | } 68 | -------------------------------------------------------------------------------- /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 | //go:build amd64 && freebsd 6 | // +build amd64,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 60 | return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) 61 | } 62 | 63 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 64 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} 65 | err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 66 | return int(ioDesc.Len), err 67 | } 68 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && freebsd 6 | // +build arm,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: int32(nsec)} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: int32(usec)} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint32(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 60 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} 61 | err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 62 | return int(ioDesc.Len), err 63 | } 64 | -------------------------------------------------------------------------------- /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 | //go:build arm64 && freebsd 6 | // +build arm64,freebsd 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | 59 | func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { 60 | ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} 61 | err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) 62 | return int(ioDesc.Len), err 63 | } 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 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 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | // +build linux,gccgo,386 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | 23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 25 | return int(fd), err 26 | } 27 | 28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 30 | return int(fd), err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /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 | //go:build 386 && openbsd 6 | // +build 386,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | // +build amd64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /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 | //go:build arm && openbsd 6 | // +build arm,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | // +build arm64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 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 (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (cmsg *Cmsghdr) SetLen(length int) { 30 | cmsg.Len = uint32(length) 31 | } 32 | 33 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 34 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 35 | const SYS___SYSCTL = SYS_SYSCTL 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 7 | // +build gc 8 | // +build !ppc64le 9 | // +build !ppc64 10 | 11 | package unix 12 | 13 | import "syscall" 14 | 15 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 18 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | // +build linux 7 | 8 | package unix 9 | 10 | import "runtime" 11 | 12 | // SysvShmCtl performs control operations on the shared memory segment 13 | // specified by id. 14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 15 | if runtime.GOARCH == "arm" || 16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 17 | cmd |= ipc_64 18 | } 19 | 20 | return shmctl(id, cmd, desc) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || linux 6 | // +build darwin,!ios linux 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | 13 | "golang.org/x/sys/internal/unsafeheader" 14 | ) 15 | 16 | // SysvShmAttach attaches the Sysv shared memory segment associated with the 17 | // shared memory identifier id. 18 | func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { 19 | addr, errno := shmat(id, addr, flag) 20 | if errno != nil { 21 | return nil, errno 22 | } 23 | 24 | // Retrieve the size of the shared memory to enable slice creation 25 | var info SysvShmDesc 26 | 27 | _, err := SysvShmCtl(id, IPC_STAT, &info) 28 | if err != nil { 29 | // release the shared memory if we can't find the size 30 | 31 | // ignoring error from shmdt as there's nothing sensible to return here 32 | shmdt(addr) 33 | return nil, err 34 | } 35 | 36 | // Use unsafe to convert addr into a []byte. 37 | // TODO: convert to unsafe.Slice once we can assume Go 1.17 38 | var b []byte 39 | hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b)) 40 | hdr.Data = unsafe.Pointer(addr) 41 | hdr.Cap = int(info.Segsz) 42 | hdr.Len = int(info.Segsz) 43 | return b, nil 44 | } 45 | 46 | // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. 47 | // 48 | // It is not safe to use the slice after calling this function. 49 | func SysvShmDetach(data []byte) error { 50 | if len(data) == 0 { 51 | return EINVAL 52 | } 53 | 54 | return shmdt(uintptr(unsafe.Pointer(&data[0]))) 55 | } 56 | 57 | // SysvShmGet returns the Sysv shared memory identifier associated with key. 58 | // If the IPC_CREAT flag is specified a new segment is created. 59 | func SysvShmGet(key, size, flag int) (id int, err error) { 60 | return shmget(key, size, flag) 61 | } 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | // SysvShmCtl performs control operations on the shared memory segment 11 | // specified by id. 12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 13 | return shmctl(id, cmd, desc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | // +build linux 5 | // +build arm arm64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsArm is the registers used by arm binaries. 12 | type PtraceRegsArm struct { 13 | Uregs [18]uint32 14 | } 15 | 16 | // PtraceGetRegsArm fetches the registers used by arm binaries. 17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 19 | } 20 | 21 | // PtraceSetRegsArm sets the registers used by arm binaries. 22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 24 | } 25 | 26 | // PtraceRegsArm64 is the registers used by arm64 binaries. 27 | type PtraceRegsArm64 struct { 28 | Regs [31]uint64 29 | Sp uint64 30 | Pc uint64 31 | Pstate uint64 32 | } 33 | 34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 37 | } 38 | 39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | // +build linux 5 | // +build mips mips64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMips is the registers used by mips binaries. 12 | type PtraceRegsMips struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMips fetches the registers used by mips binaries. 23 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMips sets the registers used by mips binaries. 28 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64 is the registers used by mips64 binaries. 33 | type PtraceRegsMips64 struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 44 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 49 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. 2 | 3 | //go:build linux && (mipsle || mips64le) 4 | // +build linux 5 | // +build mipsle mips64le 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMipsle is the registers used by mipsle binaries. 12 | type PtraceRegsMipsle struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 23 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 28 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64le is the registers used by mips64le binaries. 33 | type PtraceRegsMips64le struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 44 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 49 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && amd64 && go1.13 5 | // +build darwin,amd64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && arm64 && go1.13 5 | // +build darwin,arm64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go: -------------------------------------------------------------------------------- 1 | // cgo -godefs types_illumos.go | go run mkpost.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build amd64 && illumos 5 | // +build amd64,illumos 6 | 7 | package unix 8 | 9 | const ( 10 | TUNNEWPPA = 0x540001 11 | TUNSETPPA = 0x540002 12 | 13 | I_STR = 0x5308 14 | I_POP = 0x5303 15 | I_PUSH = 0x5302 16 | I_LINK = 0x530c 17 | I_UNLINK = 0x530d 18 | I_PLINK = 0x5316 19 | I_PUNLINK = 0x5317 20 | 21 | IF_UNITSEL = -0x7ffb8cca 22 | ) 23 | 24 | type strbuf struct { 25 | Maxlen int32 26 | Len int32 27 | Buf *int8 28 | } 29 | 30 | type Strioctl struct { 31 | Cmd int32 32 | Timout int32 33 | Len int32 34 | Dp *int8 35 | } 36 | 37 | type Lifreq struct { 38 | Name [32]int8 39 | Lifru1 [4]byte 40 | Type uint32 41 | Lifru [336]byte 42 | } 43 | --------------------------------------------------------------------------------