├── .github
└── workflows
│ └── tests.yaml
├── .gitignore
├── Dockerfile
├── README.md
├── cmd
└── boilerd
│ └── main.go
├── go.mod
├── go.sum
├── internal
└── exampleinternal
│ ├── internal.go
│ └── internal_test.go
├── pkg
├── examplepkg
│ ├── exampletype.go
│ ├── exampletype_test.go
│ └── types.go
├── metrics
│ └── metrics.go
└── web
│ ├── ping.go
│ ├── ping_test.go
│ ├── router.go
│ └── router_test.go
└── vendor
├── github.com
├── beorn7
│ └── perks
│ │ ├── LICENSE
│ │ └── quantile
│ │ ├── exampledata.txt
│ │ └── stream.go
├── cespare
│ └── xxhash
│ │ └── v2
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ ├── xxhash.go
│ │ ├── xxhash_amd64.go
│ │ ├── xxhash_amd64.s
│ │ ├── xxhash_other.go
│ │ ├── xxhash_safe.go
│ │ └── xxhash_unsafe.go
├── cogolabs
│ └── terminator
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── terminator.go
├── davecgh
│ └── go-spew
│ │ ├── LICENSE
│ │ └── spew
│ │ ├── bypass.go
│ │ ├── bypasssafe.go
│ │ ├── common.go
│ │ ├── config.go
│ │ ├── doc.go
│ │ ├── dump.go
│ │ ├── format.go
│ │ └── spew.go
├── golang
│ └── 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
├── gorilla
│ └── mux
│ │ ├── AUTHORS
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── doc.go
│ │ ├── middleware.go
│ │ ├── mux.go
│ │ ├── regexp.go
│ │ ├── route.go
│ │ └── test_helpers.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
│ │ │ ├── build_info_collector.go
│ │ │ ├── collector.go
│ │ │ ├── counter.go
│ │ │ ├── desc.go
│ │ │ ├── doc.go
│ │ │ ├── expvar_collector.go
│ │ │ ├── fnv.go
│ │ │ ├── gauge.go
│ │ │ ├── go_collector.go
│ │ │ ├── go_collector_go116.go
│ │ │ ├── go_collector_go117.go
│ │ │ ├── histogram.go
│ │ │ ├── internal
│ │ │ ├── go_runtime_metrics.go
│ │ │ └── metric.go
│ │ │ ├── labels.go
│ │ │ ├── metric.go
│ │ │ ├── observer.go
│ │ │ ├── process_collector.go
│ │ │ ├── process_collector_other.go
│ │ │ ├── process_collector_windows.go
│ │ │ ├── promauto
│ │ │ └── auto.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
│ │ ├── cmdline.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
│ │ ├── netstat.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_compare.go
│ ├── assertion_compare_can_convert.go
│ ├── assertion_compare_legacy.go
│ ├── assertion_format.go
│ ├── assertion_format.go.tmpl
│ ├── assertion_forward.go
│ ├── assertion_forward.go.tmpl
│ ├── assertion_order.go
│ ├── assertions.go
│ ├── doc.go
│ ├── errors.go
│ ├── forward_assertions.go
│ └── http_assertions.go
│ ├── require
│ ├── doc.go
│ ├── forward_requirements.go
│ ├── require.go
│ ├── require.go.tmpl
│ ├── require_forward.go
│ ├── require_forward.go.tmpl
│ └── requirements.go
│ └── suite
│ ├── doc.go
│ ├── interfaces.go
│ ├── stats.go
│ └── suite.go
├── golang.org
└── x
│ └── sys
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── internal
│ └── unsafeheader
│ │ └── unsafeheader.go
│ ├── unix
│ ├── .gitignore
│ ├── README.md
│ ├── affinity_linux.go
│ ├── aliases.go
│ ├── asm_aix_ppc64.s
│ ├── asm_bsd_386.s
│ ├── asm_bsd_amd64.s
│ ├── asm_bsd_arm.s
│ ├── asm_bsd_arm64.s
│ ├── asm_linux_386.s
│ ├── asm_linux_amd64.s
│ ├── asm_linux_arm.s
│ ├── asm_linux_arm64.s
│ ├── asm_linux_mips64x.s
│ ├── asm_linux_mipsx.s
│ ├── asm_linux_ppc64x.s
│ ├── asm_linux_riscv64.s
│ ├── asm_linux_s390x.s
│ ├── asm_openbsd_mips64.s
│ ├── asm_solaris_amd64.s
│ ├── asm_zos_s390x.s
│ ├── bluetooth_linux.go
│ ├── cap_freebsd.go
│ ├── constants.go
│ ├── dev_aix_ppc.go
│ ├── dev_aix_ppc64.go
│ ├── dev_darwin.go
│ ├── dev_dragonfly.go
│ ├── dev_freebsd.go
│ ├── dev_linux.go
│ ├── dev_netbsd.go
│ ├── dev_openbsd.go
│ ├── dev_zos.go
│ ├── dirent.go
│ ├── endian_big.go
│ ├── endian_little.go
│ ├── env_unix.go
│ ├── epoll_zos.go
│ ├── errors_freebsd_386.go
│ ├── errors_freebsd_amd64.go
│ ├── errors_freebsd_arm.go
│ ├── errors_freebsd_arm64.go
│ ├── fcntl.go
│ ├── fcntl_darwin.go
│ ├── fcntl_linux_32bit.go
│ ├── fdset.go
│ ├── fstatfs_zos.go
│ ├── gccgo.go
│ ├── gccgo_c.c
│ ├── gccgo_linux_amd64.go
│ ├── ifreq_linux.go
│ ├── ioctl.go
│ ├── ioctl_linux.go
│ ├── ioctl_zos.go
│ ├── mkall.sh
│ ├── mkerrors.sh
│ ├── pagesize_unix.go
│ ├── pledge_openbsd.go
│ ├── ptrace_darwin.go
│ ├── ptrace_ios.go
│ ├── race.go
│ ├── race0.go
│ ├── readdirent_getdents.go
│ ├── readdirent_getdirentries.go
│ ├── sockcmsg_dragonfly.go
│ ├── sockcmsg_linux.go
│ ├── sockcmsg_unix.go
│ ├── sockcmsg_unix_other.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_aix.go
│ ├── syscall_aix_ppc.go
│ ├── syscall_aix_ppc64.go
│ ├── syscall_bsd.go
│ ├── syscall_darwin.1_12.go
│ ├── syscall_darwin.1_13.go
│ ├── syscall_darwin.go
│ ├── syscall_darwin_amd64.go
│ ├── syscall_darwin_arm64.go
│ ├── syscall_darwin_libSystem.go
│ ├── syscall_dragonfly.go
│ ├── syscall_dragonfly_amd64.go
│ ├── syscall_freebsd.go
│ ├── syscall_freebsd_386.go
│ ├── syscall_freebsd_amd64.go
│ ├── syscall_freebsd_arm.go
│ ├── syscall_freebsd_arm64.go
│ ├── syscall_illumos.go
│ ├── syscall_linux.go
│ ├── syscall_linux_386.go
│ ├── syscall_linux_amd64.go
│ ├── syscall_linux_amd64_gc.go
│ ├── syscall_linux_arm.go
│ ├── syscall_linux_arm64.go
│ ├── syscall_linux_gc.go
│ ├── syscall_linux_gc_386.go
│ ├── syscall_linux_gc_arm.go
│ ├── syscall_linux_gccgo_386.go
│ ├── syscall_linux_gccgo_arm.go
│ ├── syscall_linux_mips64x.go
│ ├── syscall_linux_mipsx.go
│ ├── syscall_linux_ppc.go
│ ├── syscall_linux_ppc64x.go
│ ├── syscall_linux_riscv64.go
│ ├── syscall_linux_s390x.go
│ ├── syscall_linux_sparc64.go
│ ├── syscall_netbsd.go
│ ├── syscall_netbsd_386.go
│ ├── syscall_netbsd_amd64.go
│ ├── syscall_netbsd_arm.go
│ ├── syscall_netbsd_arm64.go
│ ├── syscall_openbsd.go
│ ├── syscall_openbsd_386.go
│ ├── syscall_openbsd_amd64.go
│ ├── syscall_openbsd_arm.go
│ ├── syscall_openbsd_arm64.go
│ ├── syscall_openbsd_mips64.go
│ ├── syscall_solaris.go
│ ├── syscall_solaris_amd64.go
│ ├── syscall_unix.go
│ ├── syscall_unix_gc.go
│ ├── syscall_unix_gc_ppc64x.go
│ ├── syscall_zos_s390x.go
│ ├── sysvshm_linux.go
│ ├── sysvshm_unix.go
│ ├── sysvshm_unix_other.go
│ ├── timestruct.go
│ ├── unveil_openbsd.go
│ ├── xattr_bsd.go
│ ├── zerrors_aix_ppc.go
│ ├── zerrors_aix_ppc64.go
│ ├── zerrors_darwin_amd64.go
│ ├── zerrors_darwin_arm64.go
│ ├── zerrors_dragonfly_amd64.go
│ ├── zerrors_freebsd_386.go
│ ├── zerrors_freebsd_amd64.go
│ ├── zerrors_freebsd_arm.go
│ ├── zerrors_freebsd_arm64.go
│ ├── zerrors_linux.go
│ ├── zerrors_linux_386.go
│ ├── zerrors_linux_amd64.go
│ ├── zerrors_linux_arm.go
│ ├── zerrors_linux_arm64.go
│ ├── zerrors_linux_mips.go
│ ├── zerrors_linux_mips64.go
│ ├── zerrors_linux_mips64le.go
│ ├── zerrors_linux_mipsle.go
│ ├── zerrors_linux_ppc.go
│ ├── zerrors_linux_ppc64.go
│ ├── zerrors_linux_ppc64le.go
│ ├── zerrors_linux_riscv64.go
│ ├── zerrors_linux_s390x.go
│ ├── zerrors_linux_sparc64.go
│ ├── zerrors_netbsd_386.go
│ ├── zerrors_netbsd_amd64.go
│ ├── zerrors_netbsd_arm.go
│ ├── zerrors_netbsd_arm64.go
│ ├── zerrors_openbsd_386.go
│ ├── zerrors_openbsd_amd64.go
│ ├── zerrors_openbsd_arm.go
│ ├── zerrors_openbsd_arm64.go
│ ├── zerrors_openbsd_mips64.go
│ ├── zerrors_solaris_amd64.go
│ ├── zerrors_zos_s390x.go
│ ├── zptrace_armnn_linux.go
│ ├── zptrace_linux_arm64.go
│ ├── zptrace_mipsnn_linux.go
│ ├── zptrace_mipsnnle_linux.go
│ ├── zptrace_x86_linux.go
│ ├── zsyscall_aix_ppc.go
│ ├── zsyscall_aix_ppc64.go
│ ├── zsyscall_aix_ppc64_gc.go
│ ├── zsyscall_aix_ppc64_gccgo.go
│ ├── zsyscall_darwin_amd64.1_13.go
│ ├── zsyscall_darwin_amd64.1_13.s
│ ├── zsyscall_darwin_amd64.go
│ ├── zsyscall_darwin_amd64.s
│ ├── zsyscall_darwin_arm64.1_13.go
│ ├── zsyscall_darwin_arm64.1_13.s
│ ├── zsyscall_darwin_arm64.go
│ ├── zsyscall_darwin_arm64.s
│ ├── zsyscall_dragonfly_amd64.go
│ ├── zsyscall_freebsd_386.go
│ ├── zsyscall_freebsd_amd64.go
│ ├── zsyscall_freebsd_arm.go
│ ├── zsyscall_freebsd_arm64.go
│ ├── zsyscall_illumos_amd64.go
│ ├── zsyscall_linux.go
│ ├── zsyscall_linux_386.go
│ ├── zsyscall_linux_amd64.go
│ ├── zsyscall_linux_arm.go
│ ├── zsyscall_linux_arm64.go
│ ├── zsyscall_linux_mips.go
│ ├── zsyscall_linux_mips64.go
│ ├── zsyscall_linux_mips64le.go
│ ├── zsyscall_linux_mipsle.go
│ ├── zsyscall_linux_ppc.go
│ ├── zsyscall_linux_ppc64.go
│ ├── zsyscall_linux_ppc64le.go
│ ├── zsyscall_linux_riscv64.go
│ ├── zsyscall_linux_s390x.go
│ ├── zsyscall_linux_sparc64.go
│ ├── zsyscall_netbsd_386.go
│ ├── zsyscall_netbsd_amd64.go
│ ├── zsyscall_netbsd_arm.go
│ ├── zsyscall_netbsd_arm64.go
│ ├── zsyscall_openbsd_386.go
│ ├── zsyscall_openbsd_amd64.go
│ ├── zsyscall_openbsd_arm.go
│ ├── zsyscall_openbsd_arm64.go
│ ├── zsyscall_openbsd_mips64.go
│ ├── zsyscall_solaris_amd64.go
│ ├── zsyscall_zos_s390x.go
│ ├── zsysctl_openbsd_386.go
│ ├── zsysctl_openbsd_amd64.go
│ ├── zsysctl_openbsd_arm.go
│ ├── zsysctl_openbsd_arm64.go
│ ├── zsysctl_openbsd_mips64.go
│ ├── zsysnum_darwin_amd64.go
│ ├── zsysnum_darwin_arm64.go
│ ├── zsysnum_dragonfly_amd64.go
│ ├── zsysnum_freebsd_386.go
│ ├── zsysnum_freebsd_amd64.go
│ ├── zsysnum_freebsd_arm.go
│ ├── zsysnum_freebsd_arm64.go
│ ├── zsysnum_linux_386.go
│ ├── zsysnum_linux_amd64.go
│ ├── zsysnum_linux_arm.go
│ ├── zsysnum_linux_arm64.go
│ ├── zsysnum_linux_mips.go
│ ├── zsysnum_linux_mips64.go
│ ├── zsysnum_linux_mips64le.go
│ ├── zsysnum_linux_mipsle.go
│ ├── zsysnum_linux_ppc.go
│ ├── zsysnum_linux_ppc64.go
│ ├── zsysnum_linux_ppc64le.go
│ ├── zsysnum_linux_riscv64.go
│ ├── zsysnum_linux_s390x.go
│ ├── zsysnum_linux_sparc64.go
│ ├── zsysnum_netbsd_386.go
│ ├── zsysnum_netbsd_amd64.go
│ ├── zsysnum_netbsd_arm.go
│ ├── zsysnum_netbsd_arm64.go
│ ├── zsysnum_openbsd_386.go
│ ├── zsysnum_openbsd_amd64.go
│ ├── zsysnum_openbsd_arm.go
│ ├── zsysnum_openbsd_arm64.go
│ ├── zsysnum_openbsd_mips64.go
│ ├── zsysnum_zos_s390x.go
│ ├── ztypes_aix_ppc.go
│ ├── ztypes_aix_ppc64.go
│ ├── ztypes_darwin_amd64.go
│ ├── ztypes_darwin_arm64.go
│ ├── ztypes_dragonfly_amd64.go
│ ├── ztypes_freebsd_386.go
│ ├── ztypes_freebsd_amd64.go
│ ├── ztypes_freebsd_arm.go
│ ├── ztypes_freebsd_arm64.go
│ ├── ztypes_illumos_amd64.go
│ ├── ztypes_linux.go
│ ├── ztypes_linux_386.go
│ ├── ztypes_linux_amd64.go
│ ├── ztypes_linux_arm.go
│ ├── ztypes_linux_arm64.go
│ ├── ztypes_linux_mips.go
│ ├── ztypes_linux_mips64.go
│ ├── ztypes_linux_mips64le.go
│ ├── ztypes_linux_mipsle.go
│ ├── ztypes_linux_ppc.go
│ ├── ztypes_linux_ppc64.go
│ ├── ztypes_linux_ppc64le.go
│ ├── ztypes_linux_riscv64.go
│ ├── ztypes_linux_s390x.go
│ ├── ztypes_linux_sparc64.go
│ ├── ztypes_netbsd_386.go
│ ├── ztypes_netbsd_amd64.go
│ ├── ztypes_netbsd_arm.go
│ ├── ztypes_netbsd_arm64.go
│ ├── ztypes_openbsd_386.go
│ ├── ztypes_openbsd_amd64.go
│ ├── ztypes_openbsd_arm.go
│ ├── ztypes_openbsd_arm64.go
│ ├── ztypes_openbsd_mips64.go
│ ├── ztypes_solaris_amd64.go
│ └── ztypes_zos_s390x.go
│ └── 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
│ ├── setupapi_windows.go
│ ├── str.go
│ ├── syscall.go
│ ├── syscall_windows.go
│ ├── types_windows.go
│ ├── types_windows_386.go
│ ├── types_windows_amd64.go
│ ├── types_windows_arm.go
│ ├── types_windows_arm64.go
│ ├── zerrors_windows.go
│ ├── zknownfolderids_windows.go
│ └── zsyscall_windows.go
├── 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
│ ├── protodesc
│ │ ├── desc.go
│ │ ├── desc_init.go
│ │ ├── desc_resolve.go
│ │ ├── desc_validate.go
│ │ └── proto.go
│ ├── 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
│ ├── descriptorpb
│ └── descriptor.pb.go
│ └── known
│ ├── anypb
│ └── any.pb.go
│ ├── durationpb
│ └── duration.pb.go
│ └── timestamppb
│ └── timestamp.pb.go
├── gopkg.in
└── yaml.v3
│ ├── .travis.yml
│ ├── LICENSE
│ ├── NOTICE
│ ├── README.md
│ ├── apic.go
│ ├── decode.go
│ ├── emitterc.go
│ ├── encode.go
│ ├── parserc.go
│ ├── readerc.go
│ ├── resolve.go
│ ├── scannerc.go
│ ├── sorter.go
│ ├── writerc.go
│ ├── yaml.go
│ ├── yamlh.go
│ └── yamlprivateh.go
└── modules.txt
/.github/workflows/tests.yaml:
--------------------------------------------------------------------------------
1 | name: "Run tests"
2 |
3 | env:
4 | CODECOV_TOKEN: MY_TOKEN
5 | GOPRIVATE: git.colofoo.com
6 |
7 | on:
8 | push:
9 | branches: ["*"]
10 | tags:
11 | - "*"
12 |
13 | jobs:
14 | test:
15 | runs-on: [ self-hosted ]
16 |
17 | services:
18 | mysql:
19 | image: docker.colofoo.com/myorg/mariadb:10.6.4
20 | env:
21 | MYSQL_DATABASE: dbname
22 | MYSQL_USER: dbuser
23 | MYSQL_PASSWORD: dbpass
24 | MYSQL_ROOT_PASSWORD: rootpass
25 | ports:
26 | - 3306:3306
27 | options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
28 |
29 | steps:
30 | - uses: actions/checkout@v2
31 |
32 | - name: Set up Go
33 | uses: actions/setup-go@v2
34 | with:
35 | go-version: 1.18
36 |
37 | - name: Test
38 | run: |
39 | go test -race -coverprofile=coverage.txt -covermode=atomic ./...
40 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Binaries for programs and plugins
2 | *.exe
3 | *.exe~
4 | *.dll
5 | *.so
6 | *.dylib
7 |
8 | # Test binary, build with `go test -c`
9 | *.test
10 |
11 | # Output of the go coverage tool, specifically when used with LiteIDE
12 | *.out
13 |
14 | ./boilerd
15 | *.DS_Store
16 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM docker.mycompany.com/platform/golang:1.18.1
2 |
3 | # @TODO: specify the correct timezone for your service, or remove
4 | ENV TZ America/New_York
5 |
6 | ENV GODEBUG netdns=cgo
7 |
8 | ADD . /go/src/git.mycompany.com/platform/go-boilerplate.git
9 | WORKDIR /go/src/git.mycompany.com/platform/go-boilerplate.git
10 | RUN go install ./...
11 |
12 | CMD ["/go/bin/boilerd"]
13 |
--------------------------------------------------------------------------------
/cmd/boilerd/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "flag"
5 | "log"
6 | "time"
7 |
8 | "net/http"
9 | _ "net/http/pprof"
10 |
11 | "github.com/cogolabs/go-boilerplate/pkg/web"
12 | "github.com/cogolabs/terminator"
13 | )
14 |
15 | const (
16 | maxConns = 20
17 | timeout = time.Second * 30
18 | )
19 |
20 | var (
21 | addr = flag.String("addr", "127.0.0.1:8080", "HTTP bind address")
22 |
23 | shutdownAfter = flag.Duration("shutdownAfter", 12*time.Hour, "Duration to wait before shutting down (with jitter)")
24 | shutdownJitter = flag.Duration("shutdownJitter", 2*time.Hour, "Jitter duration in either direction of shutdownAfter")
25 | )
26 |
27 | func init() {
28 | // TODO: set sane HTTP client defaults that make sense for your service
29 | http.DefaultClient.Timeout = timeout
30 |
31 | http.DefaultTransport.(*http.Transport).MaxConnsPerHost = maxConns
32 | http.DefaultTransport.(*http.Transport).MaxIdleConns = maxConns
33 | http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = maxConns
34 | }
35 |
36 | func main() {
37 | flag.Parse()
38 |
39 | log.Println("starting server")
40 | defer log.Println("server done")
41 |
42 | srv := &http.Server{
43 | Addr: *addr,
44 | Handler: web.NewRouter(),
45 | ReadTimeout: timeout,
46 | WriteTimeout: timeout,
47 | }
48 |
49 | err := terminator.ServeAndShutdownAfter(&terminator.Options{
50 | Server: srv,
51 | ShutdownAfter: *shutdownAfter,
52 | Jitter: *shutdownJitter,
53 | GracefulShutdownPeriod: time.Minute,
54 | })
55 | if err != nil {
56 | log.Fatalf("error in server: %v\n", err)
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/cogolabs/go-boilerplate
2 |
3 | go 1.18
4 |
5 | require (
6 | github.com/cogolabs/terminator v1.0.0
7 | github.com/gorilla/mux v1.8.0
8 | github.com/prometheus/client_golang v1.12.1
9 | github.com/stretchr/testify v1.7.1
10 | )
11 |
12 | require (
13 | github.com/beorn7/perks v1.0.1 // indirect
14 | github.com/cespare/xxhash/v2 v2.1.2 // indirect
15 | github.com/davecgh/go-spew v1.1.1 // indirect
16 | github.com/golang/protobuf v1.5.2 // indirect
17 | github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
18 | github.com/pmezard/go-difflib v1.0.0 // indirect
19 | github.com/prometheus/client_model v0.2.0 // indirect
20 | github.com/prometheus/common v0.32.1 // indirect
21 | github.com/prometheus/procfs v0.7.3 // indirect
22 | golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
23 | google.golang.org/protobuf v1.26.0 // indirect
24 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
25 | )
26 |
--------------------------------------------------------------------------------
/internal/exampleinternal/internal.go:
--------------------------------------------------------------------------------
1 | package exampleinternal
2 |
3 | // InternalType...
4 | type InternalType struct {
5 | Field int
6 | }
7 |
--------------------------------------------------------------------------------
/internal/exampleinternal/internal_test.go:
--------------------------------------------------------------------------------
1 | package exampleinternal
2 |
3 | import "testing"
4 |
5 | // TestInternal is a test for the internal package
6 | func TestInternal(t *testing.T) {
7 | // ...
8 | }
9 |
--------------------------------------------------------------------------------
/pkg/examplepkg/exampletype.go:
--------------------------------------------------------------------------------
1 | package examplepkg
2 |
3 | import "strings"
4 |
5 | // New creates a new instance of MyType and sets the privateVal
6 | func New(val string) *ExampleType {
7 | return &ExampleType{
8 | PublicVal: val,
9 | privateVal: strings.ToLower(val),
10 | }
11 | }
12 |
13 | // MyFunc returns the privateVal up until the specified index
14 | func (et *ExampleType) MyFunc(n int) string {
15 | if n > len(et.privateVal) {
16 | n = len(et.privateVal)
17 | }
18 | return et.privateVal[:n]
19 | }
20 |
--------------------------------------------------------------------------------
/pkg/examplepkg/exampletype_test.go:
--------------------------------------------------------------------------------
1 | package examplepkg
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/stretchr/testify/suite"
7 | )
8 |
9 | var testVal = "FOOBAR"
10 |
11 | type exampletypeSuite struct {
12 | suite.Suite
13 | et *ExampleType
14 | }
15 |
16 | func (s *exampletypeSuite) SetupSuite() {
17 | // Run before the first test
18 | s.et = New(testVal)
19 | }
20 |
21 | func (s *exampletypeSuite) TearDownSuite() {
22 | // Run after the last test
23 | }
24 |
25 | func (s *exampletypeSuite) SetupTest() {
26 | // Run before each test
27 | }
28 |
29 | func (s *exampletypeSuite) TearDownTest() {
30 | // Run after each test
31 | }
32 |
33 | func (s *exampletypeSuite) TestMyFunc() {
34 | // If the following statement fails, the test will end immediately
35 | s.Require().Equal(s.et.PublicVal, testVal)
36 |
37 | tests := []struct {
38 | n int
39 | expected string
40 | }{
41 | {1, "f"},
42 | {3, "foo"},
43 | {1000, "foobar"},
44 | }
45 |
46 | var val string
47 | for _, tt := range tests {
48 | val = s.et.MyFunc(tt.n)
49 | // If the following statement fails, the test will fail, but continue
50 | s.Assert().Equal(val, tt.expected)
51 | }
52 | }
53 |
54 | func TestMyType(t *testing.T) {
55 | tests := new(exampletypeSuite)
56 | suite.Run(t, tests)
57 | }
58 |
--------------------------------------------------------------------------------
/pkg/examplepkg/types.go:
--------------------------------------------------------------------------------
1 | package examplepkg
2 |
3 | // ExampleType is a type that does stuff
4 | type ExampleType struct {
5 | PublicVal string
6 | privateVal string
7 | }
8 |
--------------------------------------------------------------------------------
/pkg/metrics/metrics.go:
--------------------------------------------------------------------------------
1 | package metrics
2 |
3 | import (
4 | "github.com/prometheus/client_golang/prometheus"
5 | "github.com/prometheus/client_golang/prometheus/promauto"
6 | )
7 |
8 | const (
9 | // @TODO: use a specific prometheus namespace to provide unique,
10 | // fully-qualified metric names
11 | namespace = "TODO"
12 | )
13 |
14 | var (
15 | // Health indicates whether the server is alive, accepting requests,
16 | // and is able to successfully operate in a production environment
17 | Health = promauto.NewGaugeVec(
18 | prometheus.GaugeOpts{
19 | Name: "health",
20 | Namespace: namespace,
21 | Help: "Whether or not the server is healthy",
22 | },
23 | []string{"code"},
24 | )
25 | )
26 |
--------------------------------------------------------------------------------
/pkg/web/ping.go:
--------------------------------------------------------------------------------
1 | package web
2 |
3 | import (
4 | "fmt"
5 | "net/http"
6 | )
7 |
8 | // PingHandler always returns 200 OK and is used to test whether or
9 | // not the server is accepting requests
10 | func PingHandler(w http.ResponseWriter, r *http.Request) {
11 | fmt.Fprintf(w, "OK\n")
12 | }
13 |
14 | // HealthHandler is a very simple health check. In production you
15 | // should be running the healthcheck against all external services,
16 | // for example the database, filesystem, cache, etc.
17 | func HealthHandler(w http.ResponseWriter, r *http.Request) {
18 |
19 | // @TODO: Check all downstream services that are required for
20 | // your server to function
21 |
22 | w.Write([]byte("OK\n"))
23 | }
24 |
--------------------------------------------------------------------------------
/pkg/web/ping_test.go:
--------------------------------------------------------------------------------
1 | package web
2 |
3 | import (
4 | "net/http"
5 | "net/http/httptest"
6 | "testing"
7 |
8 | "github.com/stretchr/testify/assert"
9 | )
10 |
11 | func TestHealthCheck(t *testing.T) {
12 | req, err := http.NewRequest("GET", "/health", nil)
13 | assert.Nil(t, err)
14 |
15 | router := NewRouter()
16 | rr := httptest.NewRecorder()
17 | router.ServeHTTP(rr, req)
18 | assert.Equal(t, rr.Code, http.StatusOK)
19 | }
20 |
--------------------------------------------------------------------------------
/pkg/web/router.go:
--------------------------------------------------------------------------------
1 | package web
2 |
3 | import (
4 | "net/http"
5 |
6 | _ "net/http/pprof"
7 |
8 | "github.com/gorilla/mux"
9 | "github.com/prometheus/client_golang/prometheus/promhttp"
10 | )
11 |
12 | // NewRouter instantiates a gorilla mux router and adds all relevant handlers
13 | func NewRouter() *mux.Router {
14 | r := mux.NewRouter()
15 |
16 | // add pprof routes
17 | r.PathPrefix("/debug").Handler(http.DefaultServeMux)
18 |
19 | // add promethus handlers
20 | r.Handle("/metrics", promhttp.Handler())
21 |
22 | // health check handlers
23 | r.HandleFunc("/ping", PingHandler)
24 | r.HandleFunc("/health", HealthHandler)
25 |
26 | // @TODO: Add your routes here...
27 | // r.HandleFunc("/foo", FooHandler)
28 |
29 | return r
30 | }
31 |
--------------------------------------------------------------------------------
/pkg/web/router_test.go:
--------------------------------------------------------------------------------
1 | package web
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/gorilla/mux"
7 | "github.com/stretchr/testify/assert"
8 | )
9 |
10 | func TestNewRouter(t *testing.T) {
11 | r := NewRouter()
12 | called := false
13 | // Ensure that routes exist on the mux router
14 | err := r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
15 | called = true
16 | return nil
17 | })
18 | assert.Nil(t, err)
19 | assert.True(t, called)
20 | }
21 |
--------------------------------------------------------------------------------
/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/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/cogolabs/terminator/README.md:
--------------------------------------------------------------------------------
1 | # Terminator
2 |
3 |
4 |
5 | Library to automatically run and kill HTTP servers at regular intervals. Includes a jitter on the kill interval to ensure that a group of server processes started at roughly the same time don't all go down at once.
6 |
7 | ## Usage:
8 |
9 | ```go
10 | package main
11 |
12 | import (
13 | "flag"
14 | "log"
15 | "net/http"
16 | "time"
17 |
18 | "github.com/cogolabs/terminator"
19 | )
20 |
21 | const (
22 | timeout = 30 * time.Second
23 | )
24 |
25 | var (
26 | shutdownAfter = flag.Duration("shutdownAfter", 12*time.Hour, "Duration to wait before shutting down (with jitter)")
27 | shutdownJitter = flag.Duration("shutdownJitter", 2*time.Hour, "Jitter duration in either direction of shutdownAfter")
28 | )
29 |
30 | func main() {
31 | flag.Parse()
32 |
33 | srv := &http.Server{
34 | Addr: "0.0.0.0:8080",
35 | Handler: nil, // your handler here
36 | ReadTimeout: timeout,
37 | WriteTimeout: timeout,
38 | }
39 |
40 | log.Println("starting server")
41 | err := terminator.ServeAndShutdownAfter(&terminator.Options{
42 | Server: srv,
43 | ShutdownAfter: *shutdownAfter,
44 | Jitter: *shutdownJitter,
45 | GracefulShutdownPeriod: 30 * time.Second,
46 | })
47 | if err != nil {
48 | log.Fatalf("error in server: %v\n", err)
49 | }
50 |
51 | log.Println("server done")
52 | }
53 | ```
54 |
--------------------------------------------------------------------------------
/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/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 | //
7 | // Deprecated: Well-known types have specialized functionality directly
8 | // injected into the generated packages for each message type.
9 | // See the deprecation notice for each function for the suggested alternative.
10 | package ptypes
11 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/mux/AUTHORS:
--------------------------------------------------------------------------------
1 | # This is the official list of gorilla/mux authors for copyright purposes.
2 | #
3 | # Please keep the list sorted.
4 |
5 | Google LLC (https://opensource.google.com/)
6 | Kamil Kisielk
7 | Matt Silverlock
8 | Rodrigo Moraes (https://github.com/moraes)
9 |
--------------------------------------------------------------------------------
/vendor/github.com/gorilla/mux/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012-2018 The Gorilla 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/github.com/gorilla/mux/test_helpers.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Gorilla Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package mux
6 |
7 | import "net/http"
8 |
9 | // SetURLVars sets the URL variables for the given request, to be accessed via
10 | // mux.Vars for testing route behaviour. Arguments are not modified, a shallow
11 | // copy is returned.
12 | //
13 | // This API should only be used for testing purposes; it provides a way to
14 | // inject variables into the request context. Alternatively, URL variables
15 | // can be set by making a route that captures the required variables,
16 | // starting a server and sending the request to that server.
17 | func SetURLVars(r *http.Request, val map[string]string) *http.Request {
18 | return requestWithVars(r, val)
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/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 [](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus).
2 |
--------------------------------------------------------------------------------
/vendor/github.com/prometheus/client_golang/prometheus/build_info_collector.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 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 | import "runtime/debug"
17 |
18 | // NewBuildInfoCollector is the obsolete version of collectors.NewBuildInfoCollector.
19 | // See there for documentation.
20 | //
21 | // Deprecated: Use collectors.NewBuildInfoCollector instead.
22 | func NewBuildInfoCollector() Collector {
23 | path, version, sum := "unknown", "unknown", "unknown"
24 | if bi, ok := debug.ReadBuildInfo(); ok {
25 | path = bi.Main.Path
26 | version = bi.Main.Version
27 | sum = bi.Main.Sum
28 | }
29 | c := &selfCollector{MustNewConstMetric(
30 | NewDesc(
31 | "go_build_info",
32 | "Build information about the main Go module.",
33 | nil, Labels{"path": path, "version": version, "checksum": sum},
34 | ),
35 | GaugeValue, 1)}
36 | c.init(c.self)
37 | return c
38 | }
39 |
--------------------------------------------------------------------------------
/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 | fixtures: fixtures/.unpacked
22 |
23 | update_fixtures:
24 | rm -vf fixtures/.unpacked
25 | ./ttar -c -f fixtures.ttar fixtures/
26 |
27 | .PHONY: build
28 | build:
29 |
30 | .PHONY: test
31 | test: fixtures/.unpacked common-test
32 |
--------------------------------------------------------------------------------
/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/cmdline.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 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 | // CmdLine returns the command line of the kernel.
23 | func (fs FS) CmdLine() ([]string, error) {
24 | data, err := util.ReadFileNoStat(fs.proc.Path("cmdline"))
25 | if err != nil {
26 | return nil, err
27 | }
28 |
29 | return strings.Fields(string(data)), nil
30 | }
31 |
--------------------------------------------------------------------------------
/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.Stat()
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-2020 Mat Ryer, Tyler Bunnell and contributors.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/assert/assertion_compare_can_convert.go:
--------------------------------------------------------------------------------
1 | //go:build go1.17
2 | // +build go1.17
3 |
4 | // TODO: once support for Go 1.16 is dropped, this file can be
5 | // merged/removed with assertion_compare_go1.17_test.go and
6 | // assertion_compare_legacy.go
7 |
8 | package assert
9 |
10 | import "reflect"
11 |
12 | // Wrapper around reflect.Value.CanConvert, for compatability
13 | // reasons.
14 | func canConvert(value reflect.Value, to reflect.Type) bool {
15 | return value.CanConvert(to)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/assert/assertion_compare_legacy.go:
--------------------------------------------------------------------------------
1 | //go:build !go1.17
2 | // +build !go1.17
3 |
4 | // TODO: once support for Go 1.16 is dropped, this file can be
5 | // merged/removed with assertion_compare_go1.17_test.go and
6 | // assertion_compare_can_convert.go
7 |
8 | package assert
9 |
10 | import "reflect"
11 |
12 | // Older versions of Go does not have the reflect.Value.CanConvert
13 | // method.
14 | func canConvert(value reflect.Value, to reflect.Type) bool {
15 | return false
16 | }
17 |
--------------------------------------------------------------------------------
/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 sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs"
17 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/require/doc.go:
--------------------------------------------------------------------------------
1 | // Package require implements the same assertions as the `assert` package but
2 | // stops test execution when a test fails.
3 | //
4 | // Example Usage
5 | //
6 | // The following is a complete example using require in a standard test function:
7 | // import (
8 | // "testing"
9 | // "github.com/stretchr/testify/require"
10 | // )
11 | //
12 | // func TestSomething(t *testing.T) {
13 | //
14 | // var a string = "Hello"
15 | // var b string = "Hello"
16 | //
17 | // require.Equal(t, a, b, "The two words should be the same.")
18 | //
19 | // }
20 | //
21 | // Assertions
22 | //
23 | // The `require` package have same global functions as in the `assert` package,
24 | // but instead of returning a boolean result they call `t.FailNow()`.
25 | //
26 | // Every assertion function also takes an optional string message as the final argument,
27 | // allowing custom error messages to be appended to the message the assertion method outputs.
28 | package require
29 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/require/forward_requirements.go:
--------------------------------------------------------------------------------
1 | package require
2 |
3 | // Assertions provides assertion methods around the
4 | // TestingT interface.
5 | type Assertions struct {
6 | t TestingT
7 | }
8 |
9 | // New makes a new Assertions object for the specified TestingT.
10 | func New(t TestingT) *Assertions {
11 | return &Assertions{
12 | t: t,
13 | }
14 | }
15 |
16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require_forward.go.tmpl -include-format-funcs"
17 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/require/require.go.tmpl:
--------------------------------------------------------------------------------
1 | {{.Comment}}
2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) {
3 | if h, ok := t.(tHelper); ok { h.Helper() }
4 | if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return }
5 | t.FailNow()
6 | }
7 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl:
--------------------------------------------------------------------------------
1 | {{.CommentWithoutT "a"}}
2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) {
3 | if h, ok := a.t.(tHelper); ok { h.Helper() }
4 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}})
5 | }
6 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/require/requirements.go:
--------------------------------------------------------------------------------
1 | package require
2 |
3 | // TestingT is an interface wrapper around *testing.T
4 | type TestingT interface {
5 | Errorf(format string, args ...interface{})
6 | FailNow()
7 | }
8 |
9 | type tHelper interface {
10 | Helper()
11 | }
12 |
13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful
14 | // for table driven tests.
15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{})
16 |
17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful
18 | // for table driven tests.
19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{})
20 |
21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful
22 | // for table driven tests.
23 | type BoolAssertionFunc func(TestingT, bool, ...interface{})
24 |
25 | // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful
26 | // for table driven tests.
27 | type ErrorAssertionFunc func(TestingT, error, ...interface{})
28 |
29 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=require -template=require.go.tmpl -include-format-funcs"
30 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/suite/interfaces.go:
--------------------------------------------------------------------------------
1 | package suite
2 |
3 | import "testing"
4 |
5 | // TestingSuite can store and return the current *testing.T context
6 | // generated by 'go test'.
7 | type TestingSuite interface {
8 | T() *testing.T
9 | SetT(*testing.T)
10 | }
11 |
12 | // SetupAllSuite has a SetupSuite method, which will run before the
13 | // tests in the suite are run.
14 | type SetupAllSuite interface {
15 | SetupSuite()
16 | }
17 |
18 | // SetupTestSuite has a SetupTest method, which will run before each
19 | // test in the suite.
20 | type SetupTestSuite interface {
21 | SetupTest()
22 | }
23 |
24 | // TearDownAllSuite has a TearDownSuite method, which will run after
25 | // all the tests in the suite have been run.
26 | type TearDownAllSuite interface {
27 | TearDownSuite()
28 | }
29 |
30 | // TearDownTestSuite has a TearDownTest method, which will run after
31 | // each test in the suite.
32 | type TearDownTestSuite interface {
33 | TearDownTest()
34 | }
35 |
36 | // BeforeTest has a function to be executed right before the test
37 | // starts and receives the suite and test names as input
38 | type BeforeTest interface {
39 | BeforeTest(suiteName, testName string)
40 | }
41 |
42 | // AfterTest has a function to be executed right after the test
43 | // finishes and receives the suite and test names as input
44 | type AfterTest interface {
45 | AfterTest(suiteName, testName string)
46 | }
47 |
48 | // WithStats implements HandleStats, a function that will be executed
49 | // when a test suite is finished. The stats contain information about
50 | // the execution of that suite and its tests.
51 | type WithStats interface {
52 | HandleStats(suiteName string, stats *SuiteInformation)
53 | }
54 |
--------------------------------------------------------------------------------
/vendor/github.com/stretchr/testify/suite/stats.go:
--------------------------------------------------------------------------------
1 | package suite
2 |
3 | import "time"
4 |
5 | // SuiteInformation stats stores stats for the whole suite execution.
6 | type SuiteInformation struct {
7 | Start, End time.Time
8 | TestStats map[string]*TestInformation
9 | }
10 |
11 | // TestInformation stores information about the execution of each test.
12 | type TestInformation struct {
13 | TestName string
14 | Start, End time.Time
15 | Passed bool
16 | }
17 |
18 | func newSuiteInformation() *SuiteInformation {
19 | testStats := make(map[string]*TestInformation)
20 |
21 | return &SuiteInformation{
22 | TestStats: testStats,
23 | }
24 | }
25 |
26 | func (s SuiteInformation) start(testName string) {
27 | s.TestStats[testName] = &TestInformation{
28 | TestName: testName,
29 | Start: time.Now(),
30 | }
31 | }
32 |
33 | func (s SuiteInformation) end(testName string, passed bool) {
34 | s.TestStats[testName].End = time.Now()
35 | s.TestStats[testName].Passed = passed
36 | }
37 |
38 | func (s SuiteInformation) Passed() bool {
39 | for _, stats := range s.TestStats {
40 | if !stats.Passed {
41 | return false
42 | }
43 | }
44 |
45 | return true
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package unsafeheader contains header declarations for the Go runtime's
6 | // slice and string implementations.
7 | //
8 | // This package allows x/sys to use types equivalent to
9 | // reflect.SliceHeader and reflect.StringHeader without introducing
10 | // a dependency on the (relatively heavy) "reflect" package.
11 | package unsafeheader
12 |
13 | import (
14 | "unsafe"
15 | )
16 |
17 | // Slice is the runtime representation of a slice.
18 | // It cannot be used safely or portably and its representation may change in a later release.
19 | type Slice struct {
20 | Data unsafe.Pointer
21 | Len int
22 | Cap int
23 | }
24 |
25 | // String is the runtime representation of a string.
26 | // It cannot be used safely or portably and its representation may change in a later release.
27 | type String struct {
28 | Data unsafe.Pointer
29 | Len int
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/.gitignore:
--------------------------------------------------------------------------------
1 | _obj/
2 | unix.test
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/aliases.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 | // +build go1.9
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | type Signal = syscall.Signal
14 | type Errno = syscall.Errno
15 | type SysProcAttr = syscall.SysProcAttr
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go
12 | //
13 |
14 | TEXT ·syscall6(SB),NOSPLIT,$0-88
15 | JMP syscall·syscall6(SB)
16 |
17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88
18 | JMP syscall·rawSyscall6(SB)
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (freebsd || netbsd || openbsd) && gc
6 | // +build freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for 386 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
6 | // +build darwin dragonfly freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for AMD64 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (freebsd || netbsd || openbsd) && gc
6 | // +build freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for ARM BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc
6 | // +build darwin freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for ARM64 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for 386, Linux
12 | //
13 |
14 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
15 | // instead of the glibc-specific "CALL 0x10(GS)".
16 | #define INVOKE_SYSCALL INT $0x80
17 |
18 | // Just jump to package syscall's implementation for all these functions.
19 | // The runtime may know about them.
20 |
21 | TEXT ·Syscall(SB),NOSPLIT,$0-28
22 | JMP syscall·Syscall(SB)
23 |
24 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
25 | JMP syscall·Syscall6(SB)
26 |
27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
28 | CALL runtime·entersyscall(SB)
29 | MOVL trap+0(FP), AX // syscall entry
30 | MOVL a1+4(FP), BX
31 | MOVL a2+8(FP), CX
32 | MOVL a3+12(FP), DX
33 | MOVL $0, SI
34 | MOVL $0, DI
35 | INVOKE_SYSCALL
36 | MOVL AX, r1+16(FP)
37 | MOVL DX, r2+20(FP)
38 | CALL runtime·exitsyscall(SB)
39 | RET
40 |
41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
42 | JMP syscall·RawSyscall(SB)
43 |
44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
45 | JMP syscall·RawSyscall6(SB)
46 |
47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
48 | MOVL trap+0(FP), AX // syscall entry
49 | MOVL a1+4(FP), BX
50 | MOVL a2+8(FP), CX
51 | MOVL a3+12(FP), DX
52 | MOVL $0, SI
53 | MOVL $0, DI
54 | INVOKE_SYSCALL
55 | MOVL AX, r1+16(FP)
56 | MOVL DX, r2+20(FP)
57 | RET
58 |
59 | TEXT ·socketcall(SB),NOSPLIT,$0-36
60 | JMP syscall·socketcall(SB)
61 |
62 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
63 | JMP syscall·rawsocketcall(SB)
64 |
65 | TEXT ·seek(SB),NOSPLIT,$0-28
66 | JMP syscall·seek(SB)
67 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for AMD64, Linux
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
24 | CALL runtime·entersyscall(SB)
25 | MOVQ a1+8(FP), DI
26 | MOVQ a2+16(FP), SI
27 | MOVQ a3+24(FP), DX
28 | MOVQ $0, R10
29 | MOVQ $0, R8
30 | MOVQ $0, R9
31 | MOVQ trap+0(FP), AX // syscall entry
32 | SYSCALL
33 | MOVQ AX, r1+32(FP)
34 | MOVQ DX, r2+40(FP)
35 | CALL runtime·exitsyscall(SB)
36 | RET
37 |
38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
39 | JMP syscall·RawSyscall(SB)
40 |
41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
42 | JMP syscall·RawSyscall6(SB)
43 |
44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
45 | MOVQ a1+8(FP), DI
46 | MOVQ a2+16(FP), SI
47 | MOVQ a3+24(FP), DX
48 | MOVQ $0, R10
49 | MOVQ $0, R8
50 | MOVQ $0, R9
51 | MOVQ trap+0(FP), AX // syscall entry
52 | SYSCALL
53 | MOVQ AX, r1+32(FP)
54 | MOVQ DX, r2+40(FP)
55 | RET
56 |
57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16
58 | JMP syscall·gettimeofday(SB)
59 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for arm, Linux
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-28
18 | B syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
21 | B syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
24 | BL runtime·entersyscall(SB)
25 | MOVW trap+0(FP), R7
26 | MOVW a1+4(FP), R0
27 | MOVW a2+8(FP), R1
28 | MOVW a3+12(FP), R2
29 | MOVW $0, R3
30 | MOVW $0, R4
31 | MOVW $0, R5
32 | SWI $0
33 | MOVW R0, r1+16(FP)
34 | MOVW $0, R0
35 | MOVW R0, r2+20(FP)
36 | BL runtime·exitsyscall(SB)
37 | RET
38 |
39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
40 | B syscall·RawSyscall(SB)
41 |
42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
43 | B syscall·RawSyscall6(SB)
44 |
45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
46 | MOVW trap+0(FP), R7 // syscall entry
47 | MOVW a1+4(FP), R0
48 | MOVW a2+8(FP), R1
49 | MOVW a3+12(FP), R2
50 | SWI $0
51 | MOVW R0, r1+16(FP)
52 | MOVW $0, R0
53 | MOVW R0, r2+20(FP)
54 | RET
55 |
56 | TEXT ·seek(SB),NOSPLIT,$0-28
57 | B syscall·seek(SB)
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && arm64 && gc
6 | // +build linux
7 | // +build arm64
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | // Just jump to package syscall's implementation for all these functions.
13 | // The runtime may know about them.
14 |
15 | TEXT ·Syscall(SB),NOSPLIT,$0-56
16 | B syscall·Syscall(SB)
17 |
18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
19 | B syscall·Syscall6(SB)
20 |
21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
22 | BL runtime·entersyscall(SB)
23 | MOVD a1+8(FP), R0
24 | MOVD a2+16(FP), R1
25 | MOVD a3+24(FP), R2
26 | MOVD $0, R3
27 | MOVD $0, R4
28 | MOVD $0, R5
29 | MOVD trap+0(FP), R8 // syscall entry
30 | SVC
31 | MOVD R0, r1+32(FP) // r1
32 | MOVD R1, r2+40(FP) // r2
33 | BL runtime·exitsyscall(SB)
34 | RET
35 |
36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
37 | B syscall·RawSyscall(SB)
38 |
39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
40 | B syscall·RawSyscall6(SB)
41 |
42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
43 | MOVD a1+8(FP), R0
44 | MOVD a2+16(FP), R1
45 | MOVD a3+24(FP), R2
46 | MOVD $0, R3
47 | MOVD $0, R4
48 | MOVD $0, R5
49 | MOVD trap+0(FP), R8 // syscall entry
50 | SVC
51 | MOVD R0, r1+32(FP)
52 | MOVD R1, r2+40(FP)
53 | RET
54 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (mips64 || mips64le) && gc
6 | // +build linux
7 | // +build mips64 mips64le
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for mips64, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-56
20 | JMP syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
23 | JMP syscall·Syscall6(SB)
24 |
25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
26 | JAL runtime·entersyscall(SB)
27 | MOVV a1+8(FP), R4
28 | MOVV a2+16(FP), R5
29 | MOVV a3+24(FP), R6
30 | MOVV R0, R7
31 | MOVV R0, R8
32 | MOVV R0, R9
33 | MOVV trap+0(FP), R2 // syscall entry
34 | SYSCALL
35 | MOVV R2, r1+32(FP)
36 | MOVV R3, r2+40(FP)
37 | JAL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
41 | JMP syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
44 | JMP syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
47 | MOVV a1+8(FP), R4
48 | MOVV a2+16(FP), R5
49 | MOVV a3+24(FP), R6
50 | MOVV R0, R7
51 | MOVV R0, R8
52 | MOVV R0, R9
53 | MOVV trap+0(FP), R2 // syscall entry
54 | SYSCALL
55 | MOVV R2, r1+32(FP)
56 | MOVV R3, r2+40(FP)
57 | RET
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (mips || mipsle) && gc
6 | // +build linux
7 | // +build mips mipsle
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for mips, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-28
20 | JMP syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
23 | JMP syscall·Syscall6(SB)
24 |
25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
26 | JMP syscall·Syscall9(SB)
27 |
28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
29 | JAL runtime·entersyscall(SB)
30 | MOVW a1+4(FP), R4
31 | MOVW a2+8(FP), R5
32 | MOVW a3+12(FP), R6
33 | MOVW R0, R7
34 | MOVW trap+0(FP), R2 // syscall entry
35 | SYSCALL
36 | MOVW R2, r1+16(FP) // r1
37 | MOVW R3, r2+20(FP) // r2
38 | JAL runtime·exitsyscall(SB)
39 | RET
40 |
41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
42 | JMP syscall·RawSyscall(SB)
43 |
44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
45 | JMP syscall·RawSyscall6(SB)
46 |
47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
48 | MOVW a1+4(FP), R4
49 | MOVW a2+8(FP), R5
50 | MOVW a3+12(FP), R6
51 | MOVW trap+0(FP), R2 // syscall entry
52 | SYSCALL
53 | MOVW R2, r1+16(FP)
54 | MOVW R3, r2+20(FP)
55 | RET
56 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (ppc64 || ppc64le) && gc
6 | // +build linux
7 | // +build ppc64 ppc64le
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for ppc64, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
20 | BL runtime·entersyscall(SB)
21 | MOVD a1+8(FP), R3
22 | MOVD a2+16(FP), R4
23 | MOVD a3+24(FP), R5
24 | MOVD R0, R6
25 | MOVD R0, R7
26 | MOVD R0, R8
27 | MOVD trap+0(FP), R9 // syscall entry
28 | SYSCALL R9
29 | MOVD R3, r1+32(FP)
30 | MOVD R4, r2+40(FP)
31 | BL runtime·exitsyscall(SB)
32 | RET
33 |
34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
35 | MOVD a1+8(FP), R3
36 | MOVD a2+16(FP), R4
37 | MOVD a3+24(FP), R5
38 | MOVD R0, R6
39 | MOVD R0, R7
40 | MOVD R0, R8
41 | MOVD trap+0(FP), R9 // syscall entry
42 | SYSCALL R9
43 | MOVD R3, r1+32(FP)
44 | MOVD R4, r2+40(FP)
45 | RET
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build riscv64 && gc
6 | // +build riscv64
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for linux/riscv64.
13 | //
14 | // Where available, just jump to package syscall's implementation of
15 | // these functions.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
24 | CALL runtime·entersyscall(SB)
25 | MOV a1+8(FP), A0
26 | MOV a2+16(FP), A1
27 | MOV a3+24(FP), A2
28 | MOV trap+0(FP), A7 // syscall entry
29 | ECALL
30 | MOV A0, r1+32(FP) // r1
31 | MOV A1, r2+40(FP) // r2
32 | CALL runtime·exitsyscall(SB)
33 | RET
34 |
35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
36 | JMP syscall·RawSyscall(SB)
37 |
38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
39 | JMP syscall·RawSyscall6(SB)
40 |
41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
42 | MOV a1+8(FP), A0
43 | MOV a2+16(FP), A1
44 | MOV a3+24(FP), A2
45 | MOV trap+0(FP), A7 // syscall entry
46 | ECALL
47 | MOV A0, r1+32(FP)
48 | MOV A1, r2+40(FP)
49 | RET
50 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_s390x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && s390x && gc
6 | // +build linux
7 | // +build s390x
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for s390x, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-56
20 | BR syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
23 | BR syscall·Syscall6(SB)
24 |
25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
26 | BL runtime·entersyscall(SB)
27 | MOVD a1+8(FP), R2
28 | MOVD a2+16(FP), R3
29 | MOVD a3+24(FP), R4
30 | MOVD $0, R5
31 | MOVD $0, R6
32 | MOVD $0, R7
33 | MOVD trap+0(FP), R1 // syscall entry
34 | SYSCALL
35 | MOVD R2, r1+32(FP)
36 | MOVD R3, r2+40(FP)
37 | BL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
41 | BR syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
44 | BR syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
47 | MOVD a1+8(FP), R2
48 | MOVD a2+16(FP), R3
49 | MOVD a3+24(FP), R4
50 | MOVD $0, R5
51 | MOVD $0, R6
52 | MOVD $0, R7
53 | MOVD trap+0(FP), R1 // syscall entry
54 | SYSCALL
55 | MOVD R2, r1+32(FP)
56 | MOVD R3, r2+40(FP)
57 | RET
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System call support for mips64, OpenBSD
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
24 | JMP syscall·Syscall9(SB)
25 |
26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
27 | JMP syscall·RawSyscall(SB)
28 |
29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
30 | JMP syscall·RawSyscall6(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
12 | //
13 |
14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88
15 | JMP syscall·sysvicall6(SB)
16 |
17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
18 | JMP syscall·rawSysvicall6(SB)
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/bluetooth_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Bluetooth sockets and messages
6 |
7 | package unix
8 |
9 | // Bluetooth Protocols
10 | const (
11 | BTPROTO_L2CAP = 0
12 | BTPROTO_HCI = 1
13 | BTPROTO_SCO = 2
14 | BTPROTO_RFCOMM = 3
15 | BTPROTO_BNEP = 4
16 | BTPROTO_CMTP = 5
17 | BTPROTO_HIDP = 6
18 | BTPROTO_AVDTP = 7
19 | )
20 |
21 | const (
22 | HCI_CHANNEL_RAW = 0
23 | HCI_CHANNEL_USER = 1
24 | HCI_CHANNEL_MONITOR = 2
25 | HCI_CHANNEL_CONTROL = 3
26 | HCI_CHANNEL_LOGGING = 4
27 | )
28 |
29 | // Socketoption Level
30 | const (
31 | SOL_BLUETOOTH = 0x112
32 | SOL_HCI = 0x0
33 | SOL_L2CAP = 0x6
34 | SOL_RFCOMM = 0x12
35 | SOL_SCO = 0x11
36 | )
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/constants.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | const (
11 | R_OK = 0x4
12 | W_OK = 0x2
13 | X_OK = 0x1
14 | )
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc
6 | // +build aix,ppc
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev >> 16) & 0xffff)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32(dev & 0xffff)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | return uint64(((major) << 16) | (minor))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc64
6 | // +build aix,ppc64
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev & 0x3fffffff00000000) >> 32)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32((dev & 0x00000000ffffffff) >> 0)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | var DEVNO64 uint64
27 | DEVNO64 = 0x8000000000000000
28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Darwin's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a Darwin device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev >> 24) & 0xff)
13 | }
14 |
15 | // Minor returns the minor component of a Darwin device number.
16 | func Minor(dev uint64) uint32 {
17 | return uint32(dev & 0xffffff)
18 | }
19 |
20 | // Mkdev returns a Darwin device number generated from the given major and minor
21 | // components.
22 | func Mkdev(major, minor uint32) uint64 {
23 | return (uint64(major) << 24) | uint64(minor)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Dragonfly's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a DragonFlyBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a DragonFlyBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_freebsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in FreeBSD's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a FreeBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a FreeBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a FreeBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used by the Linux kernel and glibc.
7 | //
8 | // The information below is extracted and adapted from bits/sysmacros.h in the
9 | // glibc sources:
10 | //
11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
13 | // number and m is a hex digit of the minor number. This is backward compatible
14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
15 | // backward compatible with the Linux kernel, which for some architectures uses
16 | // 32-bit dev_t, encoded as mmmM MMmm.
17 |
18 | package unix
19 |
20 | // Major returns the major component of a Linux device number.
21 | func Major(dev uint64) uint32 {
22 | major := uint32((dev & 0x00000000000fff00) >> 8)
23 | major |= uint32((dev & 0xfffff00000000000) >> 32)
24 | return major
25 | }
26 |
27 | // Minor returns the minor component of a Linux device number.
28 | func Minor(dev uint64) uint32 {
29 | minor := uint32((dev & 0x00000000000000ff) >> 0)
30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12)
31 | return minor
32 | }
33 |
34 | // Mkdev returns a Linux device number generated from the given major and minor
35 | // components.
36 | func Mkdev(major, minor uint32) uint64 {
37 | dev := (uint64(major) & 0x00000fff) << 8
38 | dev |= (uint64(major) & 0xfffff000) << 32
39 | dev |= (uint64(minor) & 0x000000ff) << 0
40 | dev |= (uint64(minor) & 0xffffff00) << 12
41 | return dev
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_netbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in NetBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a NetBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x000fff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of a NetBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xfff00000) >> 12)
19 | return minor
20 | }
21 |
22 | // Mkdev returns a NetBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x000fff00
26 | dev |= (uint64(minor) << 12) & 0xfff00000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in OpenBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of an OpenBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x0000ff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of an OpenBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xffff0000) >> 8)
19 | return minor
20 | }
21 |
22 | // Mkdev returns an OpenBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x0000ff00
26 | dev |= (uint64(minor) << 8) & 0xffff0000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_zos.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build zos && s390x
6 | // +build zos,s390x
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by z/OS.
10 | //
11 | // The information below is extracted and adapted from macros.
12 |
13 | package unix
14 |
15 | // Major returns the major component of a z/OS device number.
16 | func Major(dev uint64) uint32 {
17 | return uint32((dev >> 16) & 0x0000FFFF)
18 | }
19 |
20 | // Minor returns the minor component of a z/OS device number.
21 | func Minor(dev uint64) uint32 {
22 | return uint32(dev & 0x0000FFFF)
23 | }
24 |
25 | // Mkdev returns a z/OS device number generated from the given major and minor
26 | // components.
27 | func Mkdev(major, minor uint32) uint64 {
28 | return (uint64(major) << 16) | uint64(minor)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_big.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
7 |
8 | package unix
9 |
10 | const isBigEndian = true
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_little.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
6 | // +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
7 |
8 | package unix
9 |
10 | const isBigEndian = false
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/env_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | // Unix environment variables.
9 |
10 | package unix
11 |
12 | import "syscall"
13 |
14 | func Getenv(key string) (value string, found bool) {
15 | return syscall.Getenv(key)
16 | }
17 |
18 | func Setenv(key, value string) error {
19 | return syscall.Setenv(key, value)
20 | }
21 |
22 | func Clearenv() {
23 | syscall.Clearenv()
24 | }
25 |
26 | func Environ() []string {
27 | return syscall.Environ()
28 | }
29 |
30 | func Unsetenv(key string) error {
31 | return syscall.Unsetenv(key)
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
6 | // them here for backwards compatibility.
7 |
8 | package unix
9 |
10 | const (
11 | DLT_HHDLC = 0x79
12 | IPV6_MIN_MEMBERSHIPS = 0x1f
13 | IP_MAX_SOURCE_FILTER = 0x400
14 | IP_MIN_MEMBERSHIPS = 0x1f
15 | RT_CACHING_CONTEXT = 0x1
16 | RT_NORTREF = 0x2
17 | )
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd
6 | // +build dragonfly freebsd linux netbsd openbsd
7 |
8 | package unix
9 |
10 | import "unsafe"
11 |
12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64.
14 | var fcntl64Syscall uintptr = SYS_FCNTL
15 |
16 | func fcntl(fd int, cmd, arg int) (int, error) {
17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg))
18 | var err error
19 | if errno != 0 {
20 | err = errno
21 | }
22 | return int(valptr), err
23 | }
24 |
25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
27 | return fcntl(int(fd), cmd, arg)
28 | }
29 |
30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
33 | if errno == 0 {
34 | return nil
35 | }
36 | return errno
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import "unsafe"
8 |
9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
11 | return fcntl(int(fd), cmd, arg)
12 | }
13 |
14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
17 | return err
18 | }
19 |
20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command.
21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error {
22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore))))
23 | return err
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc
7 |
8 | package unix
9 |
10 | func init() {
11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's
12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
13 | fcntl64Syscall = SYS_FCNTL64
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fdset.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | // Set adds fd to the set fds.
11 | func (fds *FdSet) Set(fd int) {
12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS))
13 | }
14 |
15 | // Clear removes fd from the set fds.
16 | func (fds *FdSet) Clear(fd int) {
17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS))
18 | }
19 |
20 | // IsSet returns whether fd is in the set fds.
21 | func (fds *FdSet) IsSet(fd int) bool {
22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0
23 | }
24 |
25 | // Zero clears the set fds.
26 | func (fds *FdSet) Zero() {
27 | for i := range fds.Bits {
28 | fds.Bits[i] = 0
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_c.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 | // +build !aix
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | #define _STRINGIFY2_(x) #x
13 | #define _STRINGIFY_(x) _STRINGIFY2_(x)
14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
15 |
16 | // Call syscall from C code because the gccgo support for calling from
17 | // Go to C does not support varargs functions.
18 |
19 | struct ret {
20 | uintptr_t r;
21 | uintptr_t err;
22 | };
23 |
24 | struct ret gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
25 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall");
26 |
27 | struct ret
28 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
29 | {
30 | struct ret r;
31 |
32 | errno = 0;
33 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
34 | r.err = errno;
35 | return r;
36 | }
37 |
38 | uintptr_t gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
39 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError");
40 |
41 | uintptr_t
42 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
43 | {
44 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gccgo && linux && amd64
6 | // +build gccgo,linux,amd64
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | //extern gettimeofday
13 | func realGettimeofday(*Timeval, *byte) int32
14 |
15 | func gettimeofday(tv *Timeval) (err syscall.Errno) {
16 | r := realGettimeofday(tv, nil)
17 | if r < 0 {
18 | return syscall.GetErrno()
19 | }
20 | return 0
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/pagesize_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
7 |
8 | // For Unix, get the pagesize from the runtime.
9 |
10 | package unix
11 |
12 | import "syscall"
13 |
14 | func Getpagesize() int {
15 | return syscall.Getpagesize()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ptrace_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && !ios
6 | // +build darwin,!ios
7 |
8 | package unix
9 |
10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error {
11 | return ptrace1(request, pid, addr, data)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ptrace_ios.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build ios
6 | // +build ios
7 |
8 | package unix
9 |
10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
11 | return ENOTSUP
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin && race) || (linux && race) || (freebsd && race)
6 | // +build darwin,race linux,race freebsd,race
7 |
8 | package unix
9 |
10 | import (
11 | "runtime"
12 | "unsafe"
13 | )
14 |
15 | const raceenabled = true
16 |
17 | func raceAcquire(addr unsafe.Pointer) {
18 | runtime.RaceAcquire(addr)
19 | }
20 |
21 | func raceReleaseMerge(addr unsafe.Pointer) {
22 | runtime.RaceReleaseMerge(addr)
23 | }
24 |
25 | func raceReadRange(addr unsafe.Pointer, len int) {
26 | runtime.RaceReadRange(addr, len)
27 | }
28 |
29 | func raceWriteRange(addr unsafe.Pointer, len int) {
30 | runtime.RaceWriteRange(addr, len)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos
7 |
8 | package unix
9 |
10 | import (
11 | "unsafe"
12 | )
13 |
14 | const raceenabled = false
15 |
16 | func raceAcquire(addr unsafe.Pointer) {
17 | }
18 |
19 | func raceReleaseMerge(addr unsafe.Pointer) {
20 | }
21 |
22 | func raceReadRange(addr unsafe.Pointer, len int) {
23 | }
24 |
25 | func raceWriteRange(addr unsafe.Pointer, len int) {
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdents.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
6 | // +build aix dragonfly freebsd linux netbsd openbsd
7 |
8 | package unix
9 |
10 | // ReadDirent reads directory entries from fd and writes them into buf.
11 | func ReadDirent(fd int, buf []byte) (n int, err error) {
12 | return Getdents(fd, buf)
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin
6 | // +build darwin
7 |
8 | package unix
9 |
10 | import "unsafe"
11 |
12 | // ReadDirent reads directory entries from fd and writes them into buf.
13 | func ReadDirent(fd int, buf []byte) (n int, err error) {
14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil.
15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the
16 | // actual system call is getdirentries64, 64 is a good guess.
17 | // TODO(rsc): Can we use a single global basep for all calls?
18 | var base = (*uintptr)(unsafe.Pointer(new(uint64)))
19 | return Getdirentries(fd, buf, base)
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | // Round the length of a raw sockaddr up to align it properly.
8 | func cmsgAlignOf(salen int) int {
9 | salign := SizeofPtr
10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires
12 | // 32-bit aligned access to network subsystem.
13 | salign = 4
14 | }
15 | return (salen + salign - 1) & ^(salign - 1)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | import (
11 | "runtime"
12 | )
13 |
14 | // Round the length of a raw sockaddr up to align it properly.
15 | func cmsgAlignOf(salen int) int {
16 | salign := SizeofPtr
17 |
18 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in
19 | // sockcmsg_dragonfly.go
20 | switch runtime.GOOS {
21 | case "aix":
22 | // There is no alignment on AIX.
23 | salign = 1
24 | case "darwin", "ios", "illumos", "solaris":
25 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
26 | // kernels still require 32-bit aligned access to network
27 | // subsystem.
28 | if SizeofPtr == 8 {
29 | salign = 4
30 | }
31 | case "netbsd", "openbsd":
32 | // NetBSD and OpenBSD armv7 require 64-bit alignment.
33 | if runtime.GOARCH == "arm" {
34 | salign = 8
35 | }
36 | // NetBSD aarch64 requires 128-bit alignment.
37 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" {
38 | salign = 16
39 | }
40 | case "zos":
41 | // z/OS socket macros use [32-bit] sizeof(int) alignment,
42 | // not pointer width.
43 | salign = SizeofInt
44 | }
45 |
46 | return (salen + salign - 1) & ^(salign - 1)
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
7 |
8 | package unix
9 |
10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
11 | if val < 0 {
12 | return "-" + uitoa(uint(-val))
13 | }
14 | return uitoa(uint(val))
15 | }
16 |
17 | func uitoa(val uint) string {
18 | var buf [32]byte // big enough for int64
19 | i := len(buf) - 1
20 | for val >= 10 {
21 | buf[i] = byte(val%10 + '0')
22 | i--
23 | val /= 10
24 | }
25 | buf[i] = byte(val + '0')
26 | return string(buf[i:])
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc
6 | // +build aix,ppc
7 |
8 | package unix
9 |
10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
13 |
14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
15 |
16 | func setTimespec(sec, nsec int64) Timespec {
17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
18 | }
19 |
20 | func setTimeval(sec, usec int64) Timeval {
21 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func Fstat(fd int, stat *Stat_t) error {
41 | return fstat(fd, stat)
42 | }
43 |
44 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error {
45 | return fstatat(dirfd, path, stat, flags)
46 | }
47 |
48 | func Lstat(path string, stat *Stat_t) error {
49 | return lstat(path, stat)
50 | }
51 |
52 | func Stat(path string, statptr *Stat_t) error {
53 | return stat(path, statptr)
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && go1.12 && !go1.13
6 | // +build darwin,go1.12,!go1.13
7 |
8 | package unix
9 |
10 | import (
11 | "unsafe"
12 | )
13 |
14 | const _SYS_GETDIRENTRIES64 = 344
15 |
16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
17 | // To implement this using libSystem we'd need syscall_syscallPtr for
18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
19 | // back to raw syscalls for this func on Go 1.12.
20 | var p unsafe.Pointer
21 | if len(buf) > 0 {
22 | p = unsafe.Pointer(&buf[0])
23 | } else {
24 | p = unsafe.Pointer(&_zero)
25 | }
26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
27 | n = int(r0)
28 | if e1 != 0 {
29 | return n, errnoErr(e1)
30 | }
31 | return n, nil
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_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/sysvshm_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux
6 | // +build linux
7 |
8 | package unix
9 |
10 | import "runtime"
11 |
12 | // SysvShmCtl performs control operations on the shared memory segment
13 | // specified by id.
14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
15 | if runtime.GOARCH == "arm" ||
16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" {
17 | cmd |= ipc_64
18 | }
19 |
20 | return shmctl(id, cmd, desc)
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && !ios
6 | // +build darwin,!ios
7 |
8 | package unix
9 |
10 | // SysvShmCtl performs control operations on the shared memory segment
11 | // specified by id.
12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
13 | return shmctl(id, cmd, desc)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/unveil_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import (
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | // Unveil implements the unveil syscall.
13 | // For more information see unveil(2).
14 | // Note that the special case of blocking further
15 | // unveil calls is handled by UnveilBlock.
16 | func Unveil(path string, flags string) error {
17 | pathPtr, err := syscall.BytePtrFromString(path)
18 | if err != nil {
19 | return err
20 | }
21 | flagsPtr, err := syscall.BytePtrFromString(flags)
22 | if err != nil {
23 | return err
24 | }
25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0)
26 | if e != 0 {
27 | return e
28 | }
29 | return nil
30 | }
31 |
32 | // UnveilBlock blocks future unveil calls.
33 | // For more information see unveil(2).
34 | func UnveilBlock() error {
35 | // Both pointers must be nil.
36 | var pathUnsafe, flagsUnsafe unsafe.Pointer
37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0)
38 | if e != 0 {
39 | return e
40 | }
41 | return nil
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT.
2 |
3 | //go:build linux && (arm || arm64)
4 | // +build linux
5 | // +build arm arm64
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsArm is the registers used by arm binaries.
12 | type PtraceRegsArm struct {
13 | Uregs [18]uint32
14 | }
15 |
16 | // PtraceGetRegsArm fetches the registers used by arm binaries.
17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
19 | }
20 |
21 | // PtraceSetRegsArm sets the registers used by arm binaries.
22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
24 | }
25 |
26 | // PtraceRegsArm64 is the registers used by arm64 binaries.
27 | type PtraceRegsArm64 struct {
28 | Regs [31]uint64
29 | Sp uint64
30 | Pc uint64
31 | Pstate uint64
32 | }
33 |
34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
37 | }
38 |
39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries.
40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
2 |
3 | package unix
4 |
5 | import "unsafe"
6 |
7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
11 | }
12 |
13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT.
2 |
3 | //go:build linux && (mips || mips64)
4 | // +build linux
5 | // +build mips mips64
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsMips is the registers used by mips binaries.
12 | type PtraceRegsMips struct {
13 | Regs [32]uint64
14 | Lo uint64
15 | Hi uint64
16 | Epc uint64
17 | Badvaddr uint64
18 | Status uint64
19 | Cause uint64
20 | }
21 |
22 | // PtraceGetRegsMips fetches the registers used by mips binaries.
23 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
25 | }
26 |
27 | // PtraceSetRegsMips sets the registers used by mips binaries.
28 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
30 | }
31 |
32 | // PtraceRegsMips64 is the registers used by mips64 binaries.
33 | type PtraceRegsMips64 struct {
34 | Regs [32]uint64
35 | Lo uint64
36 | Hi uint64
37 | Epc uint64
38 | Badvaddr uint64
39 | Status uint64
40 | Cause uint64
41 | }
42 |
43 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
44 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
46 | }
47 |
48 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries.
49 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT.
2 |
3 | //go:build linux && (mipsle || mips64le)
4 | // +build linux
5 | // +build mipsle mips64le
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsMipsle is the registers used by mipsle binaries.
12 | type PtraceRegsMipsle struct {
13 | Regs [32]uint64
14 | Lo uint64
15 | Hi uint64
16 | Epc uint64
17 | Badvaddr uint64
18 | Status uint64
19 | Cause uint64
20 | }
21 |
22 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
23 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
25 | }
26 |
27 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries.
28 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
30 | }
31 |
32 | // PtraceRegsMips64le is the registers used by mips64le binaries.
33 | type PtraceRegsMips64le struct {
34 | Regs [32]uint64
35 | Lo uint64
36 | Hi uint64
37 | Epc uint64
38 | Badvaddr uint64
39 | Status uint64
40 | Cause uint64
41 | }
42 |
43 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
44 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
46 | }
47 |
48 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries.
49 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build darwin && amd64 && go1.13
5 | // +build darwin,amd64,go1.13
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | var _ syscall.Errno
15 |
16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
17 |
18 | func closedir(dir uintptr) (err error) {
19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
20 | if e1 != 0 {
21 | err = errnoErr(e1)
22 | }
23 | return
24 | }
25 |
26 | var libc_closedir_trampoline_addr uintptr
27 |
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | var libc_readdir_r_trampoline_addr uintptr
39 |
40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go amd64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | //go:build go1.13
5 | // +build go1.13
6 |
7 | #include "textflag.h"
8 |
9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
10 | JMP libc_fdopendir(SB)
11 |
12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
14 |
15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
16 | JMP libc_closedir(SB)
17 |
18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
20 |
21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
22 | JMP libc_readdir_r(SB)
23 |
24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build darwin && arm64 && go1.13
5 | // +build darwin,arm64,go1.13
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | var _ syscall.Errno
15 |
16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
17 |
18 | func closedir(dir uintptr) (err error) {
19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
20 | if e1 != 0 {
21 | err = errnoErr(e1)
22 | }
23 | return
24 | }
25 |
26 | var libc_closedir_trampoline_addr uintptr
27 |
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | var libc_readdir_r_trampoline_addr uintptr
39 |
40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go arm64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | //go:build go1.13
5 | // +build go1.13
6 |
7 | #include "textflag.h"
8 |
9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
10 | JMP libc_fdopendir(SB)
11 |
12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
14 |
15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
16 | JMP libc_closedir(SB)
17 |
18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
20 |
21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
22 | JMP libc_readdir_r(SB)
23 |
24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go:
--------------------------------------------------------------------------------
1 | // cgo -godefs types_illumos.go | go run mkpost.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build amd64 && illumos
5 | // +build amd64,illumos
6 |
7 | package unix
8 |
9 | const (
10 | TUNNEWPPA = 0x540001
11 | TUNSETPPA = 0x540002
12 |
13 | I_STR = 0x5308
14 | I_POP = 0x5303
15 | I_PUSH = 0x5302
16 | I_LINK = 0x530c
17 | I_UNLINK = 0x530d
18 | I_PLINK = 0x5316
19 | I_PUNLINK = 0x5317
20 |
21 | IF_UNITSEL = -0x7ffb8cca
22 | )
23 |
24 | type strbuf struct {
25 | Maxlen int32
26 | Len int32
27 | Buf *int8
28 | }
29 |
30 | type Strioctl struct {
31 | Cmd int32
32 | Timout int32
33 | Len int32
34 | Dp *int8
35 | }
36 |
37 | type Lifreq struct {
38 | Name [32]int8
39 | Lifru1 [4]byte
40 | Type uint32
41 | Lifru [336]byte
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/aliases.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && go1.9
6 | // +build windows,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 | //go:build windows
6 | // +build windows
7 |
8 | package windows
9 |
10 | const (
11 | EVENTLOG_SUCCESS = 0
12 | EVENTLOG_ERROR_TYPE = 1
13 | EVENTLOG_WARNING_TYPE = 2
14 | EVENTLOG_INFORMATION_TYPE = 4
15 | EVENTLOG_AUDIT_SUCCESS = 8
16 | EVENTLOG_AUDIT_FAILURE = 16
17 | )
18 |
19 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW
20 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource
21 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW
22 |
--------------------------------------------------------------------------------
/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 |
39 | type MemoryBasicInformation struct {
40 | BaseAddress uintptr
41 | AllocationBase uintptr
42 | AllocationProtect uint32
43 | PartitionId uint16
44 | RegionSize uintptr
45 | State uint32
46 | Protect uint32
47 | Type uint32
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/mkknownfolderids.bash:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2019 The Go Authors. All rights reserved.
4 | # Use of this source code is governed by a BSD-style
5 | # license that can be found in the LICENSE file.
6 |
7 | set -e
8 | shopt -s nullglob
9 |
10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)"
11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; }
12 |
13 | {
14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT."
15 | echo
16 | echo "package windows"
17 | echo "type KNOWNFOLDERID GUID"
18 | echo "var ("
19 | while read -r line; do
20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue
21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \
22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \
23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \
24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" ))
25 | done < "$knownfolders"
26 | echo ")"
27 | } | gofmt > "zknownfolderids_windows.go"
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/mksyscall.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build generate
6 | // +build generate
7 |
8 | package windows
9 |
10 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && race
6 | // +build windows,race
7 |
8 | package windows
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/windows/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && !race
6 | // +build windows,!race
7 |
8 | package windows
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/windows/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows
6 | // +build windows
7 |
8 | package windows
9 |
10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
11 | if val < 0 {
12 | return "-" + itoa(-val)
13 | }
14 | var buf [32]byte // big enough for int64
15 | i := len(buf) - 1
16 | for val >= 10 {
17 | buf[i] = byte(val%10 + '0')
18 | i--
19 | val /= 10
20 | }
21 | buf[i] = byte(val + '0')
22 | return string(buf[i:])
23 | }
24 |
--------------------------------------------------------------------------------
/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.v3/.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.v3
17 |
--------------------------------------------------------------------------------
/vendor/gopkg.in/yaml.v3/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright 2011-2016 Canonical Ltd.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------