├── .gitignore ├── .travis.yml ├── .travis └── check_workspace.sh ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── applylist ├── factory.go ├── factory_test.go ├── mock_factory.go └── util.go ├── demo ├── README.md ├── deployment.yaml └── service.yaml ├── git ├── gitutil.go └── mock_gitutil.go ├── go.mod ├── go.sum ├── kube ├── client.go ├── client_test.go └── mock_client.go ├── main.go ├── metrics ├── prometheus.go └── prometheus_test.go ├── run ├── batch_applier.go ├── batch_applier_test.go ├── mock_batch_applier.go ├── result.go ├── result_test.go ├── runner.go ├── runner_test.go ├── scheduler.go └── scheduler_test.go ├── static ├── bootstrap │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery.min.js │ │ └── npm.js ├── img │ ├── favicon.ico │ └── status_page_screenshot.png ├── js │ └── main.js └── stylesheets │ └── main.css ├── sysutil ├── clock.go ├── envar.go ├── filesystem.go ├── misc.go ├── mock_clock.go └── mock_filesystem.go ├── templates ├── kubeconfig └── status.html ├── vendor ├── github.com │ ├── beorn7 │ │ └── perks │ │ │ ├── LICENSE │ │ │ └── quantile │ │ │ ├── exampledata.txt │ │ │ └── stream.go │ ├── cespare │ │ └── xxhash │ │ │ └── v2 │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── xxhash.go │ │ │ ├── xxhash_amd64.go │ │ │ ├── xxhash_amd64.s │ │ │ ├── xxhash_other.go │ │ │ ├── xxhash_safe.go │ │ │ └── xxhash_unsafe.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── golang │ │ ├── mock │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ └── gomock │ │ │ │ ├── call.go │ │ │ │ ├── callset.go │ │ │ │ ├── controller.go │ │ │ │ └── matchers.go │ │ └── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── proto │ │ │ ├── buffer.go │ │ │ ├── defaults.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── extensions.go │ │ │ ├── properties.go │ │ │ ├── proto.go │ │ │ ├── registry.go │ │ │ ├── text_decode.go │ │ │ ├── text_encode.go │ │ │ ├── wire.go │ │ │ └── wrappers.go │ │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ └── any.pb.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ └── duration.pb.go │ │ │ ├── timestamp.go │ │ │ └── timestamp │ │ │ └── timestamp.pb.go │ ├── matttproud │ │ └── golang_protobuf_extensions │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── pbutil │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ ├── prometheus │ │ ├── client_golang │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── prometheus │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── collector.go │ │ │ │ ├── counter.go │ │ │ │ ├── desc.go │ │ │ │ ├── doc.go │ │ │ │ ├── expvar_collector.go │ │ │ │ ├── fnv.go │ │ │ │ ├── gauge.go │ │ │ │ ├── go_collector.go │ │ │ │ ├── histogram.go │ │ │ │ ├── internal │ │ │ │ └── metric.go │ │ │ │ ├── labels.go │ │ │ │ ├── metric.go │ │ │ │ ├── observer.go │ │ │ │ ├── process_collector.go │ │ │ │ ├── process_collector_other.go │ │ │ │ ├── process_collector_windows.go │ │ │ │ ├── promhttp │ │ │ │ ├── delegator.go │ │ │ │ ├── http.go │ │ │ │ ├── instrument_client.go │ │ │ │ ├── instrument_server.go │ │ │ │ └── option.go │ │ │ │ ├── registry.go │ │ │ │ ├── summary.go │ │ │ │ ├── timer.go │ │ │ │ ├── untyped.go │ │ │ │ ├── value.go │ │ │ │ ├── vec.go │ │ │ │ └── wrap.go │ │ ├── client_model │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── go │ │ │ │ └── metrics.pb.go │ │ ├── common │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── expfmt │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── expfmt.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── openmetrics_create.go │ │ │ │ ├── text_create.go │ │ │ │ └── text_parse.go │ │ │ ├── internal │ │ │ │ └── bitbucket.org │ │ │ │ │ └── ww │ │ │ │ │ └── goautoneg │ │ │ │ │ ├── README.txt │ │ │ │ │ └── autoneg.go │ │ │ └── model │ │ │ │ ├── alert.go │ │ │ │ ├── fingerprinting.go │ │ │ │ ├── fnv.go │ │ │ │ ├── labels.go │ │ │ │ ├── labelset.go │ │ │ │ ├── metric.go │ │ │ │ ├── model.go │ │ │ │ ├── signature.go │ │ │ │ ├── silence.go │ │ │ │ ├── time.go │ │ │ │ └── value.go │ │ └── procfs │ │ │ ├── .gitignore │ │ │ ├── .golangci.yml │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS.md │ │ │ ├── Makefile │ │ │ ├── Makefile.common │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── arp.go │ │ │ ├── buddyinfo.go │ │ │ ├── cpuinfo.go │ │ │ ├── cpuinfo_armx.go │ │ │ ├── cpuinfo_mipsx.go │ │ │ ├── cpuinfo_others.go │ │ │ ├── cpuinfo_ppcx.go │ │ │ ├── cpuinfo_riscvx.go │ │ │ ├── cpuinfo_s390x.go │ │ │ ├── cpuinfo_x86.go │ │ │ ├── crypto.go │ │ │ ├── doc.go │ │ │ ├── fixtures.ttar │ │ │ ├── fs.go │ │ │ ├── fscache.go │ │ │ ├── internal │ │ │ ├── fs │ │ │ │ └── fs.go │ │ │ └── util │ │ │ │ ├── parse.go │ │ │ │ ├── readfile.go │ │ │ │ ├── sysreadfile.go │ │ │ │ ├── sysreadfile_compat.go │ │ │ │ └── valueparser.go │ │ │ ├── ipvs.go │ │ │ ├── kernel_random.go │ │ │ ├── loadavg.go │ │ │ ├── mdstat.go │ │ │ ├── meminfo.go │ │ │ ├── mountinfo.go │ │ │ ├── mountstats.go │ │ │ ├── net_conntrackstat.go │ │ │ ├── net_dev.go │ │ │ ├── net_ip_socket.go │ │ │ ├── net_protocols.go │ │ │ ├── net_sockstat.go │ │ │ ├── net_softnet.go │ │ │ ├── net_tcp.go │ │ │ ├── net_udp.go │ │ │ ├── net_unix.go │ │ │ ├── proc.go │ │ │ ├── proc_cgroup.go │ │ │ ├── proc_environ.go │ │ │ ├── proc_fdinfo.go │ │ │ ├── proc_io.go │ │ │ ├── proc_limits.go │ │ │ ├── proc_maps.go │ │ │ ├── proc_ns.go │ │ │ ├── proc_psi.go │ │ │ ├── proc_smaps.go │ │ │ ├── proc_stat.go │ │ │ ├── proc_status.go │ │ │ ├── schedstat.go │ │ │ ├── slab.go │ │ │ ├── stat.go │ │ │ ├── swaps.go │ │ │ ├── ttar │ │ │ ├── vm.go │ │ │ ├── xfrm.go │ │ │ └── zoneinfo.go │ └── stretchr │ │ └── testify │ │ ├── LICENSE │ │ └── assert │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertion_order.go │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go ├── golang.org │ └── x │ │ └── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── internal │ │ └── unsafeheader │ │ │ └── unsafeheader.go │ │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── epoll_zos.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── errors_freebsd_arm64.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── fstatfs_zos.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.1_12.go │ │ ├── syscall_darwin.1_13.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.1_13.go │ │ ├── zsyscall_darwin_amd64.1_13.s │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.1_13.go │ │ ├── zsyscall_darwin_arm64.1_13.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_illumos_amd64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── empty.s │ │ ├── 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 │ │ ├── setupapierrors_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 ├── google.golang.org │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── encoding │ │ ├── prototext │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ │ └── protowire │ │ │ └── wire.go │ │ ├── internal │ │ ├── descfmt │ │ │ └── stringer.go │ │ ├── descopts │ │ │ └── options.go │ │ ├── detrand │ │ │ └── rand.go │ │ ├── encoding │ │ │ ├── defval │ │ │ │ └── default.go │ │ │ ├── messageset │ │ │ │ └── messageset.go │ │ │ ├── tag │ │ │ │ └── tag.go │ │ │ └── text │ │ │ │ ├── decode.go │ │ │ │ ├── decode_number.go │ │ │ │ ├── decode_string.go │ │ │ │ ├── decode_token.go │ │ │ │ ├── doc.go │ │ │ │ └── encode.go │ │ ├── errors │ │ │ ├── errors.go │ │ │ ├── is_go112.go │ │ │ └── is_go113.go │ │ ├── filedesc │ │ │ ├── build.go │ │ │ ├── desc.go │ │ │ ├── desc_init.go │ │ │ ├── desc_lazy.go │ │ │ ├── desc_list.go │ │ │ ├── desc_list_gen.go │ │ │ └── placeholder.go │ │ ├── filetype │ │ │ └── build.go │ │ ├── flags │ │ │ ├── flags.go │ │ │ ├── proto_legacy_disable.go │ │ │ └── proto_legacy_enable.go │ │ ├── genid │ │ │ ├── any_gen.go │ │ │ ├── api_gen.go │ │ │ ├── descriptor_gen.go │ │ │ ├── doc.go │ │ │ ├── duration_gen.go │ │ │ ├── empty_gen.go │ │ │ ├── field_mask_gen.go │ │ │ ├── goname.go │ │ │ ├── map_entry.go │ │ │ ├── source_context_gen.go │ │ │ ├── struct_gen.go │ │ │ ├── timestamp_gen.go │ │ │ ├── type_gen.go │ │ │ ├── wrappers.go │ │ │ └── wrappers_gen.go │ │ ├── impl │ │ │ ├── api_export.go │ │ │ ├── checkinit.go │ │ │ ├── codec_extension.go │ │ │ ├── codec_field.go │ │ │ ├── codec_gen.go │ │ │ ├── codec_map.go │ │ │ ├── codec_map_go111.go │ │ │ ├── codec_map_go112.go │ │ │ ├── codec_message.go │ │ │ ├── codec_messageset.go │ │ │ ├── codec_reflect.go │ │ │ ├── codec_tables.go │ │ │ ├── codec_unsafe.go │ │ │ ├── convert.go │ │ │ ├── convert_list.go │ │ │ ├── convert_map.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── enum.go │ │ │ ├── extension.go │ │ │ ├── legacy_enum.go │ │ │ ├── legacy_export.go │ │ │ ├── legacy_extension.go │ │ │ ├── legacy_file.go │ │ │ ├── legacy_message.go │ │ │ ├── merge.go │ │ │ ├── merge_gen.go │ │ │ ├── message.go │ │ │ ├── message_reflect.go │ │ │ ├── message_reflect_field.go │ │ │ ├── message_reflect_gen.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── validate.go │ │ │ └── weak.go │ │ ├── order │ │ │ ├── order.go │ │ │ └── range.go │ │ ├── pragma │ │ │ └── pragma.go │ │ ├── set │ │ │ └── ints.go │ │ ├── strs │ │ │ ├── strings.go │ │ │ ├── strings_pure.go │ │ │ └── strings_unsafe.go │ │ └── version │ │ │ └── version.go │ │ ├── proto │ │ ├── checkinit.go │ │ ├── decode.go │ │ ├── decode_gen.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_gen.go │ │ ├── equal.go │ │ ├── extension.go │ │ ├── merge.go │ │ ├── messageset.go │ │ ├── proto.go │ │ ├── proto_methods.go │ │ ├── proto_reflect.go │ │ ├── reset.go │ │ ├── size.go │ │ ├── size_gen.go │ │ └── wrappers.go │ │ ├── reflect │ │ ├── protoreflect │ │ │ ├── methods.go │ │ │ ├── proto.go │ │ │ ├── source.go │ │ │ ├── source_gen.go │ │ │ ├── type.go │ │ │ ├── value.go │ │ │ ├── value_pure.go │ │ │ ├── value_union.go │ │ │ └── value_unsafe.go │ │ └── protoregistry │ │ │ └── registry.go │ │ ├── runtime │ │ ├── protoiface │ │ │ ├── legacy.go │ │ │ └── methods.go │ │ └── protoimpl │ │ │ ├── impl.go │ │ │ └── version.go │ │ └── types │ │ └── known │ │ ├── anypb │ │ └── any.pb.go │ │ ├── durationpb │ │ └── duration.pb.go │ │ └── timestamppb │ │ └── timestamp.pb.go ├── gopkg.in │ └── yaml.v2 │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── 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 └── webserver ├── webserver.go └── webserver_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Custom 2 | build/ 3 | .idea/ 4 | kube-applier 5 | 6 | # Below created by https://www.gitignore.io/api/vim,go 7 | 8 | ### Vim ### 9 | # swap 10 | [._]*.s[a-w][a-z] 11 | [._]s[a-w][a-z] 12 | # session 13 | Session.vim 14 | # temporary 15 | .netrwhist 16 | *~ 17 | # auto-generated tag files 18 | tags 19 | 20 | 21 | ### Go ### 22 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 23 | *.o 24 | *.a 25 | *.so 26 | 27 | # Folders 28 | _obj 29 | _test 30 | 31 | # Architecture specific extensions/prefixes 32 | *.[568vq] 33 | [568vq].out 34 | 35 | *.cgo1.go 36 | *.cgo2.c 37 | _cgo_defun.c 38 | _cgo_gotypes.go 39 | _cgo_export.* 40 | 41 | _testmain.go 42 | 43 | *.exe 44 | *.test 45 | *.prof 46 | 47 | # Output of the go coverage tool, specifically when used with LiteIDE 48 | *.out 49 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.21 4 | before_install: 5 | - go clean -cache 6 | - go clean -modcache 7 | 8 | install: true 9 | script: 10 | - make test-unit 11 | - .travis/check_workspace.sh 12 | -------------------------------------------------------------------------------- /.travis/check_workspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ "$(git status --porcelain | wc -l)" -ne "0" ]; then 5 | echo "Dirty workspace detected. This typically indicates 'go fmt' changed some files?" \ 6 | "\n Run 'make' locally to verify." 7 | exit 1 8 | else 9 | exit 0 10 | fi 11 | 12 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.7 as builder 2 | WORKDIR $GOPATH/src/github.com/box/kube-applier 3 | COPY . $GOPATH/src/github.com/box/kube-applier 4 | RUN make build 5 | 6 | FROM ubuntu 7 | LABEL maintainer="Greg Lyons" 8 | WORKDIR /root/ 9 | ADD templates/* /templates/ 10 | ADD static/ /static/ 11 | RUN apt-get update && \ 12 | apt-get install -y git 13 | ADD https://storage.googleapis.com/kubernetes-release/release/v1.9.4/bin/linux/amd64/kubectl /usr/local/bin/kubectl 14 | RUN chmod +x /usr/local/bin/kubectl 15 | COPY --from=builder /go/src/github.com/box/kube-applier/kube-applier /kube-applier 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: build 2 | 3 | ENVVAR = GOOS=linux GOARCH=amd64 CGO_ENABLED=0 4 | TAG = v0.2.0 5 | 6 | deps: 7 | go mod tidy 8 | 9 | build: clean deps fmt 10 | go build -o kube-applier 11 | 12 | container: 13 | docker build -t kube-applier:$(TAG) . 14 | 15 | clean: 16 | rm -f kube-applier 17 | 18 | fmt: 19 | find . -path ./vendor -prune -o -name '*.go' -print | xargs -L 1 -I % gofmt -s -w % 20 | 21 | test-unit: clean deps fmt build 22 | go test -v --race ./... 23 | 24 | .PHONY: all deps build container clean fmt test-unit 25 | -------------------------------------------------------------------------------- /applylist/mock_factory.go: -------------------------------------------------------------------------------- 1 | // Code generated by MockGen. DO NOT EDIT. 2 | // Source: github.com/box/kube-applier/applylist (interfaces: FactoryInterface) 3 | 4 | package applylist 5 | 6 | import ( 7 | gomock "github.com/golang/mock/gomock" 8 | ) 9 | 10 | // MockFactoryInterface is a mock of FactoryInterface interface 11 | type MockFactoryInterface struct { 12 | ctrl *gomock.Controller 13 | recorder *MockFactoryInterfaceMockRecorder 14 | } 15 | 16 | // MockFactoryInterfaceMockRecorder is the mock recorder for MockFactoryInterface 17 | type MockFactoryInterfaceMockRecorder struct { 18 | mock *MockFactoryInterface 19 | } 20 | 21 | // NewMockFactoryInterface creates a new mock instance 22 | func NewMockFactoryInterface(ctrl *gomock.Controller) *MockFactoryInterface { 23 | mock := &MockFactoryInterface{ctrl: ctrl} 24 | mock.recorder = &MockFactoryInterfaceMockRecorder{mock} 25 | return mock 26 | } 27 | 28 | // EXPECT returns an object that allows the caller to indicate expected use 29 | func (_m *MockFactoryInterface) EXPECT() *MockFactoryInterfaceMockRecorder { 30 | return _m.recorder 31 | } 32 | 33 | // Create mocks base method 34 | func (_m *MockFactoryInterface) Create(_param0 []string) ([]string, []string, []string, error) { 35 | ret := _m.ctrl.Call(_m, "Create", _param0) 36 | ret0, _ := ret[0].([]string) 37 | ret1, _ := ret[1].([]string) 38 | ret2, _ := ret[2].([]string) 39 | ret3, _ := ret[3].(error) 40 | return ret0, ret1, ret2, ret3 41 | } 42 | 43 | // Create indicates an expected call of Create 44 | func (_mr *MockFactoryInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call { 45 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Create", arg0) 46 | } 47 | -------------------------------------------------------------------------------- /applylist/util.go: -------------------------------------------------------------------------------- 1 | package applylist 2 | 3 | import "path" 4 | 5 | // PrependToEachPath prepends the specified prefix path to the base path, using path.Join to handle slashes. 6 | func PrependToEachPath(prefix string, paths []string) []string { 7 | result := []string{} 8 | for _, basePath := range paths { 9 | result = append(result, path.Join(prefix, basePath)) 10 | } 11 | return result 12 | } 13 | 14 | // stringSliceToMap creates a map with the slice's strings as keys and empty structs as values. 15 | // The map is intended to be used for easy lookup across the set of strings. 16 | func stringSliceToMap(strings []string) map[string]struct{} { 17 | m := make(map[string]struct{}) 18 | for _, s := range strings { 19 | m[s] = struct{}{} 20 | } 21 | return m 22 | } 23 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | # Demo 2 | 3 | An example Deployment and Service spec for kube-applier, with git-sync as a sidecar container. -------------------------------------------------------------------------------- /demo/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: "extensions/v1beta1" 3 | kind: "Deployment" 4 | metadata: 5 | name: "kube-applier" 6 | namespace: "kube-system" 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | labels: 12 | app: "kube-applier" 13 | spec: 14 | containers: 15 | - name: "kube-applier" 16 | command: 17 | - "/kube-applier" 18 | env: 19 | - name: "REPO_PATH" 20 | value: "/k8s/resources" 21 | - name: "LISTEN_PORT" 22 | value: "2020" 23 | image: "kube-applier:v0.2.0" 24 | ports: 25 | - containerPort: 2020 26 | volumeMounts: 27 | - name: "git-repo" 28 | mountPath: "/k8s" 29 | - name: "git-sync" 30 | command: 31 | - "/git-sync" 32 | env: 33 | - name: "GIT_SYNC_REPO" 34 | value: "https://github.com/kubernetes/kubernetes.git" 35 | - name: "GIT_SYNC_DEST" 36 | value: "resources" 37 | image: "gcr.io/google_containers/git-sync:v2.0.6" 38 | ports: 39 | - containerPort: 2020 40 | volumeMounts: 41 | - name: "git-repo" 42 | mountPath: "/git" 43 | volumes: 44 | - name: "git-repo" 45 | emptyDir: {} 46 | -------------------------------------------------------------------------------- /demo/service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: "v1" 3 | kind: "Service" 4 | metadata: 5 | name: "kube-applier" 6 | namespace: "kube-system" 7 | spec: 8 | ports: 9 | - name: "service" 10 | port: 80 11 | targetPort: 2020 12 | selector: 13 | app: "kube-applier" 14 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/box/kube-applier 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/golang/mock v0.0.0-20160127222235-bd3c8e81be01 7 | github.com/prometheus/client_golang v1.11.1 8 | github.com/stretchr/testify v1.4.0 9 | ) 10 | 11 | require ( 12 | github.com/beorn7/perks v1.0.1 // indirect 13 | github.com/cespare/xxhash/v2 v2.1.1 // indirect 14 | github.com/davecgh/go-spew v1.1.1 // indirect 15 | github.com/golang/protobuf v1.4.3 // indirect 16 | github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect 17 | github.com/pmezard/go-difflib v1.0.0 // indirect 18 | github.com/prometheus/client_model v0.2.0 // indirect 19 | github.com/prometheus/common v0.26.0 // indirect 20 | github.com/prometheus/procfs v0.6.0 // indirect 21 | golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect 22 | google.golang.org/protobuf v1.26.0-rc.1 // indirect 23 | gopkg.in/yaml.v2 v2.3.0 // indirect 24 | ) 25 | -------------------------------------------------------------------------------- /kube/mock_client.go: -------------------------------------------------------------------------------- 1 | // Automatically generated by MockGen. DO NOT EDIT! 2 | // Source: github.com/box/kube-applier/kube 3 | 4 | package kube 5 | 6 | import ( 7 | gomock "github.com/golang/mock/gomock" 8 | ) 9 | 10 | // Mock of ClientInterface interface 11 | type MockClientInterface struct { 12 | ctrl *gomock.Controller 13 | recorder *_MockClientInterfaceRecorder 14 | } 15 | 16 | // Recorder for MockClientInterface (not exported) 17 | type _MockClientInterfaceRecorder struct { 18 | mock *MockClientInterface 19 | } 20 | 21 | func NewMockClientInterface(ctrl *gomock.Controller) *MockClientInterface { 22 | mock := &MockClientInterface{ctrl: ctrl} 23 | mock.recorder = &_MockClientInterfaceRecorder{mock} 24 | return mock 25 | } 26 | 27 | func (_m *MockClientInterface) EXPECT() *_MockClientInterfaceRecorder { 28 | return _m.recorder 29 | } 30 | 31 | func (_m *MockClientInterface) Apply(_param0 string) (string, string, error) { 32 | ret := _m.ctrl.Call(_m, "Apply", _param0) 33 | ret0, _ := ret[0].(string) 34 | ret1, _ := ret[1].(string) 35 | ret2, _ := ret[2].(error) 36 | return ret0, ret1, ret2 37 | } 38 | 39 | func (_mr *_MockClientInterfaceRecorder) Apply(arg0 interface{}) *gomock.Call { 40 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Apply", arg0) 41 | } 42 | 43 | func (_m *MockClientInterface) CheckVersion() error { 44 | ret := _m.ctrl.Call(_m, "CheckVersion") 45 | ret0, _ := ret[0].(error) 46 | return ret0 47 | } 48 | 49 | func (_mr *_MockClientInterfaceRecorder) CheckVersion() *gomock.Call { 50 | return _mr.mock.ctrl.RecordCall(_mr.mock, "CheckVersion") 51 | } 52 | -------------------------------------------------------------------------------- /run/mock_batch_applier.go: -------------------------------------------------------------------------------- 1 | // Code generated by MockGen. DO NOT EDIT. 2 | // Source: github.com/box/kube-applier/run (interfaces: BatchApplierInterface) 3 | 4 | package run 5 | 6 | import ( 7 | gomock "github.com/golang/mock/gomock" 8 | ) 9 | 10 | // MockBatchApplierInterface is a mock of BatchApplierInterface interface 11 | type MockBatchApplierInterface struct { 12 | ctrl *gomock.Controller 13 | recorder *MockBatchApplierInterfaceMockRecorder 14 | } 15 | 16 | // MockBatchApplierInterfaceMockRecorder is the mock recorder for MockBatchApplierInterface 17 | type MockBatchApplierInterfaceMockRecorder struct { 18 | mock *MockBatchApplierInterface 19 | } 20 | 21 | // NewMockBatchApplierInterface creates a new mock instance 22 | func NewMockBatchApplierInterface(ctrl *gomock.Controller) *MockBatchApplierInterface { 23 | mock := &MockBatchApplierInterface{ctrl: ctrl} 24 | mock.recorder = &MockBatchApplierInterfaceMockRecorder{mock} 25 | return mock 26 | } 27 | 28 | // EXPECT returns an object that allows the caller to indicate expected use 29 | func (_m *MockBatchApplierInterface) EXPECT() *MockBatchApplierInterfaceMockRecorder { 30 | return _m.recorder 31 | } 32 | 33 | // Apply mocks base method 34 | func (_m *MockBatchApplierInterface) Apply(_param0 int, _param1 []string) ([]ApplyAttempt, []ApplyAttempt) { 35 | ret := _m.ctrl.Call(_m, "Apply", _param0, _param1) 36 | ret0, _ := ret[0].([]ApplyAttempt) 37 | ret1, _ := ret[1].([]ApplyAttempt) 38 | return ret0, ret1 39 | } 40 | 41 | // Apply indicates an expected call of Apply 42 | func (_mr *MockBatchApplierInterfaceMockRecorder) Apply(arg0, arg1 interface{}) *gomock.Call { 43 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Apply", arg0, arg1) 44 | } 45 | -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /static/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/status_page_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/box/kube-applier/4882cf99da3b2f4af71b2a4f7e5eda9ec57068aa/static/img/status_page_screenshot.png -------------------------------------------------------------------------------- /static/js/main.js: -------------------------------------------------------------------------------- 1 | // On button click, sends empty POST request to API endpoint for forcing a run and shows a relevant alert when a response is received. 2 | $(document).ready(function() { 3 | $('#force-button').bind('click', function(){ 4 | // Disable the button and close existing alert 5 | $('#force-button').prop('disabled', true); 6 | $('#force-alert').alert('close') 7 | 8 | url = window.location.href + 'api/v1/forceRun'; 9 | $.ajax({ 10 | type: 'POST', 11 | url: url, 12 | data: {}, 13 | dataType: "json", 14 | success:function(data) { 15 | showForceAlert(true, data.message) 16 | $('#force-button').prop('disabled', false); 17 | }, 18 | error:function() { 19 | showForceAlert(false, 'Server error attempting to force a run. See container logs for more info.') 20 | $('#force-button').prop('disabled', false); 21 | } 22 | }); 23 | }); 24 | }); 25 | 26 | // Show a relevant alert message, styled based on the "success" of the associated response. 27 | function showForceAlert(success, message) { 28 | alertClass = success ? 'success' : 'warning'; 29 | $('#force-alert-container').empty(); 30 | $('#force-alert-container').append( 31 | ''); 36 | } 37 | -------------------------------------------------------------------------------- /static/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | pre.file-output { 2 | font-family: Monaco; 3 | font-size: 10px; 4 | } 5 | 6 | pre.commit { 7 | font-size: 12px; 8 | } 9 | 10 | #successes>.panel:nth-of-type(odd), #failures>.panel:nth-of-type(odd) { 11 | background-color: #f9f9f9; 12 | } 13 | 14 | #force-button { 15 | margin-bottom: 5px; 16 | } 17 | -------------------------------------------------------------------------------- /sysutil/clock.go: -------------------------------------------------------------------------------- 1 | package sysutil 2 | 3 | import "time" 4 | 5 | // ClockInterface allows for mocking out the functionality of the standard time library when testing. 6 | type ClockInterface interface { 7 | Now() time.Time 8 | Sleep(time.Duration) 9 | } 10 | 11 | // Clock implements ClockInterface with the standard time library functions. 12 | type Clock struct{} 13 | 14 | func (c *Clock) Now() time.Time { 15 | return time.Now() 16 | } 17 | 18 | func (c *Clock) Sleep(d time.Duration) { 19 | time.Sleep(d) 20 | } 21 | -------------------------------------------------------------------------------- /sysutil/envar.go: -------------------------------------------------------------------------------- 1 | package sysutil 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "strconv" 7 | ) 8 | 9 | func GetRequiredEnvString(key string) string { 10 | val := os.Getenv(key) 11 | if len(val) == 0 { 12 | log.Fatalf("Error: Missing environment variable %v", key) 13 | } 14 | return val 15 | } 16 | 17 | func GetRequiredEnvInt(key string) int { 18 | stringVal := GetRequiredEnvString(key) 19 | intVal, err := strconv.Atoi(stringVal) 20 | if err != nil { 21 | log.Fatalf("Error converting environment variable %s to int: %v", stringVal, err) 22 | } 23 | return intVal 24 | } 25 | 26 | func GetEnvIntOrDefault(key string, def int) int { 27 | if env := os.Getenv(key); env != "" { 28 | val, err := strconv.Atoi(env) 29 | if err != nil { 30 | log.Printf("Invalid value for %v: using default: %v", key, def) 31 | return def 32 | } 33 | return val 34 | } 35 | return def 36 | } 37 | 38 | func GetEnvStringOrDefault(key, def string) string { 39 | if env := os.Getenv(key); env != "" { 40 | return env 41 | } 42 | return def 43 | } 44 | -------------------------------------------------------------------------------- /sysutil/misc.go: -------------------------------------------------------------------------------- 1 | package sysutil 2 | 3 | import ( 4 | "fmt" 5 | "html/template" 6 | "os" 7 | ) 8 | 9 | // CreateTemplate takes in a path to a template file and parses the file to create a Template instance. 10 | func CreateTemplate(templatePath string) (*template.Template, error) { 11 | if _, err := os.Stat(templatePath); err != nil { 12 | return nil, fmt.Errorf("Error opening template file: %v", err) 13 | } 14 | tmpl, err := template.ParseFiles(templatePath) 15 | if err != nil { 16 | return nil, fmt.Errorf("Error parsing template: %v", err) 17 | } 18 | return tmpl, nil 19 | } 20 | -------------------------------------------------------------------------------- /sysutil/mock_clock.go: -------------------------------------------------------------------------------- 1 | // Automatically generated by MockGen. DO NOT EDIT! 2 | // Source: github.com/box/kube-applier/util 3 | 4 | package sysutil 5 | 6 | import ( 7 | gomock "github.com/golang/mock/gomock" 8 | time "time" 9 | ) 10 | 11 | // Mock of ClockInterface interface 12 | type MockClockInterface struct { 13 | ctrl *gomock.Controller 14 | recorder *_MockClockInterfaceRecorder 15 | } 16 | 17 | // Recorder for MockClockInterface (not exported) 18 | type _MockClockInterfaceRecorder struct { 19 | mock *MockClockInterface 20 | } 21 | 22 | func NewMockClockInterface(ctrl *gomock.Controller) *MockClockInterface { 23 | mock := &MockClockInterface{ctrl: ctrl} 24 | mock.recorder = &_MockClockInterfaceRecorder{mock} 25 | return mock 26 | } 27 | 28 | func (_m *MockClockInterface) EXPECT() *_MockClockInterfaceRecorder { 29 | return _m.recorder 30 | } 31 | 32 | func (_m *MockClockInterface) Now() time.Time { 33 | ret := _m.ctrl.Call(_m, "Now") 34 | ret0, _ := ret[0].(time.Time) 35 | return ret0 36 | } 37 | 38 | func (_mr *_MockClockInterfaceRecorder) Now() *gomock.Call { 39 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Now") 40 | } 41 | 42 | func (_m *MockClockInterface) Since(_param0 time.Time) time.Duration { 43 | ret := _m.ctrl.Call(_m, "Since", _param0) 44 | ret0, _ := ret[0].(time.Duration) 45 | return ret0 46 | } 47 | 48 | func (_mr *_MockClockInterfaceRecorder) Since(arg0 interface{}) *gomock.Call { 49 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Since", arg0) 50 | } 51 | 52 | func (_m *MockClockInterface) Sleep(_param0 time.Duration) { 53 | _m.ctrl.Call(_m, "Sleep", _param0) 54 | } 55 | 56 | func (_mr *_MockClockInterfaceRecorder) Sleep(arg0 interface{}) *gomock.Call { 57 | return _mr.mock.ctrl.RecordCall(_mr.mock, "Sleep", arg0) 58 | } 59 | -------------------------------------------------------------------------------- /sysutil/mock_filesystem.go: -------------------------------------------------------------------------------- 1 | // Automatically generated by MockGen. DO NOT EDIT! 2 | // Source: github.com/box/kube-applier/sysutil 3 | 4 | package sysutil 5 | 6 | import ( 7 | gomock "github.com/golang/mock/gomock" 8 | ) 9 | 10 | // Mock of FileSystemInterface interface 11 | type MockFileSystemInterface struct { 12 | ctrl *gomock.Controller 13 | recorder *_MockFileSystemInterfaceRecorder 14 | } 15 | 16 | // Recorder for MockFileSystemInterface (not exported) 17 | type _MockFileSystemInterfaceRecorder struct { 18 | mock *MockFileSystemInterface 19 | } 20 | 21 | func NewMockFileSystemInterface(ctrl *gomock.Controller) *MockFileSystemInterface { 22 | mock := &MockFileSystemInterface{ctrl: ctrl} 23 | mock.recorder = &_MockFileSystemInterfaceRecorder{mock} 24 | return mock 25 | } 26 | 27 | func (_m *MockFileSystemInterface) EXPECT() *_MockFileSystemInterfaceRecorder { 28 | return _m.recorder 29 | } 30 | 31 | func (_m *MockFileSystemInterface) ListAllFiles(_param0 string) ([]string, error) { 32 | ret := _m.ctrl.Call(_m, "ListAllFiles", _param0) 33 | ret0, _ := ret[0].([]string) 34 | ret1, _ := ret[1].(error) 35 | return ret0, ret1 36 | } 37 | 38 | func (_mr *_MockFileSystemInterfaceRecorder) ListAllFiles(arg0 interface{}) *gomock.Call { 39 | return _mr.mock.ctrl.RecordCall(_mr.mock, "ListAllFiles", arg0) 40 | } 41 | 42 | func (_m *MockFileSystemInterface) ReadLines(_param0 string) ([]string, error) { 43 | ret := _m.ctrl.Call(_m, "ReadLines", _param0) 44 | ret0, _ := ret[0].([]string) 45 | ret1, _ := ret[1].(error) 46 | return ret0, ret1 47 | } 48 | 49 | func (_mr *_MockFileSystemInterfaceRecorder) ReadLines(arg0 interface{}) *gomock.Call { 50 | return _mr.mock.ctrl.RecordCall(_mr.mock, "ReadLines", arg0) 51 | } 52 | -------------------------------------------------------------------------------- /templates/kubeconfig: -------------------------------------------------------------------------------- 1 | current-context: kube 2 | apiVersion: v1 3 | clusters: 4 | - cluster: 5 | server: {{.Server}} 6 | certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt 7 | name: kube 8 | contexts: 9 | - context: 10 | cluster: kube 11 | user: service-account 12 | name: kube 13 | kind: Config 14 | users: 15 | - name: service-account 16 | user: 17 | token: {{.Token}} 18 | -------------------------------------------------------------------------------- /vendor/github.com/beorn7/perks/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Blake Mizerany 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/cespare/xxhash/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - "1.x" 4 | - master 5 | env: 6 | - TAGS="" 7 | - TAGS="-tags purego" 8 | script: go test $TAGS -v ./... 9 | -------------------------------------------------------------------------------- /vendor/github.com/cespare/xxhash/v2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Caleb Spare 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | // +build gc 3 | // +build !purego 4 | 5 | package xxhash 6 | 7 | // Sum64 computes the 64-bit xxHash digest of b. 8 | // 9 | //go:noescape 10 | func Sum64(b []byte) uint64 11 | 12 | //go:noescape 13 | func writeBlocks(d *Digest, b []byte) int 14 | -------------------------------------------------------------------------------- /vendor/github.com/cespare/xxhash/v2/xxhash_safe.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // This file contains the safe implementations of otherwise unsafe-using code. 4 | 5 | package xxhash 6 | 7 | // Sum64String computes the 64-bit xxHash digest of s. 8 | func Sum64String(s string) uint64 { 9 | return Sum64([]byte(s)) 10 | } 11 | 12 | // WriteString adds more data to d. It always returns len(s), nil. 13 | func (d *Digest) WriteString(s string) (n int, err error) { 14 | return d.Write([]byte(s)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | // This file encapsulates usage of unsafe. 4 | // xxhash_safe.go contains the safe implementations. 5 | 6 | package xxhash 7 | 8 | import ( 9 | "reflect" 10 | "unsafe" 11 | ) 12 | 13 | // Notes: 14 | // 15 | // See https://groups.google.com/d/msg/golang-nuts/dcjzJy-bSpw/tcZYBzQqAQAJ 16 | // for some discussion about these unsafe conversions. 17 | // 18 | // In the future it's possible that compiler optimizations will make these 19 | // unsafe operations unnecessary: https://golang.org/issue/2205. 20 | // 21 | // Both of these wrapper functions still incur function call overhead since they 22 | // will not be inlined. We could write Go/asm copies of Sum64 and Digest.Write 23 | // for strings to squeeze out a bit more speed. Mid-stack inlining should 24 | // eventually fix this. 25 | 26 | // Sum64String computes the 64-bit xxHash digest of s. 27 | // It may be faster than Sum64([]byte(s)) by avoiding a copy. 28 | func Sum64String(s string) uint64 { 29 | var b []byte 30 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 31 | bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data 32 | bh.Len = len(s) 33 | bh.Cap = len(s) 34 | return Sum64(b) 35 | } 36 | 37 | // WriteString adds more data to d. It always returns len(s), nil. 38 | // It may be faster than Write([]byte(s)) by avoiding a copy. 39 | func (d *Digest) WriteString(s string) (n int, err error) { 40 | var b []byte 41 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 42 | bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data 43 | bh.Len = len(s) 44 | bh.Cap = len(s) 45 | return d.Write(b) 46 | } 47 | -------------------------------------------------------------------------------- /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/golang/mock/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoMock authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Alex Reece 12 | Google Inc. 13 | -------------------------------------------------------------------------------- /vendor/github.com/golang/mock/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute (and typically 2 | # have contributed) code to the gomock repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # http://code.google.com/legal/individual-cla-v1.0.html 15 | # http://code.google.com/legal/corporate-cla-v1.0.html 16 | # 17 | # The agreement for individuals can be filled out on the web. 18 | # 19 | # When adding J Random Contributor's name to this file, 20 | # either J's name or J's organization's name should be 21 | # added to the AUTHORS file, depending on whether the 22 | # individual or corporate CLA was used. 23 | 24 | # Names should be added to this file like so: 25 | # Name 26 | # 27 | # An entry with two email addresses specifies that the 28 | # first address should be used in the submit logs and 29 | # that the second address should be recognized as the 30 | # same person when interacting with Rietveld. 31 | 32 | # Please keep the list sorted. 33 | 34 | Aaron Jacobs 35 | Alex Reece 36 | David Symonds 37 | Ryan Barrett 38 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/wrappers.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 proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int stores v in a new int32 value and returns a pointer to it. 11 | // 12 | // Deprecated: Use Int32 instead. 13 | func Int(v int) *int32 { return Int32(int32(v)) } 14 | 15 | // Int32 stores v in a new int32 value and returns a pointer to it. 16 | func Int32(v int32) *int32 { return &v } 17 | 18 | // Int64 stores v in a new int64 value and returns a pointer to it. 19 | func Int64(v int64) *int64 { return &v } 20 | 21 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 22 | func Uint32(v uint32) *uint32 { return &v } 23 | 24 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 25 | func Uint64(v uint64) *uint64 { return &v } 26 | 27 | // Float32 stores v in a new float32 value and returns a pointer to it. 28 | func Float32(v float32) *float32 { return &v } 29 | 30 | // Float64 stores v in a new float64 value and returns a pointer to it. 31 | func Float64(v float64) *float64 { return &v } 32 | 33 | // String stores v in a new string value and returns a pointer to it. 34 | func String(v string) *string { return &v } 35 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/ptypes/doc.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 | // Package ptypes provides functionality for interacting with well-known types. 6 | package ptypes 7 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore: -------------------------------------------------------------------------------- 1 | cover.dat 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | cover: 4 | go test -cover -v -coverprofile=cover.dat ./... 5 | go tool cover -func cover.dat 6 | 7 | .PHONY: cover 8 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/encode.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package pbutil 16 | 17 | import ( 18 | "encoding/binary" 19 | "io" 20 | 21 | "github.com/golang/protobuf/proto" 22 | ) 23 | 24 | // WriteDelimited encodes and dumps a message to the provided writer prefixed 25 | // with a 32-bit varint indicating the length of the encoded message, producing 26 | // a length-delimited record stream, which can be used to chain together 27 | // encoded messages of the same type together in a file. It returns the total 28 | // number of bytes written and any applicable error. This is roughly 29 | // equivalent to the companion Java API's MessageLite#writeDelimitedTo. 30 | func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) { 31 | buffer, err := proto.Marshal(m) 32 | if err != nil { 33 | return 0, err 34 | } 35 | 36 | var buf [binary.MaxVarintLen32]byte 37 | encodedLength := binary.PutUvarint(buf[:], uint64(len(buffer))) 38 | 39 | sync, err := w.Write(buf[:encodedLength]) 40 | if err != nil { 41 | return sync, err 42 | } 43 | 44 | n, err = w.Write(buffer) 45 | return n + sync, err 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Go applications 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | 7 | 8 | The following components are included in this product: 9 | 10 | perks - a fork of https://github.com/bmizerany/perks 11 | https://github.com/beorn7/perks 12 | Copyright 2013-2015 Blake Mizerany, Björn Rabenstein 13 | See https://github.com/beorn7/perks/blob/master/README.md for license details. 14 | 15 | Go support for Protocol Buffers - Google's data interchange format 16 | http://github.com/golang/protobuf/ 17 | Copyright 2010 The Go Authors 18 | See source code for license details. 19 | 20 | Support for streaming Protocol Buffer messages for the Go language (golang). 21 | https://github.com/matttproud/golang_protobuf_extensions 22 | Copyright 2013 Matt T. Proud 23 | Licensed under the Apache License, Version 2.0 24 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/.gitignore: -------------------------------------------------------------------------------- 1 | command-line-arguments.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/README.md: -------------------------------------------------------------------------------- 1 | See [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus). 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package prometheus 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializies a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/promhttp/option.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package promhttp 15 | 16 | // Option are used to configure a middleware or round tripper.. 17 | type Option func(*option) 18 | 19 | type option struct { 20 | extraMethods []string 21 | } 22 | 23 | // WithExtraMethods adds additional HTTP methods to the list of allowed methods. 24 | // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list. 25 | // 26 | // See the example for ExampleInstrumentHandlerWithExtraMethods for example usage. 27 | func WithExtraMethods(methods ...string) Option { 28 | return func(o *option) { 29 | o.extraMethods = methods 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/expfmt/fuzz.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Build only when actually fuzzing 15 | // +build gofuzz 16 | 17 | package expfmt 18 | 19 | import "bytes" 20 | 21 | // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: 22 | // 23 | // go-fuzz-build github.com/prometheus/common/expfmt 24 | // go-fuzz -bin expfmt-fuzz.zip -workdir fuzz 25 | // 26 | // Further input samples should go in the folder fuzz/corpus. 27 | func Fuzz(in []byte) int { 28 | parser := TextParser{} 29 | _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) 30 | 31 | if err != nil { 32 | return 0 33 | } 34 | 35 | return 1 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package model 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializes a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/.gitignore: -------------------------------------------------------------------------------- 1 | /fixtures/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/.golangci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | linters: 3 | enable: 4 | - golint 5 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Prometheus Community Code of Conduct 2 | 3 | Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | * Johannes 'fish' Ziemke @discordianfish 2 | * Paul Gier @pgier 3 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Prometheus Authors 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | include Makefile.common 15 | 16 | %/.unpacked: %.ttar 17 | @echo ">> extracting fixtures" 18 | ./ttar -C $(dir $*) -x -f $*.ttar 19 | touch $@ 20 | 21 | update_fixtures: 22 | rm -vf fixtures/.unpacked 23 | ./ttar -c -f fixtures.ttar fixtures/ 24 | 25 | .PHONY: build 26 | build: 27 | 28 | .PHONY: test 29 | test: fixtures/.unpacked common-test 30 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a security issue 2 | 3 | The Prometheus security policy, including how to report vulnerabilities, can be 4 | found here: 5 | 6 | https://prometheus.io/docs/operating/security/ 7 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_armx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build arm arm64 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoARM 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build mips mipsle mips64 mips64le 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoMips 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_others.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build !386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoDummy 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build ppc64 ppc64le 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoPPC 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build riscv riscv64 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoRISCV 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | 16 | package procfs 17 | 18 | var parseCPUInfo = parseCPUInfoS390X 19 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/cpuinfo_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux 15 | // +build 386 amd64 16 | 17 | package procfs 18 | 19 | var parseCPUInfo = parseCPUInfoX86 20 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Prometheus Team 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package procfs provides functions to retrieve system, kernel and process 15 | // metrics from the pseudo-filesystem proc. 16 | // 17 | // Example: 18 | // 19 | // package main 20 | // 21 | // import ( 22 | // "fmt" 23 | // "log" 24 | // 25 | // "github.com/prometheus/procfs" 26 | // ) 27 | // 28 | // func main() { 29 | // p, err := procfs.Self() 30 | // if err != nil { 31 | // log.Fatalf("could not get process: %s", err) 32 | // } 33 | // 34 | // stat, err := p.NewStat() 35 | // if err != nil { 36 | // log.Fatalf("could not get process stat: %s", err) 37 | // } 38 | // 39 | // fmt.Printf("command: %s\n", stat.Comm) 40 | // fmt.Printf("cpu time: %fs\n", stat.CPUTime()) 41 | // fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) 42 | // fmt.Printf("rss: %dB\n", stat.ResidentMemory()) 43 | // } 44 | // 45 | package procfs 46 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/fs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package procfs 15 | 16 | import ( 17 | "github.com/prometheus/procfs/internal/fs" 18 | ) 19 | 20 | // FS represents the pseudo-filesystem sys, which provides an interface to 21 | // kernel data structures. 22 | type FS struct { 23 | proc fs.FS 24 | } 25 | 26 | // DefaultMountPoint is the common mount point of the proc filesystem. 27 | const DefaultMountPoint = fs.DefaultProcMountPoint 28 | 29 | // NewDefaultFS returns a new proc FS mounted under the default proc mountPoint. 30 | // It will error if the mount point directory can't be read or is a file. 31 | func NewDefaultFS() (FS, error) { 32 | return NewFS(DefaultMountPoint) 33 | } 34 | 35 | // NewFS returns a new proc FS mounted under the given proc mountPoint. It will error 36 | // if the mount point directory can't be read or is a file. 37 | func NewFS(mountPoint string) (FS, error) { 38 | fs, err := fs.NewFS(mountPoint) 39 | if err != nil { 40 | return FS{}, err 41 | } 42 | return FS{fs}, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/internal/util/readfile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package util 15 | 16 | import ( 17 | "io" 18 | "io/ioutil" 19 | "os" 20 | ) 21 | 22 | // ReadFileNoStat uses ioutil.ReadAll to read contents of entire file. 23 | // This is similar to ioutil.ReadFile but without the call to os.Stat, because 24 | // many files in /proc and /sys report incorrect file sizes (either 0 or 4096). 25 | // Reads a max file size of 512kB. For files larger than this, a scanner 26 | // should be used. 27 | func ReadFileNoStat(filename string) ([]byte, error) { 28 | const maxBufferSize = 1024 * 512 29 | 30 | f, err := os.Open(filename) 31 | if err != nil { 32 | return nil, err 33 | } 34 | defer f.Close() 35 | 36 | reader := io.LimitReader(f, maxBufferSize) 37 | return ioutil.ReadAll(reader) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux,!appengine 15 | 16 | package util 17 | 18 | import ( 19 | "bytes" 20 | "os" 21 | "syscall" 22 | ) 23 | 24 | // SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. 25 | // https://github.com/prometheus/node_exporter/pull/728/files 26 | // 27 | // Note that this function will not read files larger than 128 bytes. 28 | func SysReadFile(file string) (string, error) { 29 | f, err := os.Open(file) 30 | if err != nil { 31 | return "", err 32 | } 33 | defer f.Close() 34 | 35 | // On some machines, hwmon drivers are broken and return EAGAIN. This causes 36 | // Go's ioutil.ReadFile implementation to poll forever. 37 | // 38 | // Since we either want to read data or bail immediately, do the simplest 39 | // possible read using syscall directly. 40 | const sysFileBufferSize = 128 41 | b := make([]byte, sysFileBufferSize) 42 | n, err := syscall.Read(int(f.Fd()), b) 43 | if err != nil { 44 | return "", err 45 | } 46 | 47 | return string(bytes.TrimSpace(b[:n])), nil 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/internal/util/sysreadfile_compat.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build linux,appengine !linux 15 | 16 | package util 17 | 18 | import ( 19 | "fmt" 20 | ) 21 | 22 | // SysReadFile is here implemented as a noop for builds that do not support 23 | // the read syscall. For example Windows, or Linux on Google App Engine. 24 | func SysReadFile(file string) (string, error) { 25 | return "", fmt.Errorf("not supported on this platform") 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/proc_environ.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package procfs 15 | 16 | import ( 17 | "strings" 18 | 19 | "github.com/prometheus/procfs/internal/util" 20 | ) 21 | 22 | // Environ reads process environments from /proc//environ 23 | func (p Proc) Environ() ([]string, error) { 24 | environments := make([]string, 0) 25 | 26 | data, err := util.ReadFileNoStat(p.path("environ")) 27 | if err != nil { 28 | return environments, err 29 | } 30 | 31 | environments = strings.Split(string(data), "\000") 32 | if len(environments) > 0 { 33 | environments = environments[:len(environments)-1] 34 | } 35 | 36 | return environments, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for AMD64, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOVQ a1+8(FP), DI 26 | MOVQ a2+16(FP), SI 27 | MOVQ a3+24(FP), DX 28 | MOVQ $0, R10 29 | MOVQ $0, R8 30 | MOVQ $0, R9 31 | MOVQ trap+0(FP), AX // syscall entry 32 | SYSCALL 33 | MOVQ AX, r1+32(FP) 34 | MOVQ DX, r2+40(FP) 35 | CALL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 45 | MOVQ a1+8(FP), DI 46 | MOVQ a2+16(FP), SI 47 | MOVQ a3+24(FP), DX 48 | MOVQ $0, R10 49 | MOVQ $0, R8 50 | MOVQ $0, R9 51 | MOVQ trap+0(FP), AX // syscall entry 52 | SYSCALL 53 | MOVQ AX, r1+32(FP) 54 | MOVQ DX, r2+40(FP) 55 | RET 56 | 57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 58 | JMP syscall·gettimeofday(SB) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for arm, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 24 | BL runtime·entersyscall(SB) 25 | MOVW trap+0(FP), R7 26 | MOVW a1+4(FP), R0 27 | MOVW a2+8(FP), R1 28 | MOVW a3+12(FP), R2 29 | MOVW $0, R3 30 | MOVW $0, R4 31 | MOVW $0, R5 32 | SWI $0 33 | MOVW R0, r1+16(FP) 34 | MOVW $0, R0 35 | MOVW R0, r2+20(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 40 | B syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 43 | B syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 46 | MOVW trap+0(FP), R7 // syscall entry 47 | MOVW a1+4(FP), R0 48 | MOVW a2+8(FP), R1 49 | MOVW a3+12(FP), R2 50 | SWI $0 51 | MOVW R0, r1+16(FP) 52 | MOVW $0, R0 53 | MOVW R0, r2+20(FP) 54 | RET 55 | 56 | TEXT ·seek(SB),NOSPLIT,$0-28 57 | B syscall·seek(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | // +build linux 7 | // +build arm64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // Just jump to package syscall's implementation for all these functions. 13 | // The runtime may know about them. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | B syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | B syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | BL runtime·entersyscall(SB) 23 | MOVD a1+8(FP), R0 24 | MOVD a2+16(FP), R1 25 | MOVD a3+24(FP), R2 26 | MOVD $0, R3 27 | MOVD $0, R4 28 | MOVD $0, R5 29 | MOVD trap+0(FP), R8 // syscall entry 30 | SVC 31 | MOVD R0, r1+32(FP) // r1 32 | MOVD R1, r2+40(FP) // r2 33 | BL runtime·exitsyscall(SB) 34 | RET 35 | 36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 37 | B syscall·RawSyscall(SB) 38 | 39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 40 | B syscall·RawSyscall6(SB) 41 | 42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 43 | MOVD a1+8(FP), R0 44 | MOVD a2+16(FP), R1 45 | MOVD a3+24(FP), R2 46 | MOVD $0, R3 47 | MOVD $0, R4 48 | MOVD $0, R5 49 | MOVD trap+0(FP), R8 // syscall entry 50 | SVC 51 | MOVD R0, r1+32(FP) 52 | MOVD R1, r2+40(FP) 53 | RET 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | // +build linux 7 | // +build mips64 mips64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | JAL runtime·entersyscall(SB) 27 | MOVV a1+8(FP), R4 28 | MOVV a2+16(FP), R5 29 | MOVV a3+24(FP), R6 30 | MOVV R0, R7 31 | MOVV R0, R8 32 | MOVV R0, R9 33 | MOVV trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVV R2, r1+32(FP) 36 | MOVV R3, r2+40(FP) 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVV a1+8(FP), R4 48 | MOVV a2+16(FP), R5 49 | MOVV a3+24(FP), R6 50 | MOVV R0, R7 51 | MOVV R0, R8 52 | MOVV R0, R9 53 | MOVV trap+0(FP), R2 // syscall entry 54 | SYSCALL 55 | MOVV R2, r1+32(FP) 56 | MOVV R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | // +build linux 7 | // +build mips mipsle 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-28 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 26 | JMP syscall·Syscall9(SB) 27 | 28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 29 | JAL runtime·entersyscall(SB) 30 | MOVW a1+4(FP), R4 31 | MOVW a2+8(FP), R5 32 | MOVW a3+12(FP), R6 33 | MOVW R0, R7 34 | MOVW trap+0(FP), R2 // syscall entry 35 | SYSCALL 36 | MOVW R2, r1+16(FP) // r1 37 | MOVW R3, r2+20(FP) // r2 38 | JAL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVW a1+4(FP), R4 49 | MOVW a2+8(FP), R5 50 | MOVW a3+12(FP), R6 51 | MOVW trap+0(FP), R2 // syscall entry 52 | SYSCALL 53 | MOVW R2, r1+16(FP) 54 | MOVW R3, r2+20(FP) 55 | RET 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | // +build linux 7 | // +build ppc64 ppc64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for ppc64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | BL runtime·entersyscall(SB) 21 | MOVD a1+8(FP), R3 22 | MOVD a2+16(FP), R4 23 | MOVD a3+24(FP), R5 24 | MOVD R0, R6 25 | MOVD R0, R7 26 | MOVD R0, R8 27 | MOVD trap+0(FP), R9 // syscall entry 28 | SYSCALL R9 29 | MOVD R3, r1+32(FP) 30 | MOVD R4, r2+40(FP) 31 | BL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 35 | MOVD a1+8(FP), R3 36 | MOVD a2+16(FP), R4 37 | MOVD a3+24(FP), R5 38 | MOVD R0, R6 39 | MOVD R0, R7 40 | MOVD R0, R8 41 | MOVD trap+0(FP), R9 // syscall entry 42 | SYSCALL R9 43 | MOVD R3, r1+32(FP) 44 | MOVD R4, r2+40(FP) 45 | RET 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | // +build riscv64 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for linux/riscv64. 13 | // 14 | // Where available, just jump to package syscall's implementation of 15 | // these functions. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOV a1+8(FP), A0 26 | MOV a2+16(FP), A1 27 | MOV a3+24(FP), A2 28 | MOV trap+0(FP), A7 // syscall entry 29 | ECALL 30 | MOV A0, r1+32(FP) // r1 31 | MOV A1, r2+40(FP) // r2 32 | CALL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | JMP syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | JMP syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOV a1+8(FP), A0 43 | MOV a2+16(FP), A1 44 | MOV a3+24(FP), A2 45 | MOV trap+0(FP), A7 // syscall entry 46 | ECALL 47 | MOV A0, r1+32(FP) 48 | MOV A1, r2+40(FP) 49 | RET 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | // +build linux 7 | // +build s390x 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for s390x, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | BR syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | BR syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | BL runtime·entersyscall(SB) 27 | MOVD a1+8(FP), R2 28 | MOVD a2+16(FP), R3 29 | MOVD a3+24(FP), R4 30 | MOVD $0, R5 31 | MOVD $0, R6 32 | MOVD $0, R7 33 | MOVD trap+0(FP), R1 // syscall entry 34 | SYSCALL 35 | MOVD R2, r1+32(FP) 36 | MOVD R3, r2+40(FP) 37 | BL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | BR syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | BR syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVD a1+8(FP), R2 48 | MOVD a2+16(FP), R3 49 | MOVD a3+24(FP), R4 50 | MOVD $0, R5 51 | MOVD $0, R6 52 | MOVD $0, R7 53 | MOVD trap+0(FP), R1 // syscall entry 54 | SYSCALL 55 | MOVD R2, r1+32(FP) 56 | MOVD R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep 6 | // them here for backwards compatibility. 7 | 8 | package unix 9 | 10 | const ( 11 | DLT_HHDLC = 0x79 12 | IPV6_MIN_MEMBERSHIPS = 0x1f 13 | IP_MAX_SOURCE_FILTER = 0x400 14 | IP_MIN_MEMBERSHIPS = 0x1f 15 | RT_CACHING_CONTEXT = 0x1 16 | RT_NORTREF = 0x2 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 14 | var fcntl64Syscall uintptr = SYS_FCNTL 15 | 16 | func fcntl(fd int, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 27 | return fcntl(int(fd), cmd, arg) 28 | } 29 | 30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 33 | if errno == 0 { 34 | return nil 35 | } 36 | return errno 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 26 | 27 | struct ret 28 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 29 | { 30 | struct ret r; 31 | 32 | errno = 0; 33 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 34 | r.err = errno; 35 | return r; 36 | } 37 | 38 | uintptr_t gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 39 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 40 | 41 | uintptr_t 42 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 43 | { 44 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 45 | } 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *(*Ucred)(h.data(0)) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | ) 13 | 14 | // Round the length of a raw sockaddr up to align it properly. 15 | func cmsgAlignOf(salen int) int { 16 | salign := SizeofPtr 17 | 18 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 19 | // sockcmsg_dragonfly.go 20 | switch runtime.GOOS { 21 | case "aix": 22 | // There is no alignment on AIX. 23 | salign = 1 24 | case "darwin", "ios", "illumos", "solaris": 25 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 26 | // kernels still require 32-bit aligned access to network 27 | // subsystem. 28 | if SizeofPtr == 8 { 29 | salign = 4 30 | } 31 | case "netbsd", "openbsd": 32 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 33 | if runtime.GOARCH == "arm" { 34 | salign = 8 35 | } 36 | // NetBSD aarch64 requires 128-bit alignment. 37 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 38 | salign = 16 39 | } 40 | case "zos": 41 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 42 | // not pointer width. 43 | salign = SizeofInt 44 | } 45 | 46 | return (salen + salign - 1) & ^(salign - 1) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | package unix 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + uitoa(uint(-val)) 13 | } 14 | return uitoa(uint(val)) 15 | } 16 | 17 | func uitoa(val uint) string { 18 | var buf [32]byte // big enough for int64 19 | i := len(buf) - 1 20 | for val >= 10 { 21 | buf[i] = byte(val%10 + '0') 22 | i-- 23 | val /= 10 24 | } 25 | buf[i] = byte(val + '0') 26 | return string(buf[i:]) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func Fstat(fd int, stat *Stat_t) error { 41 | return fstat(fd, stat) 42 | } 43 | 44 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 45 | return fstatat(dirfd, path, stat, flags) 46 | } 47 | 48 | func Lstat(path string, stat *Stat_t) error { 49 | return lstat(path, stat) 50 | } 51 | 52 | func Stat(path string, statptr *Stat_t) error { 53 | return stat(path, statptr) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 && !go1.13 6 | // +build darwin,go1.12,!go1.13 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const _SYS_GETDIRENTRIES64 = 344 15 | 16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 17 | // To implement this using libSystem we'd need syscall_syscallPtr for 18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 19 | // back to raw syscalls for this func on Go 1.12. 20 | var p unsafe.Pointer 21 | if len(buf) > 0 { 22 | p = unsafe.Pointer(&buf[0]) 23 | } else { 24 | p = unsafe.Pointer(&_zero) 25 | } 26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 27 | n = int(r0) 28 | if e1 != 0 { 29 | return n, errnoErr(e1) 30 | } 31 | return n, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && darwin 6 | // +build arm64,darwin 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: sec, Nsec: nsec} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: sec, Usec: int32(usec)} 18 | } 19 | 20 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 21 | k.Ident = uint64(fd) 22 | k.Filter = int16(mode) 23 | k.Flags = uint16(flags) 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetControllen(length int) { 31 | msghdr.Controllen = uint32(length) 32 | } 33 | 34 | func (msghdr *Msghdr) SetIovlen(length int) { 35 | msghdr.Iovlen = int32(length) 36 | } 37 | 38 | func (cmsg *Cmsghdr) SetLen(length int) { 39 | cmsg.Len = uint32(length) 40 | } 41 | 42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 43 | 44 | //sys Fstat(fd int, stat *Stat_t) (err error) 45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 48 | //sys Lstat(path string, stat *Stat_t) (err error) 49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 50 | //sys Stat(path string, stat *Stat_t) (err error) 51 | //sys Statfs(path string, stat *Statfs_t) (err error) 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 6 | // +build darwin,go1.12 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_darwin.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 20 | 21 | //go:linkname syscall_syscall syscall.syscall 22 | //go:linkname syscall_syscall6 syscall.syscall6 23 | //go:linkname syscall_syscall6X syscall.syscall6X 24 | //go:linkname syscall_syscall9 syscall.syscall9 25 | //go:linkname syscall_rawSyscall syscall.rawSyscall 26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 27 | //go:linkname syscall_syscallPtr syscall.syscallPtr 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && dragonfly 6 | // +build amd64,dragonfly 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func setTimespec(sec, nsec int64) Timespec { 16 | return Timespec{Sec: sec, Nsec: nsec} 17 | } 18 | 19 | func setTimeval(sec, usec int64) Timeval { 20 | return Timeval{Sec: sec, Usec: usec} 21 | } 22 | 23 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 24 | k.Ident = uint64(fd) 25 | k.Filter = int16(mode) 26 | k.Flags = uint16(flags) 27 | } 28 | 29 | func (iov *Iovec) SetLen(length int) { 30 | iov.Len = uint64(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetControllen(length int) { 34 | msghdr.Controllen = uint32(length) 35 | } 36 | 37 | func (msghdr *Msghdr) SetIovlen(length int) { 38 | msghdr.Iovlen = int32(length) 39 | } 40 | 41 | func (cmsg *Cmsghdr) SetLen(length int) { 42 | cmsg.Len = uint32(length) 43 | } 44 | 45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 46 | var writtenOut uint64 = 0 47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 48 | 49 | written = int(writtenOut) 50 | 51 | if e1 != 0 { 52 | err = e1 53 | } 54 | return 55 | } 56 | 57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | // +build linux,gccgo,386 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | 23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 25 | return int(fd), err 26 | } 27 | 28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 30 | return int(fd), err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | // +build 386,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | // +build amd64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | // +build arm,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | // +build arm64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (cmsg *Cmsghdr) SetLen(length int) { 30 | cmsg.Len = uint32(length) 31 | } 32 | 33 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 34 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 35 | const SYS___SYSCTL = SYS_SYSCTL 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 7 | // +build gc 8 | // +build !ppc64le 9 | // +build !ppc64 10 | 11 | package unix 12 | 13 | import "syscall" 14 | 15 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 18 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | // +build linux 5 | // +build arm arm64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsArm is the registers used by arm binaries. 12 | type PtraceRegsArm struct { 13 | Uregs [18]uint32 14 | } 15 | 16 | // PtraceGetRegsArm fetches the registers used by arm binaries. 17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 19 | } 20 | 21 | // PtraceSetRegsArm sets the registers used by arm binaries. 22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 24 | } 25 | 26 | // PtraceRegsArm64 is the registers used by arm64 binaries. 27 | type PtraceRegsArm64 struct { 28 | Regs [31]uint64 29 | Sp uint64 30 | Pc uint64 31 | Pstate uint64 32 | } 33 | 34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 37 | } 38 | 39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | // +build linux 5 | // +build mips mips64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMips is the registers used by mips binaries. 12 | type PtraceRegsMips struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMips fetches the registers used by mips binaries. 23 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMips sets the registers used by mips binaries. 28 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64 is the registers used by mips64 binaries. 33 | type PtraceRegsMips64 struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 44 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 49 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. 2 | 3 | //go:build linux && (mipsle || mips64le) 4 | // +build linux 5 | // +build mipsle mips64le 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsMipsle is the registers used by mipsle binaries. 12 | type PtraceRegsMipsle struct { 13 | Regs [32]uint64 14 | Lo uint64 15 | Hi uint64 16 | Epc uint64 17 | Badvaddr uint64 18 | Status uint64 19 | Cause uint64 20 | } 21 | 22 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 23 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 25 | } 26 | 27 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 28 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 30 | } 31 | 32 | // PtraceRegsMips64le is the registers used by mips64le binaries. 33 | type PtraceRegsMips64le struct { 34 | Regs [32]uint64 35 | Lo uint64 36 | Hi uint64 37 | Epc uint64 38 | Badvaddr uint64 39 | Status uint64 40 | Cause uint64 41 | } 42 | 43 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 44 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 46 | } 47 | 48 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 49 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && amd64 && go1.13 5 | // +build darwin,amd64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && arm64 && go1.13 5 | // +build darwin,arm64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm_darwin.go arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go: -------------------------------------------------------------------------------- 1 | // cgo -godefs types_illumos.go | go run mkpost.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build amd64 && illumos 5 | // +build amd64,illumos 6 | 7 | package unix 8 | 9 | const ( 10 | TUNNEWPPA = 0x540001 11 | TUNSETPPA = 0x540002 12 | 13 | I_STR = 0x5308 14 | I_POP = 0x5303 15 | I_PUSH = 0x5302 16 | I_PLINK = 0x5316 17 | I_PUNLINK = 0x5317 18 | 19 | IF_UNITSEL = -0x7ffb8cca 20 | ) 21 | 22 | type strbuf struct { 23 | Maxlen int32 24 | Len int32 25 | Buf *int8 26 | } 27 | 28 | type Strioctl struct { 29 | Cmd int32 30 | Timout int32 31 | Len int32 32 | Dp *int8 33 | } 34 | 35 | type Lifreq struct { 36 | Name [32]int8 37 | Lifru1 [4]byte 38 | Type uint32 39 | Lifru [336]byte 40 | } 41 | -------------------------------------------------------------------------------- /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 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.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 !go1.12 6 | // +build !go1.12 7 | 8 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 9 | // and earlier (see https://golang.org/issue/23311). 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.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 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | // Returns a default environment associated with the token, rather than the current 31 | // process. If inheritExisting is true, then this environment also inherits the 32 | // environment of the current process. 33 | func (token Token) Environ(inheritExisting bool) (env []string, err error) { 34 | var block *uint16 35 | err = CreateEnvironmentBlock(&block, token, inheritExisting) 36 | if err != nil { 37 | return nil, err 38 | } 39 | defer DestroyEnvironmentBlock(block) 40 | blockp := uintptr(unsafe.Pointer(block)) 41 | for { 42 | entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp))) 43 | if len(entry) == 0 { 44 | break 45 | } 46 | env = append(env, entry) 47 | blockp += 2 * (uintptr(len(entry)) + 1) 48 | } 49 | return env, nil 50 | } 51 | 52 | func Unsetenv(key string) error { 53 | return syscall.Unsetenv(key) 54 | } 55 | -------------------------------------------------------------------------------- /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 | // +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/memory_windows.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 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x00000001 20 | PAGE_READONLY = 0x00000002 21 | PAGE_READWRITE = 0x00000004 22 | PAGE_WRITECOPY = 0x00000008 23 | PAGE_EXECUTE = 0x00000010 24 | PAGE_EXECUTE_READ = 0x00000020 25 | PAGE_EXECUTE_READWRITE = 0x00000040 26 | PAGE_EXECUTE_WRITECOPY = 0x00000080 27 | PAGE_GUARD = 0x00000100 28 | PAGE_NOCACHE = 0x00000200 29 | PAGE_WRITECOMBINE = 0x00000400 30 | PAGE_TARGETS_INVALID = 0x40000000 31 | PAGE_TARGETS_NO_UPDATE = 0x40000000 32 | 33 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 34 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 35 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 36 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 37 | ) 38 | -------------------------------------------------------------------------------- /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 | // +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 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 | // +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 | // +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 | // +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/google.golang.org/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/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/google.golang.org/protobuf/encoding/prototext/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package prototext marshals and unmarshals protocol buffer messages as the 6 | // textproto format. 7 | package prototext 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/descopts/options.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 descopts contains the nil pointers to concrete descriptor options. 6 | // 7 | // This package exists as a form of reverse dependency injection so that certain 8 | // packages (e.g., internal/filedesc and internal/filetype can avoid a direct 9 | // dependency on the descriptor proto package). 10 | package descopts 11 | 12 | import pref "google.golang.org/protobuf/reflect/protoreflect" 13 | 14 | // These variables are set by the init function in descriptor.pb.go via logic 15 | // in internal/filetype. In other words, so long as the descriptor proto package 16 | // is linked in, these variables will be populated. 17 | // 18 | // Each variable is populated with a nil pointer to the options struct. 19 | var ( 20 | File pref.ProtoMessage 21 | Enum pref.ProtoMessage 22 | EnumValue pref.ProtoMessage 23 | Message pref.ProtoMessage 24 | Field pref.ProtoMessage 25 | Oneof pref.ProtoMessage 26 | ExtensionRange pref.ProtoMessage 27 | Service pref.ProtoMessage 28 | Method pref.ProtoMessage 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/encoding/text/doc.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 text implements the text format for protocol buffers. 6 | // This package has no semantic understanding for protocol buffers and is only 7 | // a parser and composer for the format. 8 | // 9 | // There is no formal specification for the protobuf text format, as such the 10 | // C++ implementation (see google::protobuf::TextFormat) is the reference 11 | // implementation of the text format. 12 | // 13 | // This package is neither a superset nor a subset of the C++ implementation. 14 | // This implementation permits a more liberal grammar in some cases to be 15 | // backwards compatible with the historical Go implementation. 16 | // Future parsings unique to Go should not be added. 17 | // Some grammars allowed by the C++ implementation are deliberately 18 | // not implemented here because they are considered a bug by the protobuf team 19 | // and should not be replicated. 20 | // 21 | // The Go implementation should implement a sufficient amount of the C++ 22 | // grammar such that the default text serialization by C++ can be parsed by Go. 23 | // However, just because the C++ parser accepts some input does not mean that 24 | // the Go implementation should as well. 25 | // 26 | // The text format is almost a superset of JSON except: 27 | // * message keys are not quoted strings, but identifiers 28 | // * the top-level value must be a message without the delimiters 29 | package text 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go112.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 | // +build !go1.13 6 | 7 | package errors 8 | 9 | import "reflect" 10 | 11 | // Is is a copy of Go 1.13's errors.Is for use with older Go versions. 12 | func Is(err, target error) bool { 13 | if target == nil { 14 | return err == target 15 | } 16 | 17 | isComparable := reflect.TypeOf(target).Comparable() 18 | for { 19 | if isComparable && err == target { 20 | return true 21 | } 22 | if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { 23 | return true 24 | } 25 | if err = unwrap(err); err == nil { 26 | return false 27 | } 28 | } 29 | } 30 | 31 | func unwrap(err error) error { 32 | u, ok := err.(interface { 33 | Unwrap() error 34 | }) 35 | if !ok { 36 | return nil 37 | } 38 | return u.Unwrap() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go113.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 | // +build go1.13 6 | 7 | package errors 8 | 9 | import "errors" 10 | 11 | // Is is errors.Is. 12 | func Is(err, target error) bool { return errors.Is(err, target) } 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/flags.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 flags provides a set of flags controlled by build tags. 6 | package flags 7 | 8 | // ProtoLegacy specifies whether to enable support for legacy functionality 9 | // such as MessageSets, weak fields, and various other obscure behavior 10 | // that is necessary to maintain backwards compatibility with proto1 or 11 | // the pre-release variants of proto2 and proto3. 12 | // 13 | // This is disabled by default unless built with the "protolegacy" tag. 14 | // 15 | // WARNING: The compatibility agreement covers nothing provided by this flag. 16 | // As such, functionality may suddenly be removed or changed at our discretion. 17 | const ProtoLegacy = protoLegacy 18 | 19 | // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions. 20 | // 21 | // Lazy extension unmarshaling validates the contents of message-valued 22 | // extension fields at unmarshal time, but defers creating the message 23 | // structure until the extension is first accessed. 24 | const LazyUnmarshalExtensions = ProtoLegacy 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !protolegacy 6 | 7 | package flags 8 | 9 | const protoLegacy = false 10 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build protolegacy 6 | 7 | package flags 8 | 9 | const protoLegacy = true 10 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/any_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_any_proto = "google/protobuf/any.proto" 14 | 15 | // Names for google.protobuf.Any. 16 | const ( 17 | Any_message_name protoreflect.Name = "Any" 18 | Any_message_fullname protoreflect.FullName = "google.protobuf.Any" 19 | ) 20 | 21 | // Field names for google.protobuf.Any. 22 | const ( 23 | Any_TypeUrl_field_name protoreflect.Name = "type_url" 24 | Any_Value_field_name protoreflect.Name = "value" 25 | 26 | Any_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Any.type_url" 27 | Any_Value_field_fullname protoreflect.FullName = "google.protobuf.Any.value" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Any. 31 | const ( 32 | Any_TypeUrl_field_number protoreflect.FieldNumber = 1 33 | Any_Value_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package genid contains constants for declarations in descriptor.proto 6 | // and the well-known types. 7 | package genid 8 | 9 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/duration_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_duration_proto = "google/protobuf/duration.proto" 14 | 15 | // Names for google.protobuf.Duration. 16 | const ( 17 | Duration_message_name protoreflect.Name = "Duration" 18 | Duration_message_fullname protoreflect.FullName = "google.protobuf.Duration" 19 | ) 20 | 21 | // Field names for google.protobuf.Duration. 22 | const ( 23 | Duration_Seconds_field_name protoreflect.Name = "seconds" 24 | Duration_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Duration_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Duration.seconds" 27 | Duration_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Duration.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Duration. 31 | const ( 32 | Duration_Seconds_field_number protoreflect.FieldNumber = 1 33 | Duration_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/empty_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" 14 | 15 | // Names for google.protobuf.Empty. 16 | const ( 17 | Empty_message_name protoreflect.Name = "Empty" 18 | Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" 14 | 15 | // Names for google.protobuf.FieldMask. 16 | const ( 17 | FieldMask_message_name protoreflect.Name = "FieldMask" 18 | FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" 19 | ) 20 | 21 | // Field names for google.protobuf.FieldMask. 22 | const ( 23 | FieldMask_Paths_field_name protoreflect.Name = "paths" 24 | 25 | FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" 26 | ) 27 | 28 | // Field numbers for google.protobuf.FieldMask. 29 | const ( 30 | FieldMask_Paths_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/goname.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 genid 6 | 7 | // Go names of implementation-specific struct fields in generated messages. 8 | const ( 9 | State_goname = "state" 10 | 11 | SizeCache_goname = "sizeCache" 12 | SizeCacheA_goname = "XXX_sizecache" 13 | 14 | WeakFields_goname = "weakFields" 15 | WeakFieldsA_goname = "XXX_weak" 16 | 17 | UnknownFields_goname = "unknownFields" 18 | UnknownFieldsA_goname = "XXX_unrecognized" 19 | 20 | ExtensionFields_goname = "extensionFields" 21 | ExtensionFieldsA_goname = "XXX_InternalExtensions" 22 | ExtensionFieldsB_goname = "XXX_extensions" 23 | 24 | WeakFieldPrefix_goname = "XXX_weak_" 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/map_entry.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 genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field names and numbers for synthetic map entry messages. 10 | const ( 11 | MapEntry_Key_field_name protoreflect.Name = "key" 12 | MapEntry_Value_field_name protoreflect.Name = "value" 13 | 14 | MapEntry_Key_field_number protoreflect.FieldNumber = 1 15 | MapEntry_Value_field_number protoreflect.FieldNumber = 2 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/source_context_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_source_context_proto = "google/protobuf/source_context.proto" 14 | 15 | // Names for google.protobuf.SourceContext. 16 | const ( 17 | SourceContext_message_name protoreflect.Name = "SourceContext" 18 | SourceContext_message_fullname protoreflect.FullName = "google.protobuf.SourceContext" 19 | ) 20 | 21 | // Field names for google.protobuf.SourceContext. 22 | const ( 23 | SourceContext_FileName_field_name protoreflect.Name = "file_name" 24 | 25 | SourceContext_FileName_field_fullname protoreflect.FullName = "google.protobuf.SourceContext.file_name" 26 | ) 27 | 28 | // Field numbers for google.protobuf.SourceContext. 29 | const ( 30 | SourceContext_FileName_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.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 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_timestamp_proto = "google/protobuf/timestamp.proto" 14 | 15 | // Names for google.protobuf.Timestamp. 16 | const ( 17 | Timestamp_message_name protoreflect.Name = "Timestamp" 18 | Timestamp_message_fullname protoreflect.FullName = "google.protobuf.Timestamp" 19 | ) 20 | 21 | // Field names for google.protobuf.Timestamp. 22 | const ( 23 | Timestamp_Seconds_field_name protoreflect.Name = "seconds" 24 | Timestamp_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Timestamp_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.seconds" 27 | Timestamp_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Timestamp. 31 | const ( 32 | Timestamp_Seconds_field_number protoreflect.FieldNumber = 1 33 | Timestamp_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/wrappers.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 genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field name and number for messages in wrappers.proto. 10 | const ( 11 | WrapperValue_Value_field_name protoreflect.Name = "value" 12 | WrapperValue_Value_field_number protoreflect.FieldNumber = 1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.12 6 | 7 | package impl 8 | 9 | import "reflect" 10 | 11 | type mapIter struct { 12 | v reflect.Value 13 | keys []reflect.Value 14 | } 15 | 16 | // mapRange provides a less-efficient equivalent to 17 | // the Go 1.12 reflect.Value.MapRange method. 18 | func mapRange(v reflect.Value) *mapIter { 19 | return &mapIter{v: v} 20 | } 21 | 22 | func (i *mapIter) Next() bool { 23 | if i.keys == nil { 24 | i.keys = i.v.MapKeys() 25 | } else { 26 | i.keys = i.keys[1:] 27 | } 28 | return len(i.keys) > 0 29 | } 30 | 31 | func (i *mapIter) Key() reflect.Value { 32 | return i.keys[0] 33 | } 34 | 35 | func (i *mapIter) Value() reflect.Value { 36 | return i.v.MapIndex(i.keys[0]) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.12 6 | 7 | package impl 8 | 9 | import "reflect" 10 | 11 | func mapRange(v reflect.Value) *reflect.MapIter { return v.MapRange() } 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !purego,!appengine 6 | 7 | package impl 8 | 9 | // When using unsafe pointers, we can just treat enum values as int32s. 10 | 11 | var ( 12 | coderEnumNoZero = coderInt32NoZero 13 | coderEnum = coderInt32 14 | coderEnumPtr = coderInt32Ptr 15 | coderEnumSlice = coderInt32Slice 16 | coderEnumPackedSlice = coderInt32PackedSlice 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/enum.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 impl 6 | 7 | import ( 8 | "reflect" 9 | 10 | pref "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | type EnumInfo struct { 14 | GoReflectType reflect.Type // int32 kind 15 | Desc pref.EnumDescriptor 16 | } 17 | 18 | func (t *EnumInfo) New(n pref.EnumNumber) pref.Enum { 19 | return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(pref.Enum) 20 | } 21 | func (t *EnumInfo) Descriptor() pref.EnumDescriptor { return t.Desc } 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/pragma/pragma.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 pragma provides types that can be embedded into a struct to 6 | // statically enforce or prevent certain language properties. 7 | package pragma 8 | 9 | import "sync" 10 | 11 | // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals. 12 | type NoUnkeyedLiterals struct{} 13 | 14 | // DoNotImplement can be embedded in an interface to prevent trivial 15 | // implementations of the interface. 16 | // 17 | // This is useful to prevent unauthorized implementations of an interface 18 | // so that it can be extended in the future for any protobuf language changes. 19 | type DoNotImplement interface{ ProtoInternal(DoNotImplement) } 20 | 21 | // DoNotCompare can be embedded in a struct to prevent comparability. 22 | type DoNotCompare [0]func() 23 | 24 | // DoNotCopy can be embedded in a struct to help prevent shallow copies. 25 | // This does not rely on a Go language feature, but rather a special case 26 | // within the vet checker. 27 | // 28 | // See https://golang.org/issues/8005. 29 | type DoNotCopy [0]sync.Mutex 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/set/ints.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 set provides simple set data structures for uint64s. 6 | package set 7 | 8 | import "math/bits" 9 | 10 | // int64s represents a set of integers within the range of 0..63. 11 | type int64s uint64 12 | 13 | func (bs *int64s) Len() int { 14 | return bits.OnesCount64(uint64(*bs)) 15 | } 16 | func (bs *int64s) Has(n uint64) bool { 17 | return uint64(*bs)&(uint64(1)< 0 18 | } 19 | func (bs *int64s) Set(n uint64) { 20 | *(*uint64)(bs) |= uint64(1) << n 21 | } 22 | func (bs *int64s) Clear(n uint64) { 23 | *(*uint64)(bs) &^= uint64(1) << n 24 | } 25 | 26 | // Ints represents a set of integers within the range of 0..math.MaxUint64. 27 | type Ints struct { 28 | lo int64s 29 | hi map[uint64]struct{} 30 | } 31 | 32 | func (bs *Ints) Len() int { 33 | return bs.lo.Len() + len(bs.hi) 34 | } 35 | func (bs *Ints) Has(n uint64) bool { 36 | if n < 64 { 37 | return bs.lo.Has(n) 38 | } 39 | _, ok := bs.hi[n] 40 | return ok 41 | } 42 | func (bs *Ints) Set(n uint64) { 43 | if n < 64 { 44 | bs.lo.Set(n) 45 | return 46 | } 47 | if bs.hi == nil { 48 | bs.hi = make(map[uint64]struct{}) 49 | } 50 | bs.hi[n] = struct{}{} 51 | } 52 | func (bs *Ints) Clear(n uint64) { 53 | if n < 64 { 54 | bs.lo.Clear(n) 55 | return 56 | } 57 | delete(bs.hi, n) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/strs/strings_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build purego appengine 6 | 7 | package strs 8 | 9 | import pref "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | func UnsafeString(b []byte) string { 12 | return string(b) 13 | } 14 | 15 | func UnsafeBytes(s string) []byte { 16 | return []byte(s) 17 | } 18 | 19 | type Builder struct{} 20 | 21 | func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName { 22 | return prefix.Append(name) 23 | } 24 | 25 | func (*Builder) MakeString(b []byte) string { 26 | return string(b) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto.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 proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | ) 11 | 12 | // Message is the top-level interface that all messages must implement. 13 | // It provides access to a reflective view of a message. 14 | // Any implementation of this interface may be used with all functions in the 15 | // protobuf module that accept a Message, except where otherwise specified. 16 | // 17 | // This is the v2 interface definition for protobuf messages. 18 | // The v1 interface definition is "github.com/golang/protobuf/proto".Message. 19 | // 20 | // To convert a v1 message to a v2 message, 21 | // use "github.com/golang/protobuf/proto".MessageV2. 22 | // To convert a v2 message to a v1 message, 23 | // use "github.com/golang/protobuf/proto".MessageV1. 24 | type Message = protoreflect.ProtoMessage 25 | 26 | // Error matches all errors produced by packages in the protobuf module. 27 | // 28 | // That is, errors.Is(err, Error) reports whether an error is produced 29 | // by this module. 30 | var Error error 31 | 32 | func init() { 33 | Error = errors.Error 34 | } 35 | 36 | // MessageName returns the full name of m. 37 | // If m is nil, it returns an empty string. 38 | func MessageName(m Message) protoreflect.FullName { 39 | if m == nil { 40 | return "" 41 | } 42 | return m.ProtoReflect().Descriptor().FullName() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_methods.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 | // The protoreflect build tag disables use of fast-path methods. 6 | // +build !protoreflect 7 | 8 | package proto 9 | 10 | import ( 11 | "google.golang.org/protobuf/reflect/protoreflect" 12 | "google.golang.org/protobuf/runtime/protoiface" 13 | ) 14 | 15 | const hasProtoMethods = true 16 | 17 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 18 | return m.ProtoMethods() 19 | } 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_reflect.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 | // The protoreflect build tag disables use of fast-path methods. 6 | // +build protoreflect 7 | 8 | package proto 9 | 10 | import ( 11 | "google.golang.org/protobuf/reflect/protoreflect" 12 | "google.golang.org/protobuf/runtime/protoiface" 13 | ) 14 | 15 | const hasProtoMethods = false 16 | 17 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/reset.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 proto 6 | 7 | import ( 8 | "fmt" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // Reset clears every field in the message. 14 | // The resulting message shares no observable memory with its previous state 15 | // other than the memory for the message itself. 16 | func Reset(m Message) { 17 | if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { 18 | mr.Reset() 19 | return 20 | } 21 | resetMessage(m.ProtoReflect()) 22 | } 23 | 24 | func resetMessage(m protoreflect.Message) { 25 | if !m.IsValid() { 26 | panic(fmt.Sprintf("cannot reset invalid %v message", m.Descriptor().FullName())) 27 | } 28 | 29 | // Clear all known fields. 30 | fds := m.Descriptor().Fields() 31 | for i := 0; i < fds.Len(); i++ { 32 | m.Clear(fds.Get(i)) 33 | } 34 | 35 | // Clear extension fields. 36 | m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { 37 | m.Clear(fd) 38 | return true 39 | }) 40 | 41 | // Clear unknown fields. 42 | m.SetUnknown(nil) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/wrappers.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 proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int32 stores v in a new int32 value and returns a pointer to it. 11 | func Int32(v int32) *int32 { return &v } 12 | 13 | // Int64 stores v in a new int64 value and returns a pointer to it. 14 | func Int64(v int64) *int64 { return &v } 15 | 16 | // Float32 stores v in a new float32 value and returns a pointer to it. 17 | func Float32(v float32) *float32 { return &v } 18 | 19 | // Float64 stores v in a new float64 value and returns a pointer to it. 20 | func Float64(v float64) *float64 { return &v } 21 | 22 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 23 | func Uint32(v uint32) *uint32 { return &v } 24 | 25 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 26 | func Uint64(v uint64) *uint64 { return &v } 27 | 28 | // String stores v in a new string value and returns a pointer to it. 29 | func String(v string) *string { return &v } 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build purego appengine 6 | 7 | package protoreflect 8 | 9 | import "google.golang.org/protobuf/internal/pragma" 10 | 11 | type valueType int 12 | 13 | const ( 14 | nilType valueType = iota 15 | boolType 16 | int32Type 17 | int64Type 18 | uint32Type 19 | uint64Type 20 | float32Type 21 | float64Type 22 | stringType 23 | bytesType 24 | enumType 25 | ifaceType 26 | ) 27 | 28 | // value is a union where only one type can be represented at a time. 29 | // This uses a distinct field for each type. This is type safe in Go, but 30 | // occupies more memory than necessary (72B). 31 | type value struct { 32 | pragma.DoNotCompare // 0B 33 | 34 | typ valueType // 8B 35 | num uint64 // 8B 36 | str string // 16B 37 | bin []byte // 24B 38 | iface interface{} // 16B 39 | } 40 | 41 | func valueOfString(v string) Value { 42 | return Value{typ: stringType, str: v} 43 | } 44 | func valueOfBytes(v []byte) Value { 45 | return Value{typ: bytesType, bin: v} 46 | } 47 | func valueOfIface(v interface{}) Value { 48 | return Value{typ: ifaceType, iface: v} 49 | } 50 | 51 | func (v Value) getString() string { 52 | return v.str 53 | } 54 | func (v Value) getBytes() []byte { 55 | return v.bin 56 | } 57 | func (v Value) getIface() interface{} { 58 | return v.iface 59 | } 60 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoiface/legacy.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 protoiface 6 | 7 | type MessageV1 interface { 8 | Reset() 9 | String() string 10 | ProtoMessage() 11 | } 12 | 13 | type ExtensionRangeV1 struct { 14 | Start, End int32 // both inclusive 15 | } 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/impl.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 protoimpl contains the default implementation for messages 6 | // generated by protoc-gen-go. 7 | // 8 | // WARNING: This package should only ever be imported by generated messages. 9 | // The compatibility agreement covers nothing except for functionality needed 10 | // to keep existing generated messages operational. Breakages that occur due 11 | // to unauthorized usages of this package are not the author's responsibility. 12 | package protoimpl 13 | 14 | import ( 15 | "google.golang.org/protobuf/internal/filedesc" 16 | "google.golang.org/protobuf/internal/filetype" 17 | "google.golang.org/protobuf/internal/impl" 18 | ) 19 | 20 | // UnsafeEnabled specifies whether package unsafe can be used. 21 | const UnsafeEnabled = impl.UnsafeEnabled 22 | 23 | type ( 24 | // Types used by generated code in init functions. 25 | DescBuilder = filedesc.Builder 26 | TypeBuilder = filetype.Builder 27 | 28 | // Types used by generated code to implement EnumType, MessageType, and ExtensionType. 29 | EnumInfo = impl.EnumInfo 30 | MessageInfo = impl.MessageInfo 31 | ExtensionInfo = impl.ExtensionInfo 32 | 33 | // Types embedded in generated messages. 34 | MessageState = impl.MessageState 35 | SizeCache = impl.SizeCache 36 | WeakFields = impl.WeakFields 37 | UnknownFields = impl.UnknownFields 38 | ExtensionFields = impl.ExtensionFields 39 | ExtensionFieldV1 = impl.ExtensionField 40 | 41 | Pointer = impl.Pointer 42 | ) 43 | 44 | var X impl.Export 45 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "tip" 15 | 16 | go_import_path: gopkg.in/yaml.v2 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | --------------------------------------------------------------------------------