├── .github └── workflows │ ├── functional-test.sql │ ├── functional-test.yml │ ├── lint.yml │ ├── packages.yml │ ├── pages.yml │ └── test.yml ├── .gitignore ├── Dockerfile ├── Makefile ├── README.md ├── cmd └── mtk │ ├── dump │ └── command.go │ ├── main.go │ └── table │ ├── command.go │ └── list │ └── command.go ├── docs ├── .gitignore ├── README.md ├── blog │ ├── authors.yml │ ├── containerized-databases-for-developers.md │ ├── drupalsouth-2019.md │ └── patterns-local-development-nirvana.md ├── docs │ ├── Integrations │ │ └── aws-rds.md │ ├── database-image.md │ └── tutorial.md ├── docusaurus.config.js ├── package-lock.json ├── package.json ├── sidebars.js ├── src │ ├── components │ │ ├── HomepageFeatures │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ └── HowItWorks │ │ │ ├── how-it-works.png │ │ │ └── index.js │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.js │ │ ├── index.module.css │ │ └── markdown-page.md └── static │ ├── .nojekyll │ └── img │ ├── browserconfig.xml │ ├── fast.svg │ ├── favicon.ico │ ├── logo.png │ ├── manifest.json │ ├── seamless.svg │ └── secure.svg ├── go.mod ├── go.sum ├── internal ├── mysql │ ├── mock │ │ └── mock.go │ ├── mysql.go │ ├── provider │ │ ├── provider.go │ │ ├── rds │ │ │ ├── provider.go │ │ │ └── provider_test.go │ │ ├── stdout │ │ │ ├── provider.go │ │ │ └── provider_test.go │ │ └── utils │ │ │ ├── utils.go │ │ │ └── utils_test.go │ ├── tables.go │ ├── tables_test.go │ ├── utils.go │ ├── utils_test.go │ ├── write.go │ └── write_test.go └── sliceutils │ ├── sliceutils.go │ └── sliceutils_test.go ├── logo ├── mtk.ico ├── mtk.png └── mtk.xcf ├── pkg ├── config │ ├── config.go │ ├── config_test.go │ ├── test-data │ │ ├── ignore.yml │ │ ├── mixed.yml │ │ ├── nodata.yml │ │ ├── rewrite.yml │ │ └── where.yml │ └── utils.go └── envar │ ├── const.go │ ├── int.go │ └── string.go ├── revive.toml └── vendor ├── filippo.io └── edwards25519 │ ├── LICENSE │ ├── README.md │ ├── doc.go │ ├── edwards25519.go │ ├── extra.go │ ├── field │ ├── fe.go │ ├── fe_amd64.go │ ├── fe_amd64.s │ ├── fe_amd64_noasm.go │ ├── fe_arm64.go │ ├── fe_arm64.s │ ├── fe_arm64_noasm.go │ ├── fe_extra.go │ └── fe_generic.go │ ├── scalar.go │ ├── scalar_fiat.go │ ├── scalarmult.go │ └── tables.go ├── github.com ├── DATA-DOG │ └── go-sqlmock │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── argument.go │ │ ├── column.go │ │ ├── driver.go │ │ ├── expectations.go │ │ ├── expectations_before_go18.go │ │ ├── expectations_go18.go │ │ ├── options.go │ │ ├── query.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── rows_go18.go │ │ ├── sqlmock.go │ │ ├── sqlmock_before_go18.go │ │ ├── sqlmock_go18.go │ │ ├── sqlmock_go18_19.go │ │ ├── sqlmock_go19.go │ │ ├── statement.go │ │ ├── statement_before_go18.go │ │ └── statement_go18.go ├── asaskevich │ └── govalidator │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── arrays.go │ │ ├── converter.go │ │ ├── doc.go │ │ ├── error.go │ │ ├── numerics.go │ │ ├── patterns.go │ │ ├── types.go │ │ ├── utils.go │ │ ├── validator.go │ │ └── wercker.yml ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── go-sql-driver │ └── mysql │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── atomic_bool.go │ │ ├── atomic_bool_go118.go │ │ ├── auth.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── conncheck.go │ │ ├── conncheck_dummy.go │ │ ├── connection.go │ │ ├── connector.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── nulltime.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ └── utils.go ├── gobwas │ └── glob │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── bench.sh │ │ ├── compiler │ │ └── compiler.go │ │ ├── glob.go │ │ ├── match │ │ ├── any.go │ │ ├── any_of.go │ │ ├── btree.go │ │ ├── contains.go │ │ ├── every_of.go │ │ ├── list.go │ │ ├── match.go │ │ ├── max.go │ │ ├── min.go │ │ ├── nothing.go │ │ ├── prefix.go │ │ ├── prefix_any.go │ │ ├── prefix_suffix.go │ │ ├── range.go │ │ ├── row.go │ │ ├── segments.go │ │ ├── single.go │ │ ├── suffix.go │ │ ├── suffix_any.go │ │ ├── super.go │ │ └── text.go │ │ ├── readme.md │ │ ├── syntax │ │ ├── ast │ │ │ ├── ast.go │ │ │ └── parser.go │ │ ├── lexer │ │ │ ├── lexer.go │ │ │ └── token.go │ │ └── syntax.go │ │ └── util │ │ ├── runes │ │ └── runes.go │ │ └── strings │ │ └── strings.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ └── trap_windows.go ├── jwalton │ ├── gchalk │ │ ├── .gitignore │ │ ├── .golangci.yaml │ │ ├── LICENSE │ │ ├── LICENSE-chalk │ │ ├── Makefile │ │ ├── README.md │ │ ├── architecture.md │ │ ├── colorModels.go │ │ ├── gchalk.go │ │ ├── generated.go │ │ ├── pkg │ │ │ └── ansistyles │ │ │ │ ├── LICENSE │ │ │ │ ├── LICENSE-ansi-styles │ │ │ │ ├── README.md │ │ │ │ ├── ansi256lut.go │ │ │ │ ├── ansistyles.go │ │ │ │ ├── byteToString.go │ │ │ │ ├── makeScreenshot.sh │ │ │ │ └── screenshot.svg │ │ ├── screenshot.png │ │ └── util.go │ └── go-supportscolor │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── colorlevel_string.go │ │ ├── colorlevels.go │ │ ├── di.go │ │ ├── osutils.go │ │ ├── osutils_windows.go │ │ ├── pkg │ │ └── hasFlag │ │ │ ├── LICENSE │ │ │ └── hasFlag.go │ │ └── supportscolor.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── spf13 │ ├── cobra │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── .mailmap │ │ ├── CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.txt │ │ ├── MAINTAINERS │ │ ├── Makefile │ │ ├── README.md │ │ ├── active_help.go │ │ ├── args.go │ │ ├── bash_completions.go │ │ ├── bash_completionsV2.go │ │ ├── cobra.go │ │ ├── command.go │ │ ├── command_notwin.go │ │ ├── command_win.go │ │ ├── completions.go │ │ ├── fish_completions.go │ │ ├── flag_groups.go │ │ ├── powershell_completions.go │ │ ├── shell_completions.go │ │ └── zsh_completions.go │ └── pflag │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bool.go │ │ ├── bool_slice.go │ │ ├── bytes.go │ │ ├── count.go │ │ ├── duration.go │ │ ├── duration_slice.go │ │ ├── flag.go │ │ ├── float32.go │ │ ├── float32_slice.go │ │ ├── float64.go │ │ ├── float64_slice.go │ │ ├── golangflag.go │ │ ├── int.go │ │ ├── int16.go │ │ ├── int32.go │ │ ├── int32_slice.go │ │ ├── int64.go │ │ ├── int64_slice.go │ │ ├── int8.go │ │ ├── int_slice.go │ │ ├── ip.go │ │ ├── ip_slice.go │ │ ├── ipmask.go │ │ ├── ipnet.go │ │ ├── string.go │ │ ├── string_array.go │ │ ├── string_slice.go │ │ ├── string_to_int.go │ │ ├── string_to_int64.go │ │ ├── string_to_string.go │ │ ├── uint.go │ │ ├── uint16.go │ │ ├── uint32.go │ │ ├── uint64.go │ │ ├── uint8.go │ │ └── uint_slice.go └── stretchr │ └── testify │ ├── LICENSE │ └── assert │ ├── assertion_compare.go │ ├── assertion_format.go │ ├── assertion_format.go.tmpl │ ├── assertion_forward.go │ ├── assertion_forward.go.tmpl │ ├── assertion_order.go │ ├── assertions.go │ ├── doc.go │ ├── errors.go │ ├── forward_assertions.go │ └── http_assertions.go ├── golang.org └── x │ ├── sys │ ├── LICENSE │ ├── PATENTS │ ├── plan9 │ │ ├── asm.s │ │ ├── asm_plan9_386.s │ │ ├── asm_plan9_amd64.s │ │ ├── asm_plan9_arm.s │ │ ├── const_plan9.go │ │ ├── dir_plan9.go │ │ ├── env_plan9.go │ │ ├── errors_plan9.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mksysnum_plan9.sh │ │ ├── pwd_go15_plan9.go │ │ ├── pwd_plan9.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_plan9.go │ │ ├── zsyscall_plan9_386.go │ │ ├── zsyscall_plan9_amd64.go │ │ ├── zsyscall_plan9_arm.go │ │ └── zsysnum_plan9.go │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkknownfolderids.bash │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── setupapi_windows.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ ├── types_windows_arm64.go │ │ ├── zerrors_windows.go │ │ ├── zknownfolderids_windows.go │ │ └── zsyscall_windows.go │ └── term │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── codereview.cfg │ ├── term.go │ ├── term_plan9.go │ ├── term_unix.go │ ├── term_unix_bsd.go │ ├── term_unix_other.go │ ├── term_unsupported.go │ ├── term_windows.go │ └── terminal.go ├── gopkg.in └── yaml.v3 │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── modules.txt /.github/workflows/functional-test.yml: -------------------------------------------------------------------------------- 1 | name: Functional Test 2 | 3 | on: 4 | pull_request: 5 | types: [opened, synchronize, reopened] 6 | branches: ['main'] 7 | 8 | jobs: 9 | test: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - uses: actions/setup-go@v3 16 | with: 17 | go-version: '1.21' 18 | 19 | - name: Build MTK 20 | run: make build 21 | 22 | - name: Start MySQL 23 | run: sudo /etc/init.d/mysql start 24 | 25 | - name: Create Database 26 | run: mysql -e 'CREATE DATABASE test_db;' -uroot -proot 27 | 28 | - name: Import Database 29 | run: mysql -uroot -proot test_db < .github/workflows/functional-test.sql 30 | 31 | - name: Dump Database 32 | run: bin/mtk-linux-amd64 dump test_db --port=3306 --user=root --password=root --host=127.0.0.1 > mtk-dump.sql 33 | 34 | - name: Drop Database 35 | run: mysql -e 'DROP DATABASE test_db;' -uroot -proot 36 | 37 | - name: Clean Database 38 | # Remove the last line from the file - the dump timestamp. 39 | run: sed '$d' mtk-dump.sql > mtk-dump-clean.sql 40 | 41 | - name: Recreate Database 42 | run: mysql -e 'CREATE DATABASE test_db;' -uroot -proot 43 | 44 | - name: Reimport Database 45 | run: mysql -uroot -proot test_db < mtk-dump-clean.sql 46 | 47 | - name: Compare Results 48 | run: diff -q .github/workflows/functional-test.sql mtk-dump-clean.sql 49 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push 5 | 6 | jobs: 7 | lint: 8 | name: 📋 Lint 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: ⬇️ Git clone the repository 12 | uses: actions/checkout@v3 13 | 14 | - name: 📦 Install Go 15 | uses: actions/setup-go@v3 16 | with: 17 | go-version: '1.21' 18 | 19 | - name: 🧪 Revive 20 | run: | 21 | go install github.com/mgechev/revive@latest 22 | make lint 23 | -------------------------------------------------------------------------------- /.github/workflows/packages.yml: -------------------------------------------------------------------------------- 1 | name: Create and publish a Github Package 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'main' 7 | - 's3-export-import' 8 | tags: 9 | - 'v[0-9]+.[0-9]+.[0-9]+*' 10 | 11 | env: 12 | REGISTRY: ghcr.io 13 | IMAGE_NAME: ${{ github.repository }} 14 | 15 | jobs: 16 | build-and-push-image: 17 | runs-on: ubuntu-latest 18 | 19 | permissions: 20 | contents: read 21 | packages: write 22 | 23 | steps: 24 | - name: Checkout repository 25 | uses: actions/checkout@v3 26 | 27 | - name: Log in to the Container registry 28 | uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 29 | with: 30 | registry: ${{ env.REGISTRY }} 31 | username: ${{ github.actor }} 32 | password: ${{ secrets.GITHUB_TOKEN }} 33 | 34 | - name: Extract metadata (tags, labels) for Docker 35 | id: meta 36 | uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 37 | with: 38 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 39 | 40 | - name: Build and push Docker image 41 | uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 42 | with: 43 | context: . 44 | push: true 45 | tags: ${{ steps.meta.outputs.tags }} 46 | labels: ${{ steps.meta.outputs.labels }} 47 | -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Docusaurus to Pages 2 | 3 | on: 4 | # Runs on pushes targeting the default branch 5 | push: 6 | branches: [main] 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | permissions: 12 | contents: read 13 | pages: write 14 | id-token: write 15 | 16 | concurrency: 17 | group: "pages" 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | deploy: 22 | environment: 23 | name: github-pages 24 | url: ${{ steps.deployment.outputs.page_url }} 25 | 26 | runs-on: ubuntu-latest 27 | 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v3 31 | 32 | - name: Set up Node.js 33 | uses: actions/setup-node@v3 34 | with: 35 | node-version: 20.x 36 | 37 | - name: Install and Build 38 | run: | 39 | cd docs 40 | npm install --non-interactive 41 | npm run build 42 | 43 | - name: Setup Pages 44 | uses: actions/configure-pages@v3 45 | 46 | - name: Upload artifact 47 | uses: actions/upload-pages-artifact@v2 48 | with: 49 | path: docs/build 50 | 51 | - name: Deploy to GitHub Pages 52 | id: deployment 53 | uses: actions/deploy-pages@v2 54 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push 5 | 6 | jobs: 7 | test: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: actions/setup-go@v3 12 | with: 13 | go-version: '1.21' 14 | - run: go test ./... 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | /bin 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23 as build 2 | 3 | WORKDIR /go/src/github.com/skpr/mtk 4 | COPY . /go/src/github.com/skpr/mtk 5 | 6 | ENV CGO_ENABLED=0 7 | 8 | RUN go build -o bin/mtk -ldflags='-extldflags "-static"' github.com/skpr/mtk/cmd/mtk 9 | 10 | FROM alpine:3.18 11 | 12 | COPY --from=build /go/src/github.com/skpr/mtk/bin/mtk /usr/local/bin/mtk 13 | 14 | ENTRYPOINT ["/usr/local/bin/mtk"] 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | export CGO_ENABLED=0 4 | 5 | define build_step 6 | GOOS=$(1) GOARCH=$(2) go build -o bin/mtk-$(1)-$(2) -ldflags='-extldflags "-static"' github.com/skpr/mtk/cmd/mtk 7 | endef 8 | 9 | # Builds the project. 10 | build: 11 | $(call build_step,linux,amd64) 12 | $(call build_step,linux,arm64) 13 | $(call build_step,darwin,amd64) 14 | $(call build_step,darwin,arm64) 15 | 16 | # Run all lint checking with exit codes for CI. 17 | lint: 18 | revive -config revive.toml -set_exit_status ./cmd/... ./internal/... ./pkg/... 19 | 20 | # Run tests with coverage reporting. 21 | test: 22 | go test -cover ./... 23 | 24 | .PHONY: * 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MTK (MySQL Toolkit) 2 | =================== 3 | 4 | A tool designed to guide developers in the right direction for identifying and resolving performance issues. 5 | 6 | 7 | 8 | ---- 9 | 10 | A toolkit for exporting, sanitizing and packaging MySQL database. 11 | 12 | ## The Goal of this Project 13 | 14 | To provide developers with the tools to share MySQL database dumps in a safe and repeatable manner. 15 | 16 | ## Getting Started 17 | 18 | See our [documentation site](https://mtk.skpr.io) for a tutorial on how to get started. -------------------------------------------------------------------------------- /cmd/mtk/table/command.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/skpr/mtk/cmd/mtk/table/list" 7 | "github.com/skpr/mtk/internal/mysql" 8 | ) 9 | 10 | const cmdLong = ` 11 | Perform MySQL tasks related to database tables.` 12 | 13 | const cmdExample = ` 14 | # List all database tables. 15 | mtk table list ` 16 | 17 | // NewCommand will execute the table command. 18 | func NewCommand(conn *mysql.Connection) *cobra.Command { 19 | cmd := &cobra.Command{ 20 | Use: "table", 21 | DisableFlagsInUseLine: true, 22 | Short: "Perform MySQL tasks related to database tables.", 23 | Long: cmdLong, 24 | Example: cmdExample, 25 | } 26 | 27 | cmd.AddCommand(list.NewCommand(conn)) 28 | 29 | return cmd 30 | } 31 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /docs/blog/authors.yml: -------------------------------------------------------------------------------- 1 | nickschuch: 2 | name: Nick Schuch 3 | title: Lead Architect 4 | url: https://github.com/nickschuch 5 | image_url: https://github.com/nickschuch.png 6 | page: true 7 | socials: 8 | bluesky: nickschuch 9 | github: nickschuch 10 | -------------------------------------------------------------------------------- /docs/blog/containerized-databases-for-developers.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: containerized-databases-for-developers 3 | title: Containerized Databases for Developers 4 | date: 2018-07-07 5 | authors: [nickschuch] 6 | --- 7 | 8 | The first blog post to introduce the term database images back in 2018, revolutionizing the way databases are packaged and shared with development teams and CI/CD pipelines. 9 | 10 | This blog post highlights how implementing MySQL Toolkit has enhanced and streamlined our development workflow. 11 | 12 | https://www.previousnext.com.au/blog/containerized-databases-developers -------------------------------------------------------------------------------- /docs/blog/drupalsouth-2019.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: drupalsouth-2019 3 | title: Containerized Databases for Developers 4 | date: 2018-12-04 5 | authors: [nickschuch] 6 | --- 7 | 8 | What would you do if your laptop was stolen? Have I got your attention? Yes? Good :) Now think about all the un-sanitised databases that were on that laptop. 9 | 10 | Lets talk about packaging those up into sanitised, developer consumable artefacts. 11 | 12 | [](https://www.youtube.com/watch?v=W7lE1H-OCRs) 13 | -------------------------------------------------------------------------------- /docs/blog/patterns-local-development-nirvana.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: patterns-local-development-nirvana 3 | title: Patterns for Local Development Nirvana 4 | date: 2024-04-24 5 | authors: [nickschuch] 6 | --- 7 | 8 | Recorded at DrupalSouth 2024 in Sydney, my session is a deep dive into our journey towards local dev environment nirvana and highlights 9 | how database images levelled up our local development workflows. 10 | 11 | https://www.previousnext.com.au/blog/containerized-databases-developers -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-website", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@docusaurus/core": "3.7.0", 18 | "@docusaurus/preset-classic": "3.7.0", 19 | "@docusaurus/theme-mermaid": "^3.7.0", 20 | "@mdx-js/react": "^3.0.0", 21 | "clsx": "^2.0.0", 22 | "prism-react-renderer": "^2.3.0", 23 | "react": "^19.0.0", 24 | "react-dom": "^19.0.0" 25 | }, 26 | "devDependencies": { 27 | "@docusaurus/module-type-aliases": "3.7.0", 28 | "@docusaurus/types": "3.7.0" 29 | }, 30 | "browserslist": { 31 | "production": [ 32 | ">0.5%", 33 | "not dead", 34 | "not op_mini all" 35 | ], 36 | "development": [ 37 | "last 3 chrome version", 38 | "last 3 firefox version", 39 | "last 5 safari version" 40 | ] 41 | }, 42 | "engines": { 43 | "node": ">=18.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /docs/sidebars.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) 4 | 5 | /** 6 | * Creating a sidebar enables you to: 7 | - create an ordered group of docs 8 | - render a sidebar for each doc of that group 9 | - provide next/previous navigation 10 | 11 | The sidebars can be generated from the filesystem, or explicitly defined here. 12 | 13 | Create as many sidebars as you want. 14 | 15 | @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} 16 | */ 17 | const sidebars = { 18 | // By default, Docusaurus generates a sidebar from the docs folder structure 19 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 20 | 21 | // But you can create a sidebar manually 22 | /* 23 | tutorialSidebar: [ 24 | 'intro', 25 | 'hello', 26 | { 27 | type: 'category', 28 | label: 'Tutorial', 29 | items: ['tutorial-basics/create-a-document'], 30 | }, 31 | ], 32 | */ 33 | }; 34 | 35 | export default sidebars; 36 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/components/HowItWorks/how-it-works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/docs/src/components/HowItWorks/how-it-works.png -------------------------------------------------------------------------------- /docs/src/components/HowItWorks/index.js: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import src from './how-it-works.png'; 3 | 4 | export default function HowItWorks() { 5 | return ( 6 | 7 | 8 | 9 | 10 | ; 11 | 12 | 13 | 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /docs/src/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Any CSS included here will be global. The classic template 3 | * bundles Infima by default. Infima is a CSS framework designed to 4 | * work well for content-centric websites. 5 | */ 6 | 7 | .hero__subtitle, .hero__title { 8 | color: #38383B; 9 | } 10 | 11 | /* You can override the default Infima variables here. */ 12 | :root { 13 | --ifm-color-primary: #5FDD9D; 14 | --ifm-color-primary-dark: #29784c; 15 | --ifm-color-primary-darker: #277148; 16 | --ifm-color-primary-darkest: #205d3b; 17 | --ifm-color-primary-light: #33925d; 18 | --ifm-color-primary-lighter: #359962; 19 | --ifm-color-primary-lightest: #3cad6e; 20 | --ifm-code-font-size: 95%; 21 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 22 | } 23 | 24 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 25 | [data-theme='dark'] { 26 | --ifm-color-primary: #25c2a0; 27 | --ifm-color-primary-dark: #21af90; 28 | --ifm-color-primary-darker: #1fa588; 29 | --ifm-color-primary-darkest: #1a8870; 30 | --ifm-color-primary-light: #29d5b0; 31 | --ifm-color-primary-lighter: #32d8b4; 32 | --ifm-color-primary-lightest: #4fddbf; 33 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 34 | } 35 | -------------------------------------------------------------------------------- /docs/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import Link from '@docusaurus/Link'; 3 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 4 | import Layout from '@theme/Layout'; 5 | import HomepageFeatures from '@site/src/components/HomepageFeatures'; 6 | import HowItWorks from '@site/src/components/HowItWorks'; 7 | 8 | import Heading from '@theme/Heading'; 9 | import styles from './index.module.css'; 10 | 11 | function HomepageHeader() { 12 | const {siteConfig} = useDocusaurusContext(); 13 | return ( 14 | 15 | 16 | 17 | {siteConfig.title} 18 | 19 | {siteConfig.tagline} 20 | 21 | 24 | Tutorial - 5min ⏱️ 25 | 26 | 27 | 28 | 29 | ); 30 | } 31 | 32 | export default function Home() { 33 | const {siteConfig} = useDocusaurusContext(); 34 | return ( 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/img/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/docs/static/img/logo.png -------------------------------------------------------------------------------- /docs/static/img/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/skpr/mtk 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/DATA-DOG/go-sqlmock v1.5.2 7 | github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 8 | github.com/go-sql-driver/mysql v1.8.1 9 | github.com/gobwas/glob v0.2.3 10 | github.com/jwalton/gchalk v1.3.0 11 | github.com/spf13/cobra v1.8.1 12 | github.com/stretchr/testify v1.9.0 13 | gopkg.in/yaml.v3 v3.0.1 14 | ) 15 | 16 | require ( 17 | filippo.io/edwards25519 v1.1.0 // indirect 18 | github.com/davecgh/go-spew v1.1.1 // indirect 19 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 20 | github.com/jwalton/go-supportscolor v1.2.0 // indirect 21 | github.com/pmezard/go-difflib v1.0.0 // indirect 22 | github.com/spf13/pflag v1.0.5 // indirect 23 | golang.org/x/sys v0.24.0 // indirect 24 | golang.org/x/term v0.23.0 // indirect 25 | ) 26 | -------------------------------------------------------------------------------- /internal/mysql/mock/mock.go: -------------------------------------------------------------------------------- 1 | package mock 2 | 3 | import ( 4 | "database/sql" 5 | "testing" 6 | 7 | "github.com/DATA-DOG/go-sqlmock" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | // GetDB which can be used for testing purposes. 12 | func GetDB(t *testing.T) (*sql.DB, sqlmock.Sqlmock) { 13 | db, mock, err := sqlmock.New() 14 | assert.Nil(t, err) 15 | return db, mock 16 | } 17 | -------------------------------------------------------------------------------- /internal/mysql/provider/provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | // Interface implements the required functionality for a Provider. 4 | type Interface interface { 5 | GetSelectQueryForTable(table string, params DumpParams) (string, error) 6 | } 7 | 8 | // DumpParams is used to pass parameters to the Dump function. 9 | type DumpParams struct { 10 | SelectMap map[string]map[string]string 11 | WhereMap map[string]string 12 | FilterMap map[string]string 13 | UseTableLock bool 14 | ExtendedInsertRows int 15 | } 16 | -------------------------------------------------------------------------------- /internal/mysql/provider/stdout/provider.go: -------------------------------------------------------------------------------- 1 | package stdout 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | "log" 7 | "strings" 8 | 9 | "github.com/skpr/mtk/internal/mysql/provider" 10 | providerutils "github.com/skpr/mtk/internal/mysql/provider/utils" 11 | ) 12 | 13 | // Client used for dumping a database and/or table. 14 | type Client struct { 15 | provider.Interface 16 | DB *sql.DB 17 | Logger *log.Logger 18 | } 19 | 20 | // NewClient for dumping a full or single table from a database. 21 | func NewClient(db *sql.DB, logger *log.Logger) *Client { 22 | return &Client{ 23 | DB: db, 24 | Logger: logger, 25 | } 26 | } 27 | 28 | // GetSelectQueryForTable will return a complete SELECT query to fetch data from a table. 29 | func (d *Client) GetSelectQueryForTable(table string, params provider.DumpParams) (string, error) { 30 | cols, err := providerutils.QueryColumnsForTable(d.DB, table, params) 31 | if err != nil { 32 | return "", err 33 | } 34 | 35 | query := fmt.Sprintf("SELECT %s FROM `%s`", strings.Join(cols, ", "), table) 36 | 37 | if where, ok := params.WhereMap[strings.ToLower(table)]; ok { 38 | query = fmt.Sprintf("%s WHERE %s", query, where) 39 | } 40 | 41 | return query, nil 42 | } 43 | -------------------------------------------------------------------------------- /internal/mysql/provider/stdout/provider_test.go: -------------------------------------------------------------------------------- 1 | package stdout 2 | 3 | import ( 4 | "errors" 5 | "log" 6 | "os" 7 | "testing" 8 | 9 | "github.com/DATA-DOG/go-sqlmock" 10 | "github.com/stretchr/testify/assert" 11 | 12 | "github.com/skpr/mtk/internal/mysql/mock" 13 | "github.com/skpr/mtk/internal/mysql/provider" 14 | ) 15 | 16 | func TestMySQLGetSelectQueryFor(t *testing.T) { 17 | db, mock := mock.GetDB(t) 18 | dumper := NewClient(db, log.New(os.Stdout, "", 0)) 19 | mock.ExpectQuery("SELECT \\* FROM `table` LIMIT 1").WillReturnRows( 20 | sqlmock.NewRows([]string{"c1", "c2"}).AddRow("a", "b")) 21 | query, err := dumper.GetSelectQueryForTable("table", provider.DumpParams{ 22 | SelectMap: map[string]map[string]string{"table": {"c2": "NOW()"}}, 23 | WhereMap: map[string]string{"table": "c1 > 0"}, 24 | }) 25 | assert.Nil(t, err) 26 | assert.Equal(t, "SELECT `c1`, NOW() AS `c2` FROM `table` WHERE c1 > 0", query) 27 | } 28 | 29 | func TestMySQLGetSelectQueryForHandlingError(t *testing.T) { 30 | db, mock := mock.GetDB(t) 31 | dumper := NewClient(db, log.New(os.Stdout, "", 0)) 32 | e := errors.New("broken") 33 | mock.ExpectQuery("SELECT \\* FROM `table` LIMIT 1").WillReturnError(e) 34 | query, err := dumper.GetSelectQueryForTable("table", provider.DumpParams{ 35 | SelectMap: map[string]map[string]string{"table": {"c2": "NOW()"}}, 36 | WhereMap: map[string]string{"table": "c1 > 0"}, 37 | }) 38 | assert.Equal(t, e, err) 39 | assert.Equal(t, "", query) 40 | } 41 | -------------------------------------------------------------------------------- /internal/mysql/provider/utils/utils.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | "strings" 7 | 8 | "github.com/skpr/mtk/internal/mysql/provider" 9 | ) 10 | 11 | // QueryColumnsForTable for a given table. 12 | func QueryColumnsForTable(database *sql.DB, table string, params provider.DumpParams) ([]string, error) { 13 | var rows *sql.Rows 14 | 15 | rows, err := database.Query(fmt.Sprintf("SELECT * FROM `%s` LIMIT 1", table)) 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | defer rows.Close() 21 | 22 | columns, err := rows.Columns() 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | for k, column := range columns { 28 | replacement, ok := params.SelectMap[strings.ToLower(table)][strings.ToLower(column)] 29 | if ok { 30 | columns[k] = fmt.Sprintf("%s AS `%s`", replacement, column) 31 | } else { 32 | columns[k] = fmt.Sprintf("`%s`", column) 33 | } 34 | } 35 | 36 | return columns, nil 37 | } 38 | -------------------------------------------------------------------------------- /internal/mysql/provider/utils/utils_test.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "errors" 5 | "testing" 6 | 7 | "github.com/DATA-DOG/go-sqlmock" 8 | "github.com/stretchr/testify/assert" 9 | 10 | "github.com/skpr/mtk/internal/mysql/mock" 11 | "github.com/skpr/mtk/internal/mysql/provider" 12 | ) 13 | 14 | func TestMySQLGetColumnsForSelect(t *testing.T) { 15 | db, mock := mock.GetDB(t) 16 | mock.ExpectQuery("SELECT \\* FROM `table` LIMIT 1").WillReturnRows( 17 | sqlmock.NewRows([]string{"col1", "col2", "col3"}).AddRow("a", "b", "c")) 18 | columns, err := QueryColumnsForTable(db, "table", provider.DumpParams{ 19 | SelectMap: map[string]map[string]string{"table": {"col2": "NOW()"}}, 20 | }) 21 | assert.Nil(t, err) 22 | assert.Equal(t, []string{"`col1`", "NOW() AS `col2`", "`col3`"}, columns) 23 | } 24 | 25 | func TestMySQLGetColumnsForSelectHandlingErrorWhenQuerying(t *testing.T) { 26 | db, mock := mock.GetDB(t) 27 | e := errors.New("broken") 28 | mock.ExpectQuery("SELECT \\* FROM `table` LIMIT 1").WillReturnError(e) 29 | columns, err := QueryColumnsForTable(db, "table", provider.DumpParams{ 30 | SelectMap: map[string]map[string]string{"table": {"col2": "NOW()"}}, 31 | }) 32 | assert.Equal(t, err, e) 33 | assert.Empty(t, columns) 34 | } 35 | -------------------------------------------------------------------------------- /internal/mysql/utils.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | 8 | "github.com/asaskevich/govalidator" 9 | ) 10 | 11 | func getValue(raw string) (string, error) { 12 | if raw == "" { 13 | return "''", nil 14 | } 15 | 16 | escaped, err := escape(raw) 17 | if err != nil { 18 | return "", err 19 | } 20 | 21 | if govalidator.IsInt(raw) { 22 | return escaped, nil 23 | } 24 | 25 | return fmt.Sprintf("'%s'", escaped), nil 26 | } 27 | 28 | func escape(str string) (string, error) { 29 | var ( 30 | esc string 31 | buf bytes.Buffer 32 | last = 0 33 | ) 34 | 35 | for i, c := range str { 36 | switch c { 37 | case 0: 38 | esc = `\0` 39 | case '\n': 40 | esc = `\n` 41 | case '\r': 42 | esc = `\r` 43 | case '\\': 44 | esc = `\\` 45 | case '\'': 46 | esc = `\'` 47 | case '"': 48 | esc = `\"` 49 | case '\032': 50 | esc = `\Z` 51 | default: 52 | continue 53 | } 54 | 55 | if _, err := io.WriteString(&buf, str[last:i]); err != nil { 56 | return "", err 57 | } 58 | 59 | if _, err := io.WriteString(&buf, esc); err != nil { 60 | return "", err 61 | } 62 | 63 | last = i + 1 64 | } 65 | 66 | if _, err := io.WriteString(&buf, str[last:]); err != nil { 67 | return "", err 68 | } 69 | 70 | return buf.String(), nil 71 | } 72 | -------------------------------------------------------------------------------- /internal/mysql/utils_test.go: -------------------------------------------------------------------------------- 1 | package mysql 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestGetValue(t *testing.T) { 10 | val, err := getValue("") 11 | assert.NoError(t, err) 12 | assert.Equal(t, "''", val) 13 | 14 | val, err = getValue("1") 15 | assert.NoError(t, err) 16 | assert.Equal(t, "1", val) 17 | 18 | val, err = getValue("foo") 19 | assert.NoError(t, err) 20 | assert.Equal(t, "'foo'", val) 21 | } 22 | 23 | func TestEscape(t *testing.T) { 24 | input := string([]byte{0, '\n', '\r', '\\', '\'', '"', '\032', 'a'}) 25 | expected := `\0\n\r\\\'\"\Za` 26 | result, err := escape(input) 27 | assert.NoError(t, err) 28 | assert.Equal(t, expected, result) 29 | } 30 | -------------------------------------------------------------------------------- /internal/sliceutils/sliceutils.go: -------------------------------------------------------------------------------- 1 | package sliceutils 2 | 3 | // AppendIfMissing from the slice. 4 | func AppendIfMissing(slice []string, add string) []string { 5 | for _, existing := range slice { 6 | if existing == add { 7 | return slice 8 | } 9 | } 10 | 11 | return append(slice, add) 12 | } 13 | -------------------------------------------------------------------------------- /internal/sliceutils/sliceutils_test.go: -------------------------------------------------------------------------------- 1 | package sliceutils 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestAppendIfMissing(t *testing.T) { 10 | slice := []string{ 11 | "foo", 12 | } 13 | 14 | slice = AppendIfMissing(slice, "foo") 15 | slice = AppendIfMissing(slice, "bar") 16 | 17 | assert.Equal(t, []string{"foo", "bar"}, slice) 18 | } 19 | -------------------------------------------------------------------------------- /logo/mtk.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/logo/mtk.ico -------------------------------------------------------------------------------- /logo/mtk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/logo/mtk.png -------------------------------------------------------------------------------- /logo/mtk.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/logo/mtk.xcf -------------------------------------------------------------------------------- /pkg/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "os" 5 | 6 | "gopkg.in/yaml.v3" 7 | ) 8 | 9 | // Rules for configuring the dump. 10 | type Rules struct { 11 | Rewrite map[string]Rewrite `yaml:"rewrite" json:"rewrite"` 12 | NoData []string `yaml:"nodata" json:"nodata"` 13 | Ignore []string `yaml:"ignore" json:"ignore"` 14 | Where map[string]string `yaml:"where" json:"where"` 15 | } 16 | 17 | // Rewrite rules for while dumping a database. 18 | type Rewrite map[string]string 19 | 20 | // Load a config file. 21 | func Load(path string) (Rules, error) { 22 | var rules Rules 23 | 24 | // We don't want to fail if the config file does not exist. 25 | if _, err := os.Stat(path); os.IsNotExist(err) { 26 | return rules, nil 27 | } 28 | 29 | f, err := os.ReadFile(path) 30 | if err != nil { 31 | return rules, err 32 | } 33 | 34 | err = yaml.Unmarshal(f, &rules) 35 | if err != nil { 36 | return rules, err 37 | } 38 | 39 | return rules, nil 40 | } 41 | -------------------------------------------------------------------------------- /pkg/config/test-data/ignore.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - ignore_this_table 3 | - and_this_one 4 | -------------------------------------------------------------------------------- /pkg/config/test-data/mixed.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - foo 3 | nodata: 4 | - bar 5 | rewrite: 6 | baz: 7 | qux: quux 8 | where: 9 | corge: |- 10 | grault IN (SELECT garply FROM waldo) 11 | fred_*: |- 12 | plugh >= 1000 -------------------------------------------------------------------------------- /pkg/config/test-data/nodata.yml: -------------------------------------------------------------------------------- 1 | nodata: 2 | - table_with_structure_only_please 3 | - yeah_do_this_one_too 4 | -------------------------------------------------------------------------------- /pkg/config/test-data/rewrite.yml: -------------------------------------------------------------------------------- 1 | rewrite: 2 | accounts: 3 | email: concat(id, "@sanitized") 4 | password: '"SANITIZED_PASSWORD"' 5 | -------------------------------------------------------------------------------- /pkg/config/test-data/where.yml: -------------------------------------------------------------------------------- 1 | where: 2 | some_table: |- 3 | revision_id IN (SELECT revision_id FROM another_table) 4 | fred_*: |- 5 | plugh >= 1000 6 | -------------------------------------------------------------------------------- /pkg/config/utils.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // SanitizeMap list for sanitizing the MySQL dump. 4 | func (r Rules) SanitizeMap() map[string]map[string]string { 5 | selectMap := make(map[string]map[string]string) 6 | 7 | for table, fields := range r.Rewrite { 8 | selectMap[table] = fields 9 | } 10 | 11 | return selectMap 12 | } 13 | 14 | // WhereMap list for conditional row exports in the MySQL dump. 15 | func (r Rules) WhereMap() map[string]string { 16 | whereMap := make(map[string]string) 17 | 18 | for table, condition := range r.Where { 19 | whereMap[table] = condition 20 | } 21 | 22 | return whereMap 23 | } 24 | -------------------------------------------------------------------------------- /pkg/envar/int.go: -------------------------------------------------------------------------------- 1 | package envar 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | ) 7 | 8 | // GetIntWithFallback returns the value of the environment variable with a fallback if not found. 9 | func GetIntWithFallback(value int, keys ...string) int { 10 | for _, key := range keys { 11 | if value, ok := os.LookupEnv(key); ok { 12 | v, err := strconv.Atoi(value) 13 | if err != nil { 14 | panic(err) 15 | } 16 | 17 | return v 18 | } 19 | } 20 | 21 | return value 22 | } 23 | -------------------------------------------------------------------------------- /pkg/envar/string.go: -------------------------------------------------------------------------------- 1 | package envar 2 | 3 | import "os" 4 | 5 | // GetStringWithFallback returns the value of the environment variable with a fallback if not found. 6 | func GetStringWithFallback(value string, keys ...string) string { 7 | for _, key := range keys { 8 | if value, ok := os.LookupEnv(key); ok { 9 | return value 10 | } 11 | } 12 | 13 | return value 14 | } 15 | -------------------------------------------------------------------------------- /revive.toml: -------------------------------------------------------------------------------- 1 | ignoreGeneratedHeader = false 2 | severity = "warning" 3 | confidence = 0.8 4 | errorCode = 0 5 | warningCode = 0 6 | 7 | [rule.blank-imports] 8 | [rule.context-as-argument] 9 | [rule.context-keys-type] 10 | [rule.dot-imports] 11 | [rule.error-return] 12 | [rule.error-strings] 13 | [rule.error-naming] 14 | [rule.exported] 15 | [rule.increment-decrement] 16 | [rule.var-naming] 17 | [rule.var-declaration] 18 | [rule.range] 19 | [rule.receiver-naming] 20 | [rule.time-naming] 21 | [rule.unexported-return] 22 | [rule.indent-error-flow] 23 | [rule.errorf] 24 | [rule.empty-block] 25 | [rule.superfluous-else] 26 | [rule.unreachable-code] 27 | [rule.redefines-builtin-id] 28 | 29 | # These should be uncommented and resolve in 30 | # future pull requests. 31 | # [rule.package-comments] 32 | # [rule.unused-parameter] 33 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/README.md: -------------------------------------------------------------------------------- 1 | # filippo.io/edwards25519 2 | 3 | ``` 4 | import "filippo.io/edwards25519" 5 | ``` 6 | 7 | This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives. 8 | Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519). 9 | 10 | The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality. 11 | 12 | Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. 13 | 14 | Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements. 15 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package edwards25519 implements group logic for the twisted Edwards curve 6 | // 7 | // -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2 8 | // 9 | // This is better known as the Edwards curve equivalent to Curve25519, and is 10 | // the curve used by the Ed25519 signature scheme. 11 | // 12 | // Most users don't need this package, and should instead use crypto/ed25519 for 13 | // signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or 14 | // github.com/gtank/ristretto255 for prime order group logic. 15 | // 16 | // However, developers who do need to interact with low-level edwards25519 17 | // operations can use this package, which is an extended version of 18 | // crypto/internal/edwards25519 from the standard library repackaged as 19 | // an importable module. 20 | package edwards25519 21 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. 2 | 3 | //go:build amd64 && gc && !purego 4 | // +build amd64,gc,!purego 5 | 6 | package field 7 | 8 | // feMul sets out = a * b. It works like feMulGeneric. 9 | // 10 | //go:noescape 11 | func feMul(out *Element, a *Element, b *Element) 12 | 13 | // feSquare sets out = a * a. It works like feSquareGeneric. 14 | // 15 | //go:noescape 16 | func feSquare(out *Element, a *Element) 17 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 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 !amd64 || !gc || purego 6 | // +build !amd64 !gc purego 7 | 8 | package field 9 | 10 | func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } 11 | 12 | func feSquare(v, x *Element) { feSquareGeneric(v, x) } 13 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 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 arm64 && gc && !purego 6 | // +build arm64,gc,!purego 7 | 8 | package field 9 | 10 | //go:noescape 11 | func carryPropagate(v *Element) 12 | 13 | func (v *Element) carryPropagate() *Element { 14 | carryPropagate(v) 15 | return v 16 | } 17 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 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 arm64 && gc && !purego 6 | 7 | #include "textflag.h" 8 | 9 | // carryPropagate works exactly like carryPropagateGeneric and uses the 10 | // same AND, ADD, and LSR+MADD instructions emitted by the compiler, but 11 | // avoids loading R0-R4 twice and uses LDP and STP. 12 | // 13 | // See https://golang.org/issues/43145 for the main compiler issue. 14 | // 15 | // func carryPropagate(v *Element) 16 | TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 17 | MOVD v+0(FP), R20 18 | 19 | LDP 0(R20), (R0, R1) 20 | LDP 16(R20), (R2, R3) 21 | MOVD 32(R20), R4 22 | 23 | AND $0x7ffffffffffff, R0, R10 24 | AND $0x7ffffffffffff, R1, R11 25 | AND $0x7ffffffffffff, R2, R12 26 | AND $0x7ffffffffffff, R3, R13 27 | AND $0x7ffffffffffff, R4, R14 28 | 29 | ADD R0>>51, R11, R11 30 | ADD R1>>51, R12, R12 31 | ADD R2>>51, R13, R13 32 | ADD R3>>51, R14, R14 33 | // R4>>51 * 19 + R10 -> R10 34 | LSR $51, R4, R21 35 | MOVD $19, R22 36 | MADD R22, R10, R21, R10 37 | 38 | STP (R10, R11), 0(R20) 39 | STP (R12, R13), 16(R20) 40 | MOVD R14, 32(R20) 41 | 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 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 !arm64 || !gc || purego 6 | // +build !arm64 !gc purego 7 | 8 | package field 9 | 10 | func (v *Element) carryPropagate() *Element { 11 | return v.carryPropagateGeneric() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/.gitignore: -------------------------------------------------------------------------------- 1 | /examples/blog/blog 2 | /examples/orders/orders 3 | /examples/basic/basic 4 | .idea/ 5 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go_import_path: github.com/DATA-DOG/go-sqlmock 4 | 5 | go: 6 | - 1.2.x 7 | - 1.3.x 8 | - 1.4 # has no cover tool for latest releases 9 | - 1.5.x 10 | - 1.6.x 11 | - 1.7.x 12 | - 1.8.x 13 | - 1.9.x 14 | - 1.10.x 15 | - 1.11.x 16 | - 1.12.x 17 | - 1.13.x 18 | - 1.14.x 19 | - 1.15.x 20 | - 1.16.x 21 | - 1.17.x 22 | 23 | script: 24 | - go vet 25 | - test -z "$(go fmt ./...)" # fail if not formatted properly 26 | - go test -race -coverprofile=coverage.txt -covermode=atomic 27 | 28 | after_success: 29 | - bash <(curl -s https://codecov.io/bash) 30 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/argument.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import "database/sql/driver" 4 | 5 | // Argument interface allows to match 6 | // any argument in specific way when used with 7 | // ExpectedQuery and ExpectedExec expectations. 8 | type Argument interface { 9 | Match(driver.Value) bool 10 | } 11 | 12 | // AnyArg will return an Argument which can 13 | // match any kind of arguments. 14 | // 15 | // Useful for time.Time or similar kinds of arguments. 16 | func AnyArg() Argument { 17 | return anyArgument{} 18 | } 19 | 20 | type anyArgument struct{} 21 | 22 | func (a anyArgument) Match(_ driver.Value) bool { 23 | return true 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/options.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import "database/sql/driver" 4 | 5 | // ValueConverterOption allows to create a sqlmock connection 6 | // with a custom ValueConverter to support drivers with special data types. 7 | func ValueConverterOption(converter driver.ValueConverter) func(*sqlmock) error { 8 | return func(s *sqlmock) error { 9 | s.converter = converter 10 | return nil 11 | } 12 | } 13 | 14 | // QueryMatcherOption allows to customize SQL query matcher 15 | // and match SQL query strings in more sophisticated ways. 16 | // The default QueryMatcher is QueryMatcherRegexp. 17 | func QueryMatcherOption(queryMatcher QueryMatcher) func(*sqlmock) error { 18 | return func(s *sqlmock) error { 19 | s.queryMatcher = queryMatcher 20 | return nil 21 | } 22 | } 23 | 24 | // MonitorPingsOption determines whether calls to Ping on the driver should be 25 | // observed and mocked. 26 | // 27 | // If true is passed, we will check these calls were expected. Expectations can 28 | // be registered using the ExpectPing() method on the mock. 29 | // 30 | // If false is passed or this option is omitted, calls to Ping will not be 31 | // considered when determining expectations and calls to ExpectPing will have 32 | // no effect. 33 | func MonitorPingsOption(monitorPings bool) func(*sqlmock) error { 34 | return func(s *sqlmock) error { 35 | s.monitorPings = monitorPings 36 | return nil 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/result.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import ( 4 | "database/sql/driver" 5 | ) 6 | 7 | // Result satisfies sql driver Result, which 8 | // holds last insert id and rows affected 9 | // by Exec queries 10 | type result struct { 11 | insertID int64 12 | rowsAffected int64 13 | err error 14 | } 15 | 16 | // NewResult creates a new sql driver Result 17 | // for Exec based query mocks. 18 | func NewResult(lastInsertID int64, rowsAffected int64) driver.Result { 19 | return &result{ 20 | insertID: lastInsertID, 21 | rowsAffected: rowsAffected, 22 | } 23 | } 24 | 25 | // NewErrorResult creates a new sql driver Result 26 | // which returns an error given for both interface methods 27 | func NewErrorResult(err error) driver.Result { 28 | return &result{ 29 | err: err, 30 | } 31 | } 32 | 33 | func (r *result) LastInsertId() (int64, error) { 34 | return r.insertID, r.err 35 | } 36 | 37 | func (r *result) RowsAffected() (int64, error) { 38 | return r.rowsAffected, r.err 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/sqlmock_go18_19.go: -------------------------------------------------------------------------------- 1 | // +build go1.8,!go1.9 2 | 3 | package sqlmock 4 | 5 | import "database/sql/driver" 6 | 7 | // CheckNamedValue meets https://golang.org/pkg/database/sql/driver/#NamedValueChecker 8 | func (c *sqlmock) CheckNamedValue(nv *driver.NamedValue) (err error) { 9 | nv.Value, err = c.converter.ConvertValue(nv.Value) 10 | return err 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/sqlmock_go19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package sqlmock 4 | 5 | import ( 6 | "database/sql" 7 | "database/sql/driver" 8 | ) 9 | 10 | // CheckNamedValue meets https://golang.org/pkg/database/sql/driver/#NamedValueChecker 11 | func (c *sqlmock) CheckNamedValue(nv *driver.NamedValue) (err error) { 12 | switch nv.Value.(type) { 13 | case sql.Out: 14 | return nil 15 | default: 16 | nv.Value, err = c.converter.ConvertValue(nv.Value) 17 | return err 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/statement.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | type statement struct { 4 | conn *sqlmock 5 | ex *ExpectedPrepare 6 | query string 7 | } 8 | 9 | func (stmt *statement) Close() error { 10 | stmt.ex.wasClosed = true 11 | return stmt.ex.closeErr 12 | } 13 | 14 | func (stmt *statement) NumInput() int { 15 | return -1 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/statement_before_go18.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package sqlmock 4 | 5 | import ( 6 | "database/sql/driver" 7 | ) 8 | 9 | // Deprecated: Drivers should implement ExecerContext instead. 10 | func (stmt *statement) Exec(args []driver.Value) (driver.Result, error) { 11 | return stmt.conn.Exec(stmt.query, args) 12 | } 13 | 14 | // Deprecated: Drivers should implement StmtQueryContext instead (or additionally). 15 | func (stmt *statement) Query(args []driver.Value) (driver.Rows, error) { 16 | return stmt.conn.Query(stmt.query, args) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/DATA-DOG/go-sqlmock/statement_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package sqlmock 4 | 5 | import ( 6 | "context" 7 | "database/sql/driver" 8 | ) 9 | 10 | // Deprecated: Drivers should implement ExecerContext instead. 11 | func (stmt *statement) Exec(args []driver.Value) (driver.Result, error) { 12 | return stmt.conn.ExecContext(context.Background(), stmt.query, convertValueToNamedValue(args)) 13 | } 14 | 15 | // Deprecated: Drivers should implement StmtQueryContext instead (or additionally). 16 | func (stmt *statement) Query(args []driver.Value) (driver.Rows, error) { 17 | return stmt.conn.QueryContext(context.Background(), stmt.query, convertValueToNamedValue(args)) 18 | } 19 | 20 | func convertValueToNamedValue(args []driver.Value) []driver.NamedValue { 21 | namedArgs := make([]driver.NamedValue, len(args)) 22 | for i, v := range args { 23 | namedArgs[i] = driver.NamedValue{Ordinal: i + 1, Value: v} 24 | } 25 | return namedArgs 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | .idea/ 3 | # Binaries for programs and plugins 4 | *.exe 5 | *.exe~ 6 | *.dll 7 | *.so 8 | *.dylib 9 | 10 | # Test binary, built with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | 16 | -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | dist: xenial 3 | go: 4 | - '1.10' 5 | - '1.11' 6 | - '1.12' 7 | - '1.13' 8 | - 'tip' 9 | 10 | script: 11 | - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s 12 | - bash <(curl -s https://codecov.io/bash) 13 | -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2020 Alex Saskevich 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. -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/doc.go: -------------------------------------------------------------------------------- 1 | package govalidator 2 | 3 | // A package of validators and sanitizers for strings, structures and collections. 4 | -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/error.go: -------------------------------------------------------------------------------- 1 | package govalidator 2 | 3 | import ( 4 | "sort" 5 | "strings" 6 | ) 7 | 8 | // Errors is an array of multiple errors and conforms to the error interface. 9 | type Errors []error 10 | 11 | // Errors returns itself. 12 | func (es Errors) Errors() []error { 13 | return es 14 | } 15 | 16 | func (es Errors) Error() string { 17 | var errs []string 18 | for _, e := range es { 19 | errs = append(errs, e.Error()) 20 | } 21 | sort.Strings(errs) 22 | return strings.Join(errs, ";") 23 | } 24 | 25 | // Error encapsulates a name, an error and whether there's a custom error message or not. 26 | type Error struct { 27 | Name string 28 | Err error 29 | CustomErrorMessageExists bool 30 | 31 | // Validator indicates the name of the validator that failed 32 | Validator string 33 | Path []string 34 | } 35 | 36 | func (e Error) Error() string { 37 | if e.CustomErrorMessageExists { 38 | return e.Err.Error() 39 | } 40 | 41 | errName := e.Name 42 | if len(e.Path) > 0 { 43 | errName = strings.Join(append(e.Path, e.Name), ".") 44 | } 45 | 46 | return errName + ": " + e.Err.Error() 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/asaskevich/govalidator/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | build: 3 | steps: 4 | - setup-go-workspace 5 | 6 | - script: 7 | name: go get 8 | code: | 9 | go version 10 | go get -t ./... 11 | 12 | - script: 13 | name: go test 14 | code: | 15 | go test -race -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | Icon? 7 | ehthumbs.db 8 | Thumbs.db 9 | .idea 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/atomic_bool.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package. 2 | // 3 | // Copyright 2022 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | //go:build go1.19 9 | // +build go1.19 10 | 11 | package mysql 12 | 13 | import "sync/atomic" 14 | 15 | /****************************************************************************** 16 | * Sync utils * 17 | ******************************************************************************/ 18 | 19 | type atomicBool = atomic.Bool 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/conncheck.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2019 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | //go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos 10 | // +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos 11 | 12 | package mysql 13 | 14 | import ( 15 | "errors" 16 | "io" 17 | "net" 18 | "syscall" 19 | ) 20 | 21 | var errUnexpectedRead = errors.New("unexpected read from socket") 22 | 23 | func connCheck(conn net.Conn) error { 24 | var sysErr error 25 | 26 | sysConn, ok := conn.(syscall.Conn) 27 | if !ok { 28 | return nil 29 | } 30 | rawConn, err := sysConn.SyscallConn() 31 | if err != nil { 32 | return err 33 | } 34 | 35 | err = rawConn.Read(func(fd uintptr) bool { 36 | var buf [1]byte 37 | n, err := syscall.Read(int(fd), buf[:]) 38 | switch { 39 | case n == 0 && err == nil: 40 | sysErr = io.EOF 41 | case n > 0: 42 | sysErr = errUnexpectedRead 43 | case err == syscall.EAGAIN || err == syscall.EWOULDBLOCK: 44 | sysErr = nil 45 | default: 46 | sysErr = err 47 | } 48 | return true 49 | }) 50 | if err != nil { 51 | return err 52 | } 53 | 54 | return sysErr 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2019 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | //go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !illumos 10 | // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos 11 | 12 | package mysql 13 | 14 | import "net" 15 | 16 | func connCheck(conn net.Conn) error { 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.Load() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.Load() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/.gitignore: -------------------------------------------------------------------------------- 1 | glob.iml 2 | .idea 3 | *.cpu 4 | *.mem 5 | *.test 6 | *.dot 7 | *.png 8 | *.svg 9 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.5.3 7 | 8 | script: 9 | - go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 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. -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/bench.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | bench() { 4 | filename="/tmp/$1-$2.bench" 5 | if test -e "${filename}"; 6 | then 7 | echo "Already exists ${filename}" 8 | else 9 | backup=`git rev-parse --abbrev-ref HEAD` 10 | git checkout $1 11 | echo -n "Creating ${filename}... " 12 | go test ./... -run=NONE -bench=$2 > "${filename}" -benchmem 13 | echo "OK" 14 | git checkout ${backup} 15 | sleep 5 16 | fi 17 | } 18 | 19 | 20 | to=$1 21 | current=`git rev-parse --abbrev-ref HEAD` 22 | 23 | bench ${to} $2 24 | bench ${current} $2 25 | 26 | benchcmp $3 "/tmp/${to}-$2.bench" "/tmp/${current}-$2.bench" 27 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/any.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gobwas/glob/util/strings" 6 | ) 7 | 8 | type Any struct { 9 | Separators []rune 10 | } 11 | 12 | func NewAny(s []rune) Any { 13 | return Any{s} 14 | } 15 | 16 | func (self Any) Match(s string) bool { 17 | return strings.IndexAnyRunes(s, self.Separators) == -1 18 | } 19 | 20 | func (self Any) Index(s string) (int, []int) { 21 | found := strings.IndexAnyRunes(s, self.Separators) 22 | switch found { 23 | case -1: 24 | case 0: 25 | return 0, segments0 26 | default: 27 | s = s[:found] 28 | } 29 | 30 | segments := acquireSegments(len(s)) 31 | for i := range s { 32 | segments = append(segments, i) 33 | } 34 | segments = append(segments, len(s)) 35 | 36 | return 0, segments 37 | } 38 | 39 | func (self Any) Len() int { 40 | return lenNo 41 | } 42 | 43 | func (self Any) String() string { 44 | return fmt.Sprintf("", string(self.Separators)) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/contains.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | type Contains struct { 9 | Needle string 10 | Not bool 11 | } 12 | 13 | func NewContains(needle string, not bool) Contains { 14 | return Contains{needle, not} 15 | } 16 | 17 | func (self Contains) Match(s string) bool { 18 | return strings.Contains(s, self.Needle) != self.Not 19 | } 20 | 21 | func (self Contains) Index(s string) (int, []int) { 22 | var offset int 23 | 24 | idx := strings.Index(s, self.Needle) 25 | 26 | if !self.Not { 27 | if idx == -1 { 28 | return -1, nil 29 | } 30 | 31 | offset = idx + len(self.Needle) 32 | if len(s) <= offset { 33 | return 0, []int{offset} 34 | } 35 | s = s[offset:] 36 | } else if idx != -1 { 37 | s = s[:idx] 38 | } 39 | 40 | segments := acquireSegments(len(s) + 1) 41 | for i := range s { 42 | segments = append(segments, offset+i) 43 | } 44 | 45 | return 0, append(segments, offset+len(s)) 46 | } 47 | 48 | func (self Contains) Len() int { 49 | return lenNo 50 | } 51 | 52 | func (self Contains) String() string { 53 | var not string 54 | if self.Not { 55 | not = "!" 56 | } 57 | return fmt.Sprintf("", not, self.Needle) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/list.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gobwas/glob/util/runes" 6 | "unicode/utf8" 7 | ) 8 | 9 | type List struct { 10 | List []rune 11 | Not bool 12 | } 13 | 14 | func NewList(list []rune, not bool) List { 15 | return List{list, not} 16 | } 17 | 18 | func (self List) Match(s string) bool { 19 | r, w := utf8.DecodeRuneInString(s) 20 | if len(s) > w { 21 | return false 22 | } 23 | 24 | inList := runes.IndexRune(self.List, r) != -1 25 | return inList == !self.Not 26 | } 27 | 28 | func (self List) Len() int { 29 | return lenOne 30 | } 31 | 32 | func (self List) Index(s string) (int, []int) { 33 | for i, r := range s { 34 | if self.Not == (runes.IndexRune(self.List, r) == -1) { 35 | return i, segmentsByRuneLength[utf8.RuneLen(r)] 36 | } 37 | } 38 | 39 | return -1, nil 40 | } 41 | 42 | func (self List) String() string { 43 | var not string 44 | if self.Not { 45 | not = "!" 46 | } 47 | 48 | return fmt.Sprintf("", not, string(self.List)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/max.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "unicode/utf8" 6 | ) 7 | 8 | type Max struct { 9 | Limit int 10 | } 11 | 12 | func NewMax(l int) Max { 13 | return Max{l} 14 | } 15 | 16 | func (self Max) Match(s string) bool { 17 | var l int 18 | for range s { 19 | l += 1 20 | if l > self.Limit { 21 | return false 22 | } 23 | } 24 | 25 | return true 26 | } 27 | 28 | func (self Max) Index(s string) (int, []int) { 29 | segments := acquireSegments(self.Limit + 1) 30 | segments = append(segments, 0) 31 | var count int 32 | for i, r := range s { 33 | count++ 34 | if count > self.Limit { 35 | break 36 | } 37 | segments = append(segments, i+utf8.RuneLen(r)) 38 | } 39 | 40 | return 0, segments 41 | } 42 | 43 | func (self Max) Len() int { 44 | return lenNo 45 | } 46 | 47 | func (self Max) String() string { 48 | return fmt.Sprintf("", self.Limit) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/min.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "unicode/utf8" 6 | ) 7 | 8 | type Min struct { 9 | Limit int 10 | } 11 | 12 | func NewMin(l int) Min { 13 | return Min{l} 14 | } 15 | 16 | func (self Min) Match(s string) bool { 17 | var l int 18 | for range s { 19 | l += 1 20 | if l >= self.Limit { 21 | return true 22 | } 23 | } 24 | 25 | return false 26 | } 27 | 28 | func (self Min) Index(s string) (int, []int) { 29 | var count int 30 | 31 | c := len(s) - self.Limit + 1 32 | if c <= 0 { 33 | return -1, nil 34 | } 35 | 36 | segments := acquireSegments(c) 37 | for i, r := range s { 38 | count++ 39 | if count >= self.Limit { 40 | segments = append(segments, i+utf8.RuneLen(r)) 41 | } 42 | } 43 | 44 | if len(segments) == 0 { 45 | return -1, nil 46 | } 47 | 48 | return 0, segments 49 | } 50 | 51 | func (self Min) Len() int { 52 | return lenNo 53 | } 54 | 55 | func (self Min) String() string { 56 | return fmt.Sprintf("", self.Limit) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/nothing.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Nothing struct{} 8 | 9 | func NewNothing() Nothing { 10 | return Nothing{} 11 | } 12 | 13 | func (self Nothing) Match(s string) bool { 14 | return len(s) == 0 15 | } 16 | 17 | func (self Nothing) Index(s string) (int, []int) { 18 | return 0, segments0 19 | } 20 | 21 | func (self Nothing) Len() int { 22 | return lenZero 23 | } 24 | 25 | func (self Nothing) String() string { 26 | return fmt.Sprintf("") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/prefix.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "unicode/utf8" 7 | ) 8 | 9 | type Prefix struct { 10 | Prefix string 11 | } 12 | 13 | func NewPrefix(p string) Prefix { 14 | return Prefix{p} 15 | } 16 | 17 | func (self Prefix) Index(s string) (int, []int) { 18 | idx := strings.Index(s, self.Prefix) 19 | if idx == -1 { 20 | return -1, nil 21 | } 22 | 23 | length := len(self.Prefix) 24 | var sub string 25 | if len(s) > idx+length { 26 | sub = s[idx+length:] 27 | } else { 28 | sub = "" 29 | } 30 | 31 | segments := acquireSegments(len(sub) + 1) 32 | segments = append(segments, length) 33 | for i, r := range sub { 34 | segments = append(segments, length+i+utf8.RuneLen(r)) 35 | } 36 | 37 | return idx, segments 38 | } 39 | 40 | func (self Prefix) Len() int { 41 | return lenNo 42 | } 43 | 44 | func (self Prefix) Match(s string) bool { 45 | return strings.HasPrefix(s, self.Prefix) 46 | } 47 | 48 | func (self Prefix) String() string { 49 | return fmt.Sprintf("", self.Prefix) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/prefix_any.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "unicode/utf8" 7 | 8 | sutil "github.com/gobwas/glob/util/strings" 9 | ) 10 | 11 | type PrefixAny struct { 12 | Prefix string 13 | Separators []rune 14 | } 15 | 16 | func NewPrefixAny(s string, sep []rune) PrefixAny { 17 | return PrefixAny{s, sep} 18 | } 19 | 20 | func (self PrefixAny) Index(s string) (int, []int) { 21 | idx := strings.Index(s, self.Prefix) 22 | if idx == -1 { 23 | return -1, nil 24 | } 25 | 26 | n := len(self.Prefix) 27 | sub := s[idx+n:] 28 | i := sutil.IndexAnyRunes(sub, self.Separators) 29 | if i > -1 { 30 | sub = sub[:i] 31 | } 32 | 33 | seg := acquireSegments(len(sub) + 1) 34 | seg = append(seg, n) 35 | for i, r := range sub { 36 | seg = append(seg, n+i+utf8.RuneLen(r)) 37 | } 38 | 39 | return idx, seg 40 | } 41 | 42 | func (self PrefixAny) Len() int { 43 | return lenNo 44 | } 45 | 46 | func (self PrefixAny) Match(s string) bool { 47 | if !strings.HasPrefix(s, self.Prefix) { 48 | return false 49 | } 50 | return sutil.IndexAnyRunes(s[len(self.Prefix):], self.Separators) == -1 51 | } 52 | 53 | func (self PrefixAny) String() string { 54 | return fmt.Sprintf("", self.Prefix, string(self.Separators)) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/prefix_suffix.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | type PrefixSuffix struct { 9 | Prefix, Suffix string 10 | } 11 | 12 | func NewPrefixSuffix(p, s string) PrefixSuffix { 13 | return PrefixSuffix{p, s} 14 | } 15 | 16 | func (self PrefixSuffix) Index(s string) (int, []int) { 17 | prefixIdx := strings.Index(s, self.Prefix) 18 | if prefixIdx == -1 { 19 | return -1, nil 20 | } 21 | 22 | suffixLen := len(self.Suffix) 23 | if suffixLen <= 0 { 24 | return prefixIdx, []int{len(s) - prefixIdx} 25 | } 26 | 27 | if (len(s) - prefixIdx) <= 0 { 28 | return -1, nil 29 | } 30 | 31 | segments := acquireSegments(len(s) - prefixIdx) 32 | for sub := s[prefixIdx:]; ; { 33 | suffixIdx := strings.LastIndex(sub, self.Suffix) 34 | if suffixIdx == -1 { 35 | break 36 | } 37 | 38 | segments = append(segments, suffixIdx+suffixLen) 39 | sub = sub[:suffixIdx] 40 | } 41 | 42 | if len(segments) == 0 { 43 | releaseSegments(segments) 44 | return -1, nil 45 | } 46 | 47 | reverseSegments(segments) 48 | 49 | return prefixIdx, segments 50 | } 51 | 52 | func (self PrefixSuffix) Len() int { 53 | return lenNo 54 | } 55 | 56 | func (self PrefixSuffix) Match(s string) bool { 57 | return strings.HasPrefix(s, self.Prefix) && strings.HasSuffix(s, self.Suffix) 58 | } 59 | 60 | func (self PrefixSuffix) String() string { 61 | return fmt.Sprintf("", self.Prefix, self.Suffix) 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/range.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "unicode/utf8" 6 | ) 7 | 8 | type Range struct { 9 | Lo, Hi rune 10 | Not bool 11 | } 12 | 13 | func NewRange(lo, hi rune, not bool) Range { 14 | return Range{lo, hi, not} 15 | } 16 | 17 | func (self Range) Len() int { 18 | return lenOne 19 | } 20 | 21 | func (self Range) Match(s string) bool { 22 | r, w := utf8.DecodeRuneInString(s) 23 | if len(s) > w { 24 | return false 25 | } 26 | 27 | inRange := r >= self.Lo && r <= self.Hi 28 | 29 | return inRange == !self.Not 30 | } 31 | 32 | func (self Range) Index(s string) (int, []int) { 33 | for i, r := range s { 34 | if self.Not != (r >= self.Lo && r <= self.Hi) { 35 | return i, segmentsByRuneLength[utf8.RuneLen(r)] 36 | } 37 | } 38 | 39 | return -1, nil 40 | } 41 | 42 | func (self Range) String() string { 43 | var not string 44 | if self.Not { 45 | not = "!" 46 | } 47 | return fmt.Sprintf("", not, string(self.Lo), string(self.Hi)) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/row.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Row struct { 8 | Matchers Matchers 9 | RunesLength int 10 | Segments []int 11 | } 12 | 13 | func NewRow(len int, m ...Matcher) Row { 14 | return Row{ 15 | Matchers: Matchers(m), 16 | RunesLength: len, 17 | Segments: []int{len}, 18 | } 19 | } 20 | 21 | func (self Row) matchAll(s string) bool { 22 | var idx int 23 | for _, m := range self.Matchers { 24 | length := m.Len() 25 | 26 | var next, i int 27 | for next = range s[idx:] { 28 | i++ 29 | if i == length { 30 | break 31 | } 32 | } 33 | 34 | if i < length || !m.Match(s[idx:idx+next+1]) { 35 | return false 36 | } 37 | 38 | idx += next + 1 39 | } 40 | 41 | return true 42 | } 43 | 44 | func (self Row) lenOk(s string) bool { 45 | var i int 46 | for range s { 47 | i++ 48 | if i > self.RunesLength { 49 | return false 50 | } 51 | } 52 | return self.RunesLength == i 53 | } 54 | 55 | func (self Row) Match(s string) bool { 56 | return self.lenOk(s) && self.matchAll(s) 57 | } 58 | 59 | func (self Row) Len() (l int) { 60 | return self.RunesLength 61 | } 62 | 63 | func (self Row) Index(s string) (int, []int) { 64 | for i := range s { 65 | if len(s[i:]) < self.RunesLength { 66 | break 67 | } 68 | if self.matchAll(s[i:]) { 69 | return i, self.Segments 70 | } 71 | } 72 | return -1, nil 73 | } 74 | 75 | func (self Row) String() string { 76 | return fmt.Sprintf("", self.RunesLength, self.Matchers) 77 | } 78 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/single.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gobwas/glob/util/runes" 6 | "unicode/utf8" 7 | ) 8 | 9 | // single represents ? 10 | type Single struct { 11 | Separators []rune 12 | } 13 | 14 | func NewSingle(s []rune) Single { 15 | return Single{s} 16 | } 17 | 18 | func (self Single) Match(s string) bool { 19 | r, w := utf8.DecodeRuneInString(s) 20 | if len(s) > w { 21 | return false 22 | } 23 | 24 | return runes.IndexRune(self.Separators, r) == -1 25 | } 26 | 27 | func (self Single) Len() int { 28 | return lenOne 29 | } 30 | 31 | func (self Single) Index(s string) (int, []int) { 32 | for i, r := range s { 33 | if runes.IndexRune(self.Separators, r) == -1 { 34 | return i, segmentsByRuneLength[utf8.RuneLen(r)] 35 | } 36 | } 37 | 38 | return -1, nil 39 | } 40 | 41 | func (self Single) String() string { 42 | return fmt.Sprintf("", string(self.Separators)) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/suffix.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | type Suffix struct { 9 | Suffix string 10 | } 11 | 12 | func NewSuffix(s string) Suffix { 13 | return Suffix{s} 14 | } 15 | 16 | func (self Suffix) Len() int { 17 | return lenNo 18 | } 19 | 20 | func (self Suffix) Match(s string) bool { 21 | return strings.HasSuffix(s, self.Suffix) 22 | } 23 | 24 | func (self Suffix) Index(s string) (int, []int) { 25 | idx := strings.Index(s, self.Suffix) 26 | if idx == -1 { 27 | return -1, nil 28 | } 29 | 30 | return 0, []int{idx + len(self.Suffix)} 31 | } 32 | 33 | func (self Suffix) String() string { 34 | return fmt.Sprintf("", self.Suffix) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/suffix_any.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | sutil "github.com/gobwas/glob/util/strings" 8 | ) 9 | 10 | type SuffixAny struct { 11 | Suffix string 12 | Separators []rune 13 | } 14 | 15 | func NewSuffixAny(s string, sep []rune) SuffixAny { 16 | return SuffixAny{s, sep} 17 | } 18 | 19 | func (self SuffixAny) Index(s string) (int, []int) { 20 | idx := strings.Index(s, self.Suffix) 21 | if idx == -1 { 22 | return -1, nil 23 | } 24 | 25 | i := sutil.LastIndexAnyRunes(s[:idx], self.Separators) + 1 26 | 27 | return i, []int{idx + len(self.Suffix) - i} 28 | } 29 | 30 | func (self SuffixAny) Len() int { 31 | return lenNo 32 | } 33 | 34 | func (self SuffixAny) Match(s string) bool { 35 | if !strings.HasSuffix(s, self.Suffix) { 36 | return false 37 | } 38 | return sutil.IndexAnyRunes(s[:len(s)-len(self.Suffix)], self.Separators) == -1 39 | } 40 | 41 | func (self SuffixAny) String() string { 42 | return fmt.Sprintf("", string(self.Separators), self.Suffix) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/super.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Super struct{} 8 | 9 | func NewSuper() Super { 10 | return Super{} 11 | } 12 | 13 | func (self Super) Match(s string) bool { 14 | return true 15 | } 16 | 17 | func (self Super) Len() int { 18 | return lenNo 19 | } 20 | 21 | func (self Super) Index(s string) (int, []int) { 22 | segments := acquireSegments(len(s) + 1) 23 | for i := range s { 24 | segments = append(segments, i) 25 | } 26 | segments = append(segments, len(s)) 27 | 28 | return 0, segments 29 | } 30 | 31 | func (self Super) String() string { 32 | return fmt.Sprintf("") 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/match/text.go: -------------------------------------------------------------------------------- 1 | package match 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "unicode/utf8" 7 | ) 8 | 9 | // raw represents raw string to match 10 | type Text struct { 11 | Str string 12 | RunesLength int 13 | BytesLength int 14 | Segments []int 15 | } 16 | 17 | func NewText(s string) Text { 18 | return Text{ 19 | Str: s, 20 | RunesLength: utf8.RuneCountInString(s), 21 | BytesLength: len(s), 22 | Segments: []int{len(s)}, 23 | } 24 | } 25 | 26 | func (self Text) Match(s string) bool { 27 | return self.Str == s 28 | } 29 | 30 | func (self Text) Len() int { 31 | return self.RunesLength 32 | } 33 | 34 | func (self Text) Index(s string) (int, []int) { 35 | index := strings.Index(s, self.Str) 36 | if index == -1 { 37 | return -1, nil 38 | } 39 | 40 | return index, self.Segments 41 | } 42 | 43 | func (self Text) String() string { 44 | return fmt.Sprintf("", self.Str) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/syntax/lexer/token.go: -------------------------------------------------------------------------------- 1 | package lexer 2 | 3 | import "fmt" 4 | 5 | type TokenType int 6 | 7 | const ( 8 | EOF TokenType = iota 9 | Error 10 | Text 11 | Char 12 | Any 13 | Super 14 | Single 15 | Not 16 | Separator 17 | RangeOpen 18 | RangeClose 19 | RangeLo 20 | RangeHi 21 | RangeBetween 22 | TermsOpen 23 | TermsClose 24 | ) 25 | 26 | func (tt TokenType) String() string { 27 | switch tt { 28 | case EOF: 29 | return "eof" 30 | 31 | case Error: 32 | return "error" 33 | 34 | case Text: 35 | return "text" 36 | 37 | case Char: 38 | return "char" 39 | 40 | case Any: 41 | return "any" 42 | 43 | case Super: 44 | return "super" 45 | 46 | case Single: 47 | return "single" 48 | 49 | case Not: 50 | return "not" 51 | 52 | case Separator: 53 | return "separator" 54 | 55 | case RangeOpen: 56 | return "range_open" 57 | 58 | case RangeClose: 59 | return "range_close" 60 | 61 | case RangeLo: 62 | return "range_lo" 63 | 64 | case RangeHi: 65 | return "range_hi" 66 | 67 | case RangeBetween: 68 | return "range_between" 69 | 70 | case TermsOpen: 71 | return "terms_open" 72 | 73 | case TermsClose: 74 | return "terms_close" 75 | 76 | default: 77 | return "undef" 78 | } 79 | } 80 | 81 | type Token struct { 82 | Type TokenType 83 | Raw string 84 | } 85 | 86 | func (t Token) String() string { 87 | return fmt.Sprintf("%v<%q>", t.Type, t.Raw) 88 | } 89 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/syntax/syntax.go: -------------------------------------------------------------------------------- 1 | package syntax 2 | 3 | import ( 4 | "github.com/gobwas/glob/syntax/ast" 5 | "github.com/gobwas/glob/syntax/lexer" 6 | ) 7 | 8 | func Parse(s string) (*ast.Node, error) { 9 | return ast.Parse(lexer.NewLexer(s)) 10 | } 11 | 12 | func Special(b byte) bool { 13 | return lexer.Special(b) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/gobwas/glob/util/strings/strings.go: -------------------------------------------------------------------------------- 1 | package strings 2 | 3 | import ( 4 | "strings" 5 | "unicode/utf8" 6 | ) 7 | 8 | func IndexAnyRunes(s string, rs []rune) int { 9 | for _, r := range rs { 10 | if i := strings.IndexRune(s, r); i != -1 { 11 | return i 12 | } 13 | } 14 | 15 | return -1 16 | } 17 | 18 | func LastIndexAnyRunes(s string, rs []rune) int { 19 | for _, r := range rs { 20 | i := -1 21 | if 0 <= r && r < utf8.RuneSelf { 22 | i = strings.LastIndexByte(s, byte(r)) 23 | } else { 24 | sub := s 25 | for len(sub) > 0 { 26 | j := strings.IndexRune(s, r) 27 | if j == -1 { 28 | break 29 | } 30 | i = j 31 | sub = sub[i+1:] 32 | } 33 | } 34 | if i != -1 { 35 | return i 36 | } 37 | } 38 | return -1 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package mousetrap 5 | 6 | // StartedByExplorer returns true if the program was invoked by the user 7 | // double-clicking on the executable from explorer.exe 8 | // 9 | // It is conservative and returns false if any of the internal calls fail. 10 | // It does not guarantee that the program was run from a terminal. It only can tell you 11 | // whether it was launched from explorer.exe 12 | // 13 | // On non-Windows platforms, it always returns false. 14 | func StartedByExplorer() bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_windows.go: -------------------------------------------------------------------------------- 1 | package mousetrap 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { 9 | snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) 10 | if err != nil { 11 | return nil, err 12 | } 13 | defer syscall.CloseHandle(snapshot) 14 | var procEntry syscall.ProcessEntry32 15 | procEntry.Size = uint32(unsafe.Sizeof(procEntry)) 16 | if err = syscall.Process32First(snapshot, &procEntry); err != nil { 17 | return nil, err 18 | } 19 | for { 20 | if procEntry.ProcessID == uint32(pid) { 21 | return &procEntry, nil 22 | } 23 | err = syscall.Process32Next(snapshot, &procEntry) 24 | if err != nil { 25 | return nil, err 26 | } 27 | } 28 | } 29 | 30 | // StartedByExplorer returns true if the program was invoked by the user double-clicking 31 | // on the executable from explorer.exe 32 | // 33 | // It is conservative and returns false if any of the internal calls fail. 34 | // It does not guarantee that the program was run from a terminal. It only can tell you 35 | // whether it was launched from explorer.exe 36 | func StartedByExplorer() bool { 37 | pe, err := getProcessEntry(syscall.Getppid()) 38 | if err != nil { 39 | return false 40 | } 41 | return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/.gitignore: -------------------------------------------------------------------------------- 1 | /internal/generator/**/*.go -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/.golangci.yaml: -------------------------------------------------------------------------------- 1 | issues: 2 | exclude-rules: 3 | - linters: 4 | - staticcheck 5 | text: "SA9003:" -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jason Walton 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. -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/LICENSE-chalk: -------------------------------------------------------------------------------- 1 | GChalk is based on the node.js pacakge "chalk", which contained the following license: 2 | 3 | MIT License 4 | 5 | Copyright (c) Sindre Sorhus (sindresorhus.com) 6 | 7 | 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: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | 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. 12 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/pkg/ansistyles/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jason Walton 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. -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/pkg/ansistyles/LICENSE-ansi-styles: -------------------------------------------------------------------------------- 1 | ansistyles is based on the node.js pacakge "ansi-styles", which contained the following license: 2 | 3 | MIT License 4 | 5 | Copyright (c) Sindre Sorhus (sindresorhus.com) 6 | 7 | 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: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | 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. 12 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/pkg/ansistyles/ansi256lut.go: -------------------------------------------------------------------------------- 1 | package ansistyles 2 | 3 | var ansi256ToAnsi16Lut = []uint8{ 4 | // Standard colors 5 | 30, 31, 32, 33, 34, 35, 36, 37, 90, 91, 92, 93, 94, 95, 96, 97, 6 | // Colors 7 | 30, 30, 30, 34, 34, 34, 30, 30, 34, 34, 34, 34, 32, 32, 90, 34, 34, 34, 8 | 32, 32, 36, 36, 36, 36, 32, 32, 36, 36, 36, 36, 32, 32, 92, 36, 36, 36, 9 | 30, 30, 30, 34, 34, 34, 30, 30, 90, 34, 34, 34, 32, 90, 90, 90, 94, 94, 10 | 32, 32, 90, 36, 36, 94, 32, 32, 92, 36, 36, 96, 32, 92, 92, 92, 96, 96, 11 | 30, 30, 90, 90, 34, 94, 31, 90, 90, 90, 94, 94, 90, 90, 90, 90, 94, 94, 12 | 33, 90, 90, 90, 94, 94, 33, 92, 92, 92, 96, 96, 92, 92, 92, 92, 96, 96, 13 | 31, 31, 90, 35, 35, 35, 31, 31, 90, 35, 35, 35, 31, 90, 90, 90, 94, 94, 14 | 33, 33, 90, 37, 37, 94, 33, 33, 92, 37, 37, 37, 33, 92, 92, 92, 37, 96, 15 | 31, 31, 31, 35, 35, 35, 31, 31, 91, 35, 35, 35, 31, 91, 91, 35, 35, 95, 16 | 33, 33, 91, 37, 37, 95, 33, 33, 93, 37, 37, 37, 33, 93, 93, 93, 37, 97, 17 | 31, 31, 91, 35, 35, 35, 31, 91, 91, 35, 35, 95, 31, 91, 91, 91, 95, 95, 18 | 33, 91, 91, 91, 95, 95, 33, 93, 93, 93, 37, 97, 33, 93, 93, 93, 97, 97, 19 | // Greyscale 20 | 30, 30, 30, 30, 30, 90, 90, 90, 90, 90, 90, 90, 21 | 90, 90, 90, 37, 37, 37, 37, 37, 37, 37, 97, 97, 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/pkg/ansistyles/makeScreenshot.sh: -------------------------------------------------------------------------------- 1 | # To use: 2 | # 3 | # npm install -g svg-term-cli 4 | # brew install asciinema 5 | # 6 | svg-term --command='go test -run TestScreenshot | head -n 3' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor 7 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skpr/mtk/4d2e6d0fe280cfadeeaf24194be5c606c941909b/vendor/github.com/jwalton/gchalk/screenshot.png -------------------------------------------------------------------------------- /vendor/github.com/jwalton/gchalk/util.go: -------------------------------------------------------------------------------- 1 | package gchalk 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | var crlfRegex = regexp.MustCompile(`(\r\n|\n)`) 9 | 10 | func stringEncaseCRLF(str string, prefix string, postfix string) string { 11 | return crlfRegex.ReplaceAllString(str, prefix+"${1}"+postfix) 12 | } 13 | 14 | func strEqualsIgnoreCase(a string, b string) bool { 15 | if len(a) != len(b) { 16 | return false 17 | } 18 | return strings.EqualFold(a, b) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/colorlevel_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ColorLevel"; DO NOT EDIT. 2 | 3 | package supportscolor 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[None-0] 12 | _ = x[Basic-1] 13 | _ = x[Ansi256-2] 14 | _ = x[Ansi16m-3] 15 | } 16 | 17 | const _ColorLevel_name = "NoneBasicAnsi256Ansi16m" 18 | 19 | var _ColorLevel_index = [...]uint8{0, 4, 9, 16, 23} 20 | 21 | func (i ColorLevel) String() string { 22 | if i < 0 || i >= ColorLevel(len(_ColorLevel_index)-1) { 23 | return "ColorLevel(" + strconv.FormatInt(int64(i), 10) + ")" 24 | } 25 | return _ColorLevel_name[_ColorLevel_index[i]:_ColorLevel_index[i+1]] 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/colorlevels.go: -------------------------------------------------------------------------------- 1 | package supportscolor 2 | 3 | //go:generate stringer -type=ColorLevel 4 | 5 | // ColorLevel represents the ANSI color level supported by the terminal. 6 | type ColorLevel int 7 | 8 | const ( 9 | // None represents a terminal that does not support color at all. 10 | None ColorLevel = 0 11 | // Basic represents a terminal with basic 16 color support. 12 | Basic ColorLevel = 1 13 | // Ansi256 represents a terminal with 256 color support. 14 | Ansi256 ColorLevel = 2 15 | // Ansi16m represents a terminal with full true color support. 16 | Ansi16m ColorLevel = 3 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/di.go: -------------------------------------------------------------------------------- 1 | package supportscolor 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | hasflag "github.com/jwalton/go-supportscolor/pkg/hasFlag" 8 | "golang.org/x/term" 9 | ) 10 | 11 | type environment interface { 12 | LookupEnv(name string) (string, bool) 13 | Getenv(name string) string 14 | HasFlag(name string) bool 15 | IsTerminal(fd int) bool 16 | getWindowsVersion() (majorVersion, minorVersion, buildNumber uint32) 17 | osEnableColor() bool 18 | getGOOS() string 19 | } 20 | 21 | type defaultEnvironmentType struct{} 22 | 23 | func (*defaultEnvironmentType) LookupEnv(name string) (string, bool) { 24 | return os.LookupEnv(name) 25 | } 26 | 27 | func (*defaultEnvironmentType) Getenv(name string) string { 28 | return os.Getenv(name) 29 | } 30 | 31 | func (*defaultEnvironmentType) HasFlag(flag string) bool { 32 | return hasflag.HasFlag(flag) 33 | } 34 | 35 | func (*defaultEnvironmentType) IsTerminal(fd int) bool { 36 | // TODO: Replace with github.com/mattn/go-isatty? 37 | return term.IsTerminal(int(fd)) 38 | } 39 | 40 | func (*defaultEnvironmentType) getWindowsVersion() (majorVersion, minorVersion, buildNumber uint32) { 41 | return getWindowsVersion() 42 | } 43 | 44 | func (*defaultEnvironmentType) osEnableColor() bool { 45 | return enableColor() 46 | } 47 | 48 | func (*defaultEnvironmentType) getGOOS() string { 49 | return runtime.GOOS 50 | } 51 | 52 | var defaultEnvironment = defaultEnvironmentType{} 53 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/osutils.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package supportscolor 4 | 5 | func getWindowsVersion() (majorVersion, minorVersion, buildNumber uint32) { 6 | return 0, 0, 0 7 | } 8 | 9 | // enableColor will enable color in the terminal. Returns true if color was 10 | // enabled, false otherwise. 11 | func enableColor() bool { 12 | return true 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/osutils_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package supportscolor 4 | 5 | import ( 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | func getWindowsVersion() (majorVersion, minorVersion, buildNumber uint32) { 10 | return windows.RtlGetNtVersionNumbers() 11 | } 12 | 13 | func enableColor() bool { 14 | handle, err := windows.GetStdHandle(windows.STD_OUTPUT_HANDLE) 15 | if err != nil { 16 | return false 17 | } 18 | 19 | // Get the existing console mode. 20 | var mode uint32 21 | err = windows.GetConsoleMode(handle, &mode) 22 | if err != nil { 23 | return false 24 | } 25 | 26 | // If ENABLE_VIRTUAL_TERMINAL_PROCESSING is not set, then set it. This will 27 | // enable native ANSI color support from Windows. 28 | if mode&windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING != windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING { 29 | // Enable color. 30 | // See https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences. 31 | mode = mode | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING 32 | err = windows.SetConsoleMode(handle, mode) 33 | if err != nil { 34 | return false 35 | } 36 | } 37 | 38 | return true 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/pkg/hasFlag/LICENSE: -------------------------------------------------------------------------------- 1 | The files in this folder were ported from https://github.com/sindresorhus/has-flag, which had the following copyright notice: 2 | 3 | MIT License 4 | 5 | Copyright (c) Sindre Sorhus (sindresorhus.com) 6 | 7 | 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: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | 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. 12 | -------------------------------------------------------------------------------- /vendor/github.com/jwalton/go-supportscolor/pkg/hasFlag/hasFlag.go: -------------------------------------------------------------------------------- 1 | // Package hasflag checks if `os.Args` has a specific flag. Correctly stops looking 2 | // after an -- argument terminator. 3 | // 4 | // Ported from https://github.com/sindresorhus/has-flag 5 | // 6 | package hasflag 7 | 8 | import ( 9 | "os" 10 | "strings" 11 | ) 12 | 13 | func argIndexOf(argv []string, str string) int { 14 | result := -1 15 | for index, arg := range argv { 16 | if arg == str { 17 | result = index 18 | break 19 | } 20 | } 21 | 22 | return result 23 | } 24 | 25 | // HasFlag checks to see if the given flag was supplied on the command line. 26 | // 27 | func HasFlag(flag string) bool { 28 | return hasFlag(flag, os.Args[1:]) 29 | } 30 | 31 | func hasFlag(flag string, argv []string) bool { 32 | var prefix string 33 | 34 | if strings.HasPrefix(flag, "-") { 35 | prefix = "" 36 | } else if len(flag) == 1 { 37 | prefix = "-" 38 | } else { 39 | prefix = "--" 40 | } 41 | 42 | position := argIndexOf(argv, prefix+flag) 43 | terminatorPosition := argIndexOf(argv, "--") 44 | return position != -1 && (terminatorPosition == -1 || position < terminatorPosition) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | cobra.test 36 | bin 37 | 38 | .idea/ 39 | *.iml 40 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/MAINTAINERS: -------------------------------------------------------------------------------- 1 | maintainers: 2 | - spf13 3 | - johnSchnake 4 | - jpmcb 5 | - marckhouzam 6 | inactive: 7 | - anthonyfok 8 | - bep 9 | - bogem 10 | - broady 11 | - eparis 12 | - jharshman 13 | - wfernandes 14 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/Makefile: -------------------------------------------------------------------------------- 1 | BIN="./bin" 2 | SRC=$(shell find . -name "*.go") 3 | 4 | ifeq (, $(shell which golangci-lint)) 5 | $(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") 6 | endif 7 | 8 | .PHONY: fmt lint test install_deps clean 9 | 10 | default: all 11 | 12 | all: fmt test 13 | 14 | fmt: 15 | $(info ******************** checking formatting ********************) 16 | @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) 17 | 18 | lint: 19 | $(info ******************** running lint tools ********************) 20 | golangci-lint run -v 21 | 22 | test: install_deps 23 | $(info ******************** running tests ********************) 24 | go test -v ./... 25 | 26 | richtest: install_deps 27 | $(info ******************** running tests with kyoh86/richgo ********************) 28 | richgo test -v ./... 29 | 30 | install_deps: 31 | $(info ******************** downloading dependencies ********************) 32 | go get -v ./... 33 | 34 | clean: 35 | rm -rf $(BIN) 36 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2023 The Cobra Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !windows 16 | // +build !windows 17 | 18 | package cobra 19 | 20 | var preExecHookFn func(*Command) 21 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2023 The Cobra Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build windows 16 | // +build windows 17 | 18 | package cobra 19 | 20 | import ( 21 | "fmt" 22 | "os" 23 | "time" 24 | 25 | "github.com/inconshreveable/mousetrap" 26 | ) 27 | 28 | var preExecHookFn = preExecHook 29 | 30 | func preExecHook(c *Command) { 31 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 32 | c.Print(MousetrapHelpText) 33 | if MousetrapDisplayDuration > 0 { 34 | time.Sleep(MousetrapDisplayDuration) 35 | } else { 36 | c.Println("Press return to continue...") 37 | fmt.Scanln() 38 | } 39 | os.Exit(1) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // # Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/assert" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // assert.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // if you assert many times, use the format below: 22 | // 23 | // import ( 24 | // "testing" 25 | // "github.com/stretchr/testify/assert" 26 | // ) 27 | // 28 | // func TestSomething(t *testing.T) { 29 | // assert := assert.New(t) 30 | // 31 | // var a string = "Hello" 32 | // var b string = "Hello" 33 | // 34 | // assert.Equal(a, b, "The two words should be the same.") 35 | // } 36 | // 37 | // # Assertions 38 | // 39 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 40 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 41 | // testing framework. This allows the assertion funcs to write the failings and other details to 42 | // the correct place. 43 | // 44 | // Every assertion function also takes an optional string message as the final argument, 45 | // allowing custom error messages to be appended to the message the assertion method outputs. 46 | package assert 47 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/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/plan9/asm.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 | #include "textflag.h" 6 | 7 | TEXT ·use(SB),NOSPLIT,$0 8 | RET 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_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 | #include "textflag.h" 6 | 7 | // 8 | // System call support for 386, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-32 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-36 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$4-4 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_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 | #include "textflag.h" 6 | 7 | // 8 | // System call support for amd64, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-64 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-56 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$8-8 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_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 | #include "textflag.h" 6 | 7 | // System call support for plan9 on arm 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-32 13 | JMP syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 16 | JMP syscall·Syscall6(SB) 17 | 18 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 19 | JMP syscall·RawSyscall(SB) 20 | 21 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·RawSyscall6(SB) 23 | 24 | TEXT ·seek(SB),NOSPLIT,$0-36 25 | JMP syscall·exit(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/const_plan9.go: -------------------------------------------------------------------------------- 1 | package plan9 2 | 3 | // Plan 9 Constants 4 | 5 | // Open modes 6 | const ( 7 | O_RDONLY = 0 8 | O_WRONLY = 1 9 | O_RDWR = 2 10 | O_TRUNC = 16 11 | O_CLOEXEC = 32 12 | O_EXCL = 0x1000 13 | ) 14 | 15 | // Rfork flags 16 | const ( 17 | RFNAMEG = 1 << 0 18 | RFENVG = 1 << 1 19 | RFFDG = 1 << 2 20 | RFNOTEG = 1 << 3 21 | RFPROC = 1 << 4 22 | RFMEM = 1 << 5 23 | RFNOWAIT = 1 << 6 24 | RFCNAMEG = 1 << 10 25 | RFCENVG = 1 << 11 26 | RFCFDG = 1 << 12 27 | RFREND = 1 << 13 28 | RFNOMNT = 1 << 14 29 | ) 30 | 31 | // Qid.Type bits 32 | const ( 33 | QTDIR = 0x80 34 | QTAPPEND = 0x40 35 | QTEXCL = 0x20 36 | QTMOUNT = 0x10 37 | QTAUTH = 0x08 38 | QTTMP = 0x04 39 | QTFILE = 0x00 40 | ) 41 | 42 | // Dir.Mode bits 43 | const ( 44 | DMDIR = 0x80000000 45 | DMAPPEND = 0x40000000 46 | DMEXCL = 0x20000000 47 | DMMOUNT = 0x10000000 48 | DMAUTH = 0x08000000 49 | DMTMP = 0x04000000 50 | DMREAD = 0x4 51 | DMWRITE = 0x2 52 | DMEXEC = 0x1 53 | ) 54 | 55 | const ( 56 | STATMAX = 65535 57 | ERRMAX = 128 58 | STATFIXLEN = 49 59 | ) 60 | 61 | // Mount and bind flags 62 | const ( 63 | MREPL = 0x0000 64 | MBEFORE = 0x0001 65 | MAFTER = 0x0002 66 | MORDER = 0x0003 67 | MCREATE = 0x0004 68 | MCACHE = 0x0010 69 | MMASK = 0x0017 70 | ) 71 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Plan 9 environment variables. 6 | 7 | package plan9 8 | 9 | import ( 10 | "syscall" 11 | ) 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | COMMAND="mksysnum_plan9.sh $@" 7 | 8 | cat <= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/zsysnum_plan9.go: -------------------------------------------------------------------------------- 1 | // mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h 2 | // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT 3 | 4 | package plan9 5 | 6 | const ( 7 | SYS_SYSR1 = 0 8 | SYS_BIND = 2 9 | SYS_CHDIR = 3 10 | SYS_CLOSE = 4 11 | SYS_DUP = 5 12 | SYS_ALARM = 6 13 | SYS_EXEC = 7 14 | SYS_EXITS = 8 15 | SYS_FAUTH = 10 16 | SYS_SEGBRK = 12 17 | SYS_OPEN = 14 18 | SYS_OSEEK = 16 19 | SYS_SLEEP = 17 20 | SYS_RFORK = 19 21 | SYS_PIPE = 21 22 | SYS_CREATE = 22 23 | SYS_FD2PATH = 23 24 | SYS_BRK_ = 24 25 | SYS_REMOVE = 25 26 | SYS_NOTIFY = 28 27 | SYS_NOTED = 29 28 | SYS_SEGATTACH = 30 29 | SYS_SEGDETACH = 31 30 | SYS_SEGFREE = 32 31 | SYS_SEGFLUSH = 33 32 | SYS_RENDEZVOUS = 34 33 | SYS_UNMOUNT = 35 34 | SYS_SEMACQUIRE = 37 35 | SYS_SEMRELEASE = 38 36 | SYS_SEEK = 39 37 | SYS_FVERSION = 40 38 | SYS_ERRSTR = 41 39 | SYS_STAT = 42 40 | SYS_FSTAT = 43 41 | SYS_WSTAT = 44 42 | SYS_FWSTAT = 45 43 | SYS_MOUNT = 46 44 | SYS_AWAIT = 47 45 | SYS_PREAD = 50 46 | SYS_PWRITE = 51 47 | SYS_TSEMACQUIRE = 52 48 | SYS_NSEC = 53 49 | ) 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·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 ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·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 ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-56 13 | B syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 16 | B syscall·Syscall6(SB) 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R0 21 | MOVD a2+16(FP), R1 22 | MOVD a3+24(FP), R2 23 | MOVD $0, R3 24 | MOVD $0, R4 25 | MOVD $0, R5 26 | MOVD trap+0(FP), R8 // syscall entry 27 | SVC 28 | MOVD R0, r1+32(FP) // r1 29 | MOVD R1, r2+40(FP) // r2 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | B syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | B syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOVD a1+8(FP), R0 41 | MOVD a2+16(FP), R1 42 | MOVD a3+24(FP), R2 43 | MOVD $0, R3 44 | MOVD $0, R4 45 | MOVD $0, R5 46 | MOVD trap+0(FP), R8 // syscall entry 47 | SVC 48 | MOVD R0, r1+32(FP) 49 | MOVD R1, r2+40(FP) 50 | RET 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | 10 | // Just jump to package syscall's implementation for all these functions. 11 | // The runtime may know about them. 12 | 13 | TEXT ·Syscall(SB),NOSPLIT,$0-56 14 | JMP syscall·Syscall(SB) 15 | 16 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 17 | JMP syscall·Syscall6(SB) 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | JAL runtime·entersyscall(SB) 21 | MOVV a1+8(FP), R4 22 | MOVV a2+16(FP), R5 23 | MOVV a3+24(FP), R6 24 | MOVV R0, R7 25 | MOVV R0, R8 26 | MOVV R0, R9 27 | MOVV trap+0(FP), R11 // syscall entry 28 | SYSCALL 29 | MOVV R4, r1+32(FP) 30 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 31 | JAL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 35 | JMP syscall·RawSyscall(SB) 36 | 37 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 38 | JMP syscall·RawSyscall6(SB) 39 | 40 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 41 | MOVV a1+8(FP), R4 42 | MOVV a2+16(FP), R5 43 | MOVV a3+24(FP), R6 44 | MOVV R0, R7 45 | MOVV R0, R8 46 | MOVV R0, R9 47 | MOVV trap+0(FP), R11 // syscall entry 48 | SYSCALL 49 | MOVV R4, r1+32(FP) 50 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 51 | RET 52 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·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 ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R2 // syscall entry 31 | SYSCALL 32 | MOVV R2, r1+32(FP) 33 | MOVV R3, r2+40(FP) 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVV R2, r1+32(FP) 53 | MOVV R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·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 ·SyscallNoError(SB),NOSPLIT,$0-24 26 | JAL runtime·entersyscall(SB) 27 | MOVW a1+4(FP), R4 28 | MOVW a2+8(FP), R5 29 | MOVW a3+12(FP), R6 30 | MOVW R0, R7 31 | MOVW trap+0(FP), R2 // syscall entry 32 | SYSCALL 33 | MOVW R2, r1+16(FP) // r1 34 | MOVW R3, r2+20(FP) // r2 35 | JAL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW a1+4(FP), R4 46 | MOVW a2+8(FP), R5 47 | MOVW a3+12(FP), R6 48 | MOVW trap+0(FP), R2 // syscall entry 49 | SYSCALL 50 | MOVW R2, r1+16(FP) 51 | MOVW R3, r2+20(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for s390x, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | BR syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | BR syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | BL runtime·entersyscall(SB) 24 | MOVD a1+8(FP), R2 25 | MOVD a2+16(FP), R3 26 | MOVD a3+24(FP), R4 27 | MOVD $0, R5 28 | MOVD $0, R6 29 | MOVD $0, R7 30 | MOVD trap+0(FP), R1 // syscall entry 31 | SYSCALL 32 | MOVD R2, r1+32(FP) 33 | MOVD R3, r2+40(FP) 34 | BL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | BR syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | BR syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVD a1+8(FP), R2 45 | MOVD a2+16(FP), R3 46 | MOVD a3+24(FP), R4 47 | MOVD $0, R5 48 | MOVD $0, R6 49 | MOVD $0, R7 50 | MOVD trap+0(FP), R1 // syscall entry 51 | SYSCALL 52 | MOVD R2, r1+32(FP) 53 | MOVD R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.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 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "ios", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | // NetBSD aarch64 requires 128-bit alignment. 36 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 37 | salign = 16 38 | } 39 | case "zos": 40 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 41 | // not pointer width. 42 | salign = SizeofInt 43 | } 44 | 45 | return (salen + salign - 1) & ^(salign - 1) 46 | } 47 | -------------------------------------------------------------------------------- /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 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 19 | 20 | //go:linkname syscall_syscall syscall.syscall 21 | //go:linkname syscall_syscall6 syscall.syscall6 22 | //go:linkname syscall_syscall6X syscall.syscall6X 23 | //go:linkname syscall_syscall9 syscall.syscall9 24 | //go:linkname syscall_rawSyscall syscall.rawSyscall 25 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 26 | //go:linkname syscall_syscallPtr syscall.syscallPtr 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | 15 | func ioctl(fd int, req uint, arg uintptr) (err error) { 16 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 17 | if r0 == -1 && er != nil { 18 | err = er 19 | } 20 | return 21 | } 22 | 23 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 24 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 25 | if r0 == -1 && er != nil { 26 | err = er 27 | } 28 | return 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /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 (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.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 ppc64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.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 riscv64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 "fmt" 8 | 9 | // Unveil implements the unveil syscall. 10 | // For more information see unveil(2). 11 | // Note that the special case of blocking further 12 | // unveil calls is handled by UnveilBlock. 13 | func Unveil(path string, flags string) error { 14 | if err := supportsUnveil(); err != nil { 15 | return err 16 | } 17 | pathPtr, err := BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | return unveil(pathPtr, flagsPtr) 26 | } 27 | 28 | // UnveilBlock blocks future unveil calls. 29 | // For more information see unveil(2). 30 | func UnveilBlock() error { 31 | if err := supportsUnveil(); err != nil { 32 | return err 33 | } 34 | return unveil(nil, nil) 35 | } 36 | 37 | // supportsUnveil checks for availability of the unveil(2) system call based 38 | // on the running OpenBSD version. 39 | func supportsUnveil() error { 40 | maj, min, err := majmin() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // unveil is not available before 6.4 46 | if maj < 6 || (maj == 6 && min <= 3) { 47 | return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /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 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsArm is the registers used by arm binaries. 10 | type PtraceRegsArm struct { 11 | Uregs [18]uint32 12 | } 13 | 14 | // PtraceGetRegsArm fetches the registers used by arm binaries. 15 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 16 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 17 | } 18 | 19 | // PtraceSetRegsArm sets the registers used by arm binaries. 20 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 21 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 22 | } 23 | 24 | // PtraceRegsArm64 is the registers used by arm64 binaries. 25 | type PtraceRegsArm64 struct { 26 | Regs [31]uint64 27 | Sp uint64 28 | Pc uint64 29 | Pstate uint64 30 | } 31 | 32 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 33 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 34 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 35 | } 36 | 37 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 38 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 39 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.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 windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkknownfolderids.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 The Go Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file. 6 | 7 | set -e 8 | shopt -s nullglob 9 | 10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" 11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } 12 | 13 | { 14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." 15 | echo 16 | echo "package windows" 17 | echo "type KNOWNFOLDERID GUID" 18 | echo "var (" 19 | while read -r line; do 20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue 21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ 22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ 23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ 24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) 25 | done < "$knownfolders" 26 | echo ")" 27 | } | gofmt > "zknownfolderids_windows.go" 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.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 generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows && race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows && !race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_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 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/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/term/README.md: -------------------------------------------------------------------------------- 1 | # Go terminal/console support 2 | 3 | [](https://pkg.go.dev/golang.org/x/term) 4 | 5 | This repository provides Go terminal and console support packages. 6 | 7 | ## Download/Install 8 | 9 | The easiest way to install is to run `go get -u golang.org/x/term`. You can 10 | also manually git clone the repository to `$GOPATH/src/golang.org/x/term`. 11 | 12 | ## Report Issues / Send Patches 13 | 14 | This repository uses Gerrit for code changes. To learn how to submit changes to 15 | this repository, see https://golang.org/doc/contribute.html. 16 | 17 | The main issue tracker for the term repository is located at 18 | https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the 19 | subject line, so it is easy to find. 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_plan9.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 term 6 | 7 | import ( 8 | "fmt" 9 | "runtime" 10 | 11 | "golang.org/x/sys/plan9" 12 | ) 13 | 14 | type state struct{} 15 | 16 | func isTerminal(fd int) bool { 17 | path, err := plan9.Fd2path(fd) 18 | if err != nil { 19 | return false 20 | } 21 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 22 | } 23 | 24 | func makeRaw(fd int) (*State, error) { 25 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 26 | } 27 | 28 | func getState(fd int) (*State, error) { 29 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 30 | } 31 | 32 | func restore(fd int, state *State) error { 33 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 34 | } 35 | 36 | func getSize(fd int) (width, height int, err error) { 37 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 38 | } 39 | 40 | func readPassword(fd int) ([]byte, error) { 41 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_unix_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd 6 | 7 | package term 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_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 aix || linux || solaris || zos 6 | 7 | package term 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TCGETS 12 | const ioctlWriteTermios = unix.TCSETS 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_unsupported.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 && !zos && !windows && !solaris && !plan9 6 | 7 | package term 8 | 9 | import ( 10 | "fmt" 11 | "runtime" 12 | ) 13 | 14 | type state struct{} 15 | 16 | func isTerminal(fd int) bool { 17 | return false 18 | } 19 | 20 | func makeRaw(fd int) (*State, error) { 21 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 22 | } 23 | 24 | func getState(fd int) (*State, error) { 25 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 26 | } 27 | 28 | func restore(fd int, state *State) error { 29 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 30 | } 31 | 32 | func getSize(fd int) (width, height int, err error) { 33 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 34 | } 35 | 36 | func readPassword(fd int) ([]byte, error) { 37 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------
{siteConfig.tagline}