├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── enhancement.md │ └── other.md └── workflows │ ├── build.yml │ └── prerelease.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTORS.md ├── LICENSE ├── PACKAGING.md ├── README.md ├── assets ├── logo │ ├── credits.md │ └── logo.png └── screenshots │ ├── battery.png │ ├── demo.gif │ ├── fourby.png │ ├── kitchensink.gif │ ├── minimal.png │ └── procs.png ├── build ├── gotop.conf ├── nfpm.yml ├── osx.sh └── snapcraft.yaml ├── cmd └── gotop │ ├── description.txt │ └── main.go ├── colorschemes ├── default.go ├── default.json ├── default_dark.go ├── monokai.go ├── monokai.png ├── nord.go ├── registry.go ├── registry_test.go ├── solarized.go ├── solarized.png ├── solarized16_dark.go ├── solarized16_light.go ├── template.go └── vice.go ├── config.go ├── config_test.go ├── devices ├── cpu.go ├── cpu_cpu.go ├── cpu_linux.go ├── cpu_other.go ├── devices.go ├── mem.go ├── mem_mem.go ├── mem_swap_freebsd.go ├── mem_swap_other.go ├── nvidia.go ├── remote.go ├── smc.tsv ├── temp.go ├── temp_darwin.go ├── temp_darwin_test.go ├── temp_freebsd.go ├── temp_linux.go ├── temp_nix.go ├── temp_openbsd.go └── temp_windows.go ├── dicts ├── de_DE.toml ├── en_US.toml ├── eo.toml ├── es.toml ├── fa.toml ├── fr.toml ├── nl.toml ├── ru_RU.toml ├── tt_TT.toml └── zh_CN.toml ├── docs ├── bashtop.md ├── colorschemes.md ├── configuration.md ├── devices.md ├── extensions.md ├── grid-fill.md ├── layouts.md ├── nvidia-extension.md ├── releasing.md └── remote-monitoring.md ├── fonts ├── Lat15-VGA16-braille.psf ├── README ├── braille.txt └── gen-braille.py ├── go.mod ├── go.sum ├── layout ├── layout.go ├── layout_test.go └── parser.go ├── layouts ├── consume_test ├── default ├── disk ├── htop ├── kitchensink ├── many_columns_test └── procs ├── logging ├── logging.go ├── logging_dup2.go ├── logging_dup3.go ├── logging_test.go └── logging_windows.go ├── scripts ├── download.sh ├── install_without_root.sh ├── make.sh ├── makeDarwin.sh ├── quality.sh └── size.sh ├── termui ├── drawille-go │ ├── LICENSE.md │ ├── README.md │ └── drawille.go ├── entry.go ├── gauge.go ├── linegraph.go ├── linegraph_test.go ├── sparkline.go └── table.go ├── utils ├── bytes.go ├── conversions.go ├── math.go ├── runes.go ├── runes_test.go └── xdg.go ├── vendor ├── github.com │ ├── BurntSushi │ │ └── toml │ │ │ ├── .gitignore │ │ │ ├── COMPATIBLE │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── decode_go116.go │ │ │ ├── deprecated.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── error.go │ │ │ ├── internal │ │ │ └── tz.go │ │ │ ├── lex.go │ │ │ ├── meta.go │ │ │ ├── parse.go │ │ │ ├── type_fields.go │ │ │ └── type_toml.go │ ├── StackExchange │ │ └── wmi │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── swbemservices.go │ │ │ └── wmi.go │ ├── VictoriaMetrics │ │ └── metrics │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── counter.go │ │ │ ├── floatcounter.go │ │ │ ├── gauge.go │ │ │ ├── go_metrics.go │ │ │ ├── histogram.go │ │ │ ├── metrics.go │ │ │ ├── process_metrics_linux.go │ │ │ ├── process_metrics_other.go │ │ │ ├── set.go │ │ │ ├── summary.go │ │ │ └── validator.go │ ├── VividCortex │ │ └── ewma │ │ │ ├── .gitignore │ │ │ ├── .whitesource │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── codecov.yml │ │ │ └── ewma.go │ ├── anatol │ │ └── smart.go │ │ │ ├── .clang-format │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── ata_device_database.go │ │ │ ├── ioctl_linux.go │ │ │ ├── nvme.go │ │ │ ├── nvme_darwin.cpp │ │ │ ├── nvme_darwin.go │ │ │ ├── nvme_darwin.h │ │ │ ├── nvme_linux.go │ │ │ ├── nvme_other.go │ │ │ ├── sata.go │ │ │ ├── sata_linux.go │ │ │ ├── sata_other.go │ │ │ ├── scsi.go │ │ │ ├── scsi_linux.go │ │ │ ├── scsi_other.go │ │ │ └── smart.go │ ├── cloudfoundry-attic │ │ └── jibber_jabber │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── jibber_jabber.go │ │ │ ├── jibber_jabber_unix.go │ │ │ └── jibber_jabber_windows.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── distatus │ │ └── battery │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── battery.go │ │ │ ├── battery_darwin.go │ │ │ ├── battery_freebsd_dragonfly_.go │ │ │ ├── battery_linux.go │ │ │ ├── battery_netbsd.go │ │ │ ├── battery_openbsd.go │ │ │ ├── battery_solaris.go │ │ │ ├── battery_windows.go │ │ │ ├── errors.go │ │ │ └── ioctl.go │ ├── droundy │ │ └── goopt │ │ │ ├── .build │ │ │ ├── .gitignore │ │ │ ├── .test │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── goopt.go │ │ │ ├── setup-git.sh │ │ │ └── slice.go │ ├── ghodss │ │ └── yaml │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── fields.go │ │ │ └── yaml.go │ ├── gizak │ │ └── termui │ │ │ └── v3 │ │ │ ├── LICENSE │ │ │ ├── alignment.go │ │ │ ├── backend.go │ │ │ ├── block.go │ │ │ ├── buffer.go │ │ │ ├── canvas.go │ │ │ ├── doc.go │ │ │ ├── drawille │ │ │ └── drawille.go │ │ │ ├── events.go │ │ │ ├── grid.go │ │ │ ├── render.go │ │ │ ├── style.go │ │ │ ├── style_parser.go │ │ │ ├── symbols.go │ │ │ ├── symbols_other.go │ │ │ ├── symbols_windows.go │ │ │ ├── theme.go │ │ │ ├── utils.go │ │ │ └── widgets │ │ │ ├── barchart.go │ │ │ ├── gauge.go │ │ │ ├── image.go │ │ │ ├── list.go │ │ │ ├── paragraph.go │ │ │ ├── piechart.go │ │ │ ├── plot.go │ │ │ ├── sparkline.go │ │ │ ├── stacked_barchart.go │ │ │ ├── table.go │ │ │ ├── tabs.go │ │ │ └── tree.go │ ├── go-ole │ │ └── go-ole │ │ │ ├── .travis.yml │ │ │ ├── ChangeLog.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── com.go │ │ │ ├── com_func.go │ │ │ ├── connect.go │ │ │ ├── constants.go │ │ │ ├── error.go │ │ │ ├── error_func.go │ │ │ ├── error_windows.go │ │ │ ├── guid.go │ │ │ ├── iconnectionpoint.go │ │ │ ├── iconnectionpoint_func.go │ │ │ ├── iconnectionpoint_windows.go │ │ │ ├── iconnectionpointcontainer.go │ │ │ ├── iconnectionpointcontainer_func.go │ │ │ ├── iconnectionpointcontainer_windows.go │ │ │ ├── idispatch.go │ │ │ ├── idispatch_func.go │ │ │ ├── idispatch_windows.go │ │ │ ├── ienumvariant.go │ │ │ ├── ienumvariant_func.go │ │ │ ├── ienumvariant_windows.go │ │ │ ├── iinspectable.go │ │ │ ├── iinspectable_func.go │ │ │ ├── iinspectable_windows.go │ │ │ ├── iprovideclassinfo.go │ │ │ ├── iprovideclassinfo_func.go │ │ │ ├── iprovideclassinfo_windows.go │ │ │ ├── itypeinfo.go │ │ │ ├── itypeinfo_func.go │ │ │ ├── itypeinfo_windows.go │ │ │ ├── iunknown.go │ │ │ ├── iunknown_func.go │ │ │ ├── iunknown_windows.go │ │ │ ├── ole.go │ │ │ ├── oleutil │ │ │ ├── connection.go │ │ │ ├── connection_func.go │ │ │ ├── connection_windows.go │ │ │ ├── go-get.go │ │ │ └── oleutil.go │ │ │ ├── safearray.go │ │ │ ├── safearray_func.go │ │ │ ├── safearray_windows.go │ │ │ ├── safearrayconversion.go │ │ │ ├── safearrayslices.go │ │ │ ├── utility.go │ │ │ ├── variables.go │ │ │ ├── variant.go │ │ │ ├── variant_386.go │ │ │ ├── variant_amd64.go │ │ │ ├── variant_arm.go │ │ │ ├── variant_arm64.go │ │ │ ├── variant_date_386.go │ │ │ ├── variant_date_amd64.go │ │ │ ├── variant_date_arm.go │ │ │ ├── variant_date_arm64.go │ │ │ ├── variant_ppc64le.go │ │ │ ├── variant_s390x.go │ │ │ ├── vt_string.go │ │ │ ├── winrt.go │ │ │ └── winrt_doc.go │ ├── jaypipes │ │ ├── ghw │ │ │ ├── .gitignore │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── COPYING │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── SNAPSHOT.md │ │ │ ├── alias.go │ │ │ ├── doc.go │ │ │ ├── host.go │ │ │ └── pkg │ │ │ │ ├── baseboard │ │ │ │ ├── baseboard.go │ │ │ │ ├── baseboard_linux.go │ │ │ │ ├── baseboard_stub.go │ │ │ │ └── baseboard_windows.go │ │ │ │ ├── bios │ │ │ │ ├── bios.go │ │ │ │ ├── bios_linux.go │ │ │ │ ├── bios_stub.go │ │ │ │ └── bios_windows.go │ │ │ │ ├── block │ │ │ │ ├── block.go │ │ │ │ ├── block_darwin.go │ │ │ │ ├── block_linux.go │ │ │ │ ├── block_stub.go │ │ │ │ └── block_windows.go │ │ │ │ ├── chassis │ │ │ │ ├── chassis.go │ │ │ │ ├── chassis_linux.go │ │ │ │ ├── chassis_stub.go │ │ │ │ └── chassis_windows.go │ │ │ │ ├── context │ │ │ │ └── context.go │ │ │ │ ├── cpu │ │ │ │ ├── cpu.go │ │ │ │ ├── cpu_linux.go │ │ │ │ ├── cpu_stub.go │ │ │ │ └── cpu_windows.go │ │ │ │ ├── gpu │ │ │ │ ├── gpu.go │ │ │ │ ├── gpu_linux.go │ │ │ │ ├── gpu_stub.go │ │ │ │ └── gpu_windows.go │ │ │ │ ├── linuxdmi │ │ │ │ └── dmi_linux.go │ │ │ │ ├── linuxpath │ │ │ │ └── path_linux.go │ │ │ │ ├── marshal │ │ │ │ └── marshal.go │ │ │ │ ├── memory │ │ │ │ ├── memory.go │ │ │ │ ├── memory_cache.go │ │ │ │ ├── memory_cache_linux.go │ │ │ │ ├── memory_linux.go │ │ │ │ ├── memory_stub.go │ │ │ │ └── memory_windows.go │ │ │ │ ├── net │ │ │ │ ├── net.go │ │ │ │ ├── net_linux.go │ │ │ │ ├── net_stub.go │ │ │ │ └── net_windows.go │ │ │ │ ├── option │ │ │ │ └── option.go │ │ │ │ ├── pci │ │ │ │ ├── address │ │ │ │ │ └── address.go │ │ │ │ ├── pci.go │ │ │ │ ├── pci_linux.go │ │ │ │ └── pci_stub.go │ │ │ │ ├── product │ │ │ │ ├── product.go │ │ │ │ ├── product_linux.go │ │ │ │ ├── product_stub.go │ │ │ │ └── product_windows.go │ │ │ │ ├── snapshot │ │ │ │ ├── clonetree.go │ │ │ │ ├── clonetree_block_linux.go │ │ │ │ ├── clonetree_gpu_linux.go │ │ │ │ ├── clonetree_linux.go │ │ │ │ ├── clonetree_net_linux.go │ │ │ │ ├── clonetree_pci_linux.go │ │ │ │ ├── clonetree_stub.go │ │ │ │ ├── pack.go │ │ │ │ ├── testdata.tar.gz │ │ │ │ ├── trace.go │ │ │ │ └── unpack.go │ │ │ │ ├── topology │ │ │ │ ├── topology.go │ │ │ │ ├── topology_linux.go │ │ │ │ ├── topology_stub.go │ │ │ │ └── topology_windows.go │ │ │ │ ├── unitutil │ │ │ │ └── unit.go │ │ │ │ └── util │ │ │ │ └── util.go │ │ └── pcidb │ │ │ ├── .gitignore │ │ │ ├── COPYING │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── context.go │ │ │ ├── discover.go │ │ │ ├── main.go │ │ │ └── parse.go │ ├── lufia │ │ └── plan9stats │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cpu.go │ │ │ ├── doc.go │ │ │ ├── host.go │ │ │ ├── int.go │ │ │ ├── opts.go │ │ │ └── stats.go │ ├── mattn │ │ └── go-runewidth │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── go.test.sh │ │ │ ├── runewidth.go │ │ │ ├── runewidth_appengine.go │ │ │ ├── runewidth_js.go │ │ │ ├── runewidth_posix.go │ │ │ ├── runewidth_table.go │ │ │ └── runewidth_windows.go │ ├── mitchellh │ │ ├── go-homedir │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── homedir.go │ │ └── go-wordwrap │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ └── wordwrap.go │ ├── nsf │ │ └── termbox-go │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── api.go │ │ │ ├── api_common.go │ │ │ ├── api_windows.go │ │ │ ├── collect_terminfo.py │ │ │ ├── escwait.go │ │ │ ├── escwait_darwin.go │ │ │ ├── syscalls_darwin.go │ │ │ ├── syscalls_darwin_amd64.go │ │ │ ├── syscalls_dragonfly.go │ │ │ ├── syscalls_freebsd.go │ │ │ ├── syscalls_linux.go │ │ │ ├── syscalls_netbsd.go │ │ │ ├── syscalls_openbsd.go │ │ │ ├── syscalls_windows.go │ │ │ ├── termbox.go │ │ │ ├── termbox_common.go │ │ │ ├── termbox_windows.go │ │ │ ├── terminfo.go │ │ │ └── terminfo_builtin.go │ ├── pkg │ │ └── errors │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── errors.go │ │ │ ├── go113.go │ │ │ └── stack.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ ├── power-devops │ │ └── perfstat │ │ │ ├── LICENSE │ │ │ ├── c_helpers.c │ │ │ ├── c_helpers.h │ │ │ ├── config.go │ │ │ ├── cpustat.go │ │ │ ├── diskstat.go │ │ │ ├── doc.go │ │ │ ├── fsstat.go │ │ │ ├── helpers.go │ │ │ ├── lparstat.go │ │ │ ├── lvmstat.go │ │ │ ├── memstat.go │ │ │ ├── netstat.go │ │ │ ├── procstat.go │ │ │ ├── sysconf.go │ │ │ ├── systemcfg.go │ │ │ ├── types_cpu.go │ │ │ ├── types_disk.go │ │ │ ├── types_fs.go │ │ │ ├── types_lpar.go │ │ │ ├── types_lvm.go │ │ │ ├── types_memory.go │ │ │ ├── types_network.go │ │ │ ├── types_process.go │ │ │ └── uptime.go │ ├── rivo │ │ └── uniseg │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── grapheme.go │ │ │ └── properties.go │ ├── shibukawa │ │ └── configdir │ │ │ ├── LICENSE │ │ │ ├── README.rst │ │ │ ├── config.go │ │ │ ├── config_darwin.go │ │ │ ├── config_windows.go │ │ │ └── config_xdg.go │ ├── shirou │ │ └── gopsutil │ │ │ └── v3 │ │ │ ├── LICENSE │ │ │ ├── common │ │ │ └── env.go │ │ │ ├── cpu │ │ │ ├── cpu.go │ │ │ ├── cpu_aix.go │ │ │ ├── cpu_aix_cgo.go │ │ │ ├── cpu_aix_nocgo.go │ │ │ ├── cpu_darwin.go │ │ │ ├── cpu_darwin_cgo.go │ │ │ ├── cpu_darwin_nocgo.go │ │ │ ├── cpu_dragonfly.go │ │ │ ├── cpu_dragonfly_amd64.go │ │ │ ├── cpu_fallback.go │ │ │ ├── cpu_freebsd.go │ │ │ ├── cpu_freebsd_386.go │ │ │ ├── cpu_freebsd_amd64.go │ │ │ ├── cpu_freebsd_arm.go │ │ │ ├── cpu_freebsd_arm64.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_netbsd.go │ │ │ ├── cpu_netbsd_amd64.go │ │ │ ├── cpu_netbsd_arm64.go │ │ │ ├── cpu_openbsd.go │ │ │ ├── cpu_openbsd_386.go │ │ │ ├── cpu_openbsd_amd64.go │ │ │ ├── cpu_openbsd_arm.go │ │ │ ├── cpu_openbsd_arm64.go │ │ │ ├── cpu_openbsd_riscv64.go │ │ │ ├── cpu_plan9.go │ │ │ ├── cpu_solaris.go │ │ │ └── cpu_windows.go │ │ │ ├── disk │ │ │ ├── disk.go │ │ │ ├── disk_aix.go │ │ │ ├── disk_aix_cgo.go │ │ │ ├── disk_aix_nocgo.go │ │ │ ├── disk_darwin.go │ │ │ ├── disk_darwin_cgo.go │ │ │ ├── disk_darwin_nocgo.go │ │ │ ├── disk_fallback.go │ │ │ ├── disk_freebsd.go │ │ │ ├── disk_freebsd_386.go │ │ │ ├── disk_freebsd_amd64.go │ │ │ ├── disk_freebsd_arm.go │ │ │ ├── disk_freebsd_arm64.go │ │ │ ├── disk_linux.go │ │ │ ├── disk_netbsd.go │ │ │ ├── disk_netbsd_amd64.go │ │ │ ├── disk_netbsd_arm64.go │ │ │ ├── disk_openbsd.go │ │ │ ├── disk_openbsd_386.go │ │ │ ├── disk_openbsd_amd64.go │ │ │ ├── disk_openbsd_arm.go │ │ │ ├── disk_openbsd_arm64.go │ │ │ ├── disk_openbsd_riscv64.go │ │ │ ├── disk_solaris.go │ │ │ ├── disk_unix.go │ │ │ ├── disk_windows.go │ │ │ ├── iostat_darwin.c │ │ │ └── iostat_darwin.h │ │ │ ├── host │ │ │ ├── host.go │ │ │ ├── host_aix.go │ │ │ ├── host_aix_ppc64.go │ │ │ ├── host_bsd.go │ │ │ ├── host_darwin.go │ │ │ ├── host_darwin_amd64.go │ │ │ ├── host_darwin_arm64.go │ │ │ ├── host_darwin_cgo.go │ │ │ ├── host_darwin_nocgo.go │ │ │ ├── host_fallback.go │ │ │ ├── host_freebsd.go │ │ │ ├── host_freebsd_386.go │ │ │ ├── host_freebsd_amd64.go │ │ │ ├── host_freebsd_arm.go │ │ │ ├── host_freebsd_arm64.go │ │ │ ├── host_linux.go │ │ │ ├── host_linux_386.go │ │ │ ├── host_linux_amd64.go │ │ │ ├── host_linux_arm.go │ │ │ ├── host_linux_arm64.go │ │ │ ├── host_linux_loong64.go │ │ │ ├── host_linux_mips.go │ │ │ ├── host_linux_mips64.go │ │ │ ├── host_linux_mips64le.go │ │ │ ├── host_linux_mipsle.go │ │ │ ├── host_linux_ppc64.go │ │ │ ├── host_linux_ppc64le.go │ │ │ ├── host_linux_riscv64.go │ │ │ ├── host_linux_s390x.go │ │ │ ├── host_netbsd.go │ │ │ ├── host_openbsd.go │ │ │ ├── host_openbsd_386.go │ │ │ ├── host_openbsd_amd64.go │ │ │ ├── host_openbsd_arm.go │ │ │ ├── host_openbsd_arm64.go │ │ │ ├── host_openbsd_riscv64.go │ │ │ ├── host_posix.go │ │ │ ├── host_solaris.go │ │ │ ├── host_windows.go │ │ │ ├── smc_darwin.c │ │ │ └── smc_darwin.h │ │ │ ├── internal │ │ │ └── common │ │ │ │ ├── binary.go │ │ │ │ ├── common.go │ │ │ │ ├── common_darwin.go │ │ │ │ ├── common_freebsd.go │ │ │ │ ├── common_linux.go │ │ │ │ ├── common_netbsd.go │ │ │ │ ├── common_openbsd.go │ │ │ │ ├── common_unix.go │ │ │ │ ├── common_windows.go │ │ │ │ ├── endian.go │ │ │ │ ├── sleep.go │ │ │ │ └── warnings.go │ │ │ ├── mem │ │ │ ├── mem.go │ │ │ ├── mem_aix.go │ │ │ ├── mem_aix_cgo.go │ │ │ ├── mem_aix_nocgo.go │ │ │ ├── mem_bsd.go │ │ │ ├── mem_darwin.go │ │ │ ├── mem_darwin_cgo.go │ │ │ ├── mem_darwin_nocgo.go │ │ │ ├── mem_fallback.go │ │ │ ├── mem_freebsd.go │ │ │ ├── mem_linux.go │ │ │ ├── mem_netbsd.go │ │ │ ├── mem_openbsd.go │ │ │ ├── mem_openbsd_386.go │ │ │ ├── mem_openbsd_amd64.go │ │ │ ├── mem_openbsd_arm.go │ │ │ ├── mem_openbsd_arm64.go │ │ │ ├── mem_openbsd_riscv64.go │ │ │ ├── mem_plan9.go │ │ │ ├── mem_solaris.go │ │ │ └── mem_windows.go │ │ │ ├── net │ │ │ ├── net.go │ │ │ ├── net_aix.go │ │ │ ├── net_aix_cgo.go │ │ │ ├── net_aix_nocgo.go │ │ │ ├── net_darwin.go │ │ │ ├── net_fallback.go │ │ │ ├── net_freebsd.go │ │ │ ├── net_linux.go │ │ │ ├── net_linux_111.go │ │ │ ├── net_linux_116.go │ │ │ ├── net_openbsd.go │ │ │ ├── net_solaris.go │ │ │ ├── net_unix.go │ │ │ └── net_windows.go │ │ │ └── process │ │ │ ├── process.go │ │ │ ├── process_bsd.go │ │ │ ├── process_darwin.go │ │ │ ├── process_darwin_amd64.go │ │ │ ├── process_darwin_arm64.go │ │ │ ├── process_darwin_cgo.go │ │ │ ├── process_darwin_nocgo.go │ │ │ ├── process_fallback.go │ │ │ ├── process_freebsd.go │ │ │ ├── process_freebsd_386.go │ │ │ ├── process_freebsd_amd64.go │ │ │ ├── process_freebsd_arm.go │ │ │ ├── process_freebsd_arm64.go │ │ │ ├── process_linux.go │ │ │ ├── process_openbsd.go │ │ │ ├── process_openbsd_386.go │ │ │ ├── process_openbsd_amd64.go │ │ │ ├── process_openbsd_arm.go │ │ │ ├── process_openbsd_arm64.go │ │ │ ├── process_openbsd_riscv64.go │ │ │ ├── process_plan9.go │ │ │ ├── process_posix.go │ │ │ ├── process_solaris.go │ │ │ ├── process_windows.go │ │ │ ├── process_windows_32bit.go │ │ │ └── process_windows_64bit.go │ ├── shoenig │ │ └── go-m1cpu │ │ │ ├── .golangci.yaml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── cpu.go │ │ │ └── incompatible.go │ ├── stretchr │ │ └── testify │ │ │ ├── LICENSE │ │ │ └── assert │ │ │ ├── assertion_compare.go │ │ │ ├── assertion_format.go │ │ │ ├── assertion_format.go.tmpl │ │ │ ├── assertion_forward.go │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── assertion_order.go │ │ │ ├── assertions.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ └── http_assertions.go │ ├── tklauser │ │ ├── go-sysconf │ │ │ ├── .cirrus.yml │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── sysconf.go │ │ │ ├── sysconf_bsd.go │ │ │ ├── sysconf_darwin.go │ │ │ ├── sysconf_dragonfly.go │ │ │ ├── sysconf_freebsd.go │ │ │ ├── sysconf_generic.go │ │ │ ├── sysconf_linux.go │ │ │ ├── sysconf_netbsd.go │ │ │ ├── sysconf_openbsd.go │ │ │ ├── sysconf_posix.go │ │ │ ├── sysconf_solaris.go │ │ │ ├── sysconf_unsupported.go │ │ │ ├── zsysconf_defs_darwin.go │ │ │ ├── zsysconf_defs_dragonfly.go │ │ │ ├── zsysconf_defs_freebsd.go │ │ │ ├── zsysconf_defs_linux.go │ │ │ ├── zsysconf_defs_netbsd.go │ │ │ ├── zsysconf_defs_openbsd.go │ │ │ ├── zsysconf_defs_solaris.go │ │ │ ├── zsysconf_values_freebsd_386.go │ │ │ ├── zsysconf_values_freebsd_amd64.go │ │ │ ├── zsysconf_values_freebsd_arm.go │ │ │ ├── zsysconf_values_freebsd_arm64.go │ │ │ ├── zsysconf_values_freebsd_riscv64.go │ │ │ ├── zsysconf_values_linux_386.go │ │ │ ├── zsysconf_values_linux_amd64.go │ │ │ ├── zsysconf_values_linux_arm.go │ │ │ ├── zsysconf_values_linux_arm64.go │ │ │ ├── zsysconf_values_linux_loong64.go │ │ │ ├── zsysconf_values_linux_mips.go │ │ │ ├── zsysconf_values_linux_mips64.go │ │ │ ├── zsysconf_values_linux_mips64le.go │ │ │ ├── zsysconf_values_linux_mipsle.go │ │ │ ├── zsysconf_values_linux_ppc64.go │ │ │ ├── zsysconf_values_linux_ppc64le.go │ │ │ ├── zsysconf_values_linux_riscv64.go │ │ │ ├── zsysconf_values_linux_s390x.go │ │ │ ├── zsysconf_values_netbsd_386.go │ │ │ ├── zsysconf_values_netbsd_amd64.go │ │ │ ├── zsysconf_values_netbsd_arm.go │ │ │ └── zsysconf_values_netbsd_arm64.go │ │ └── numcpus │ │ │ ├── .cirrus.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── numcpus.go │ │ │ ├── numcpus_bsd.go │ │ │ ├── numcpus_linux.go │ │ │ ├── numcpus_solaris.go │ │ │ ├── numcpus_unsupported.go │ │ │ └── numcpus_windows.go │ ├── valyala │ │ ├── fastrand │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── fastrand.go │ │ └── histogram │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── histogram.go │ ├── xxxserxxx │ │ └── lingo │ │ │ └── v2 │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── lingo.go │ │ │ └── locale.go │ └── yusufpapurcu │ │ └── wmi │ │ ├── LICENSE │ │ ├── README.md │ │ ├── swbemservices.go │ │ └── wmi.go ├── golang.org │ └── x │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkknownfolderids.bash │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── registry │ │ ├── key.go │ │ ├── mksyscall.go │ │ ├── syscall.go │ │ ├── value.go │ │ └── zsyscall_windows.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 ├── gopkg.in │ ├── yaml.v2 │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go │ └── yaml.v3 │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go ├── howett.net │ └── plist │ │ ├── .gitignore │ │ ├── .gitlab-ci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bplist.go │ │ ├── bplist_generator.go │ │ ├── bplist_parser.go │ │ ├── decode.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── fuzz.go │ │ ├── marshal.go │ │ ├── must.go │ │ ├── plist.go │ │ ├── plist_types.go │ │ ├── text_generator.go │ │ ├── text_parser.go │ │ ├── text_tables.go │ │ ├── typeinfo.go │ │ ├── unmarshal.go │ │ ├── util.go │ │ ├── xml_generator.go │ │ ├── xml_parser.go │ │ ├── zerocopy.go │ │ └── zerocopy_appengine.go └── modules.txt └── widgets ├── battery.go ├── batterygauge.go ├── cpu.go ├── disk.go ├── help.go ├── mem.go ├── metrics.go ├── net.go ├── proc.go ├── proc_freebsd.go ├── proc_linux.go ├── proc_other.go ├── proc_windows.go ├── scalable.go ├── statusbar.go └── temp.go /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Template to report bugs. 4 | --- 5 | 6 | 7 | 8 | 9 | ##### gotop version: 10 | `gotop -V`, or if built from source, `git rev-parse HEAD` 11 | ##### OS/Arch: 12 | Linux: `uname -or`, OSX: `sw_vers`; Windows: `systeminfo | findstr /B /C:"OS Name" /C:"OS Version"` 13 | ##### Terminal emulator: 14 | e.g. iTerm, kitty, xterm, PowerShell 15 | ##### Any relevant hardware info: 16 | If the issue is clearly related to a specific piece of hardware, e.g., the network 17 | ##### tmux version: 18 | `tmux -V`, if using tmux 19 | 20 | Also please copy or attach `~/.local/state/gotop/errors.log` if it exists and contains logs: 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | ### Is your proposal related to a problem? 2 | 3 | 7 | 8 | (Write your answer here.) 9 | 10 | ### Describe the solution you'd like 11 | 12 | 15 | 16 | (Describe your proposed solution here.) 17 | 18 | ### Describe alternatives you've considered 19 | 20 | 23 | 24 | (Write your answer here.) 25 | 26 | ### Additional context 27 | 28 | 32 | 33 | (Write your answer here.) 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other 3 | about: No template. 4 | --- 5 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build Go binaries 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - 'docs/release.svg' 7 | - 'README.md' 8 | - 'CHANGELOG.md' 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@master 16 | 17 | - name: Compile 18 | uses: xxxserxxx/actions/golang-build@v2.2.3 19 | env: 20 | SRCPATH: ./cmd/gotop 21 | with: 22 | args: darwin/amd64/1 darwin/arm64/1 linux/amd64 linux/386 linux/arm64 linux/arm7 linux/arm6 linux/arm5 windows/amd64/1 windows/386/1 freebsd/amd64/1 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | /gotop 3 | 4 | # snap packaging specific 5 | /parts/ 6 | /prime/ 7 | /stage/ 8 | /*.snap 9 | /snap/.snapcraft/ 10 | /*_source.tar.bz2 11 | 12 | build/gotop_* 13 | build.log 14 | 15 | tmp/ 16 | dist/ 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.11.x 5 | 6 | git: 7 | depth: 1 8 | 9 | env: 10 | global: 11 | - NAME=gotop 12 | 13 | matrix: 14 | include: 15 | # Linux 16 | - env: _GOOS=linux _GOARCH=amd64 17 | os: linux 18 | - env: _GOOS=linux _GOARCH=386 19 | os: linux 20 | - env: _GOOS=linux _GOARCH=arm GOARM=5 21 | os: linux 22 | - env: _GOOS=linux _GOARCH=arm GOARM=6 23 | os: linux 24 | - env: _GOOS=linux _GOARCH=arm GOARM=7 25 | os: linux 26 | - env: _GOOS=linux _GOARCH=arm64 27 | os: linux 28 | 29 | # OSX 30 | - env: _GOOS=darwin _GOARCH=amd64 31 | os: osx 32 | 33 | install: true 34 | script: ./ci/script.sh 35 | 36 | deploy: 37 | provider: releases 38 | api_key: $GITHUB_TOKEN 39 | file_glob: true 40 | file: "./dist/*" 41 | skip_cleanup: true 42 | on: 43 | tags: true 44 | 45 | if: tag IS present 46 | 47 | notifications: 48 | email: 49 | on_success: never 50 | -------------------------------------------------------------------------------- /assets/logo/credits.md: -------------------------------------------------------------------------------- 1 | Logo created and contributed by [mdnazmulhasan27771](https://github.com/mdnazmulhasan27771) 2 | -------------------------------------------------------------------------------- /assets/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/logo/logo.png -------------------------------------------------------------------------------- /assets/screenshots/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/battery.png -------------------------------------------------------------------------------- /assets/screenshots/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/demo.gif -------------------------------------------------------------------------------- /assets/screenshots/fourby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/fourby.png -------------------------------------------------------------------------------- /assets/screenshots/kitchensink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/kitchensink.gif -------------------------------------------------------------------------------- /assets/screenshots/minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/minimal.png -------------------------------------------------------------------------------- /assets/screenshots/procs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/assets/screenshots/procs.png -------------------------------------------------------------------------------- /build/nfpm.yml: -------------------------------------------------------------------------------- 1 | name: gotop 2 | arch: ${GOARCH} 3 | platform: linux 4 | version: ${VERSION} 5 | version_schema: semver 6 | version_metadata: git 7 | section: default 8 | priority: extra 9 | maintainer: Sean Russell 10 | description: A terminal based graphical activity monitor inspired by gtop and vtop 11 | vendor: Sean Russell 12 | homepage: https://github.com/xxxserxxx/gotop 13 | license: The MIT License (Festival variant) 14 | contents: 15 | # The executable 16 | - src: ${EXECUTABLE} 17 | dst: /usr/bin/gotop 18 | 19 | # Default configuration 20 | - src: build/gotop.conf 21 | dst: /etc/gotop/gotop.conf 22 | type: config|noreplace 23 | 24 | # Contributed layouts 25 | - src: layouts/htop 26 | dst: /etc/gotop/htop 27 | type: config|noreplace 28 | 29 | # Manpage 30 | - src: ${MANPAGE} 31 | dst: /usr/share/man/man8/gotop.1.gz 32 | -------------------------------------------------------------------------------- /build/osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /mnt 3 | ./make.sh darwin 4 | -------------------------------------------------------------------------------- /colorschemes/default.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | func init() { 4 | register("default", Colorscheme{ 5 | Fg: 7, 6 | Bg: -1, 7 | 8 | BorderLabel: 7, 9 | BorderLine: 6, 10 | 11 | CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 12 | 13 | BattLines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 14 | 15 | MemLines: []int{5, 11, 4, 3, 2, 1, 6, 7, 8}, 16 | 17 | ProcCursor: 4, 18 | 19 | Sparklines: [2]int{4, 5}, 20 | 21 | DiskBar: 7, 22 | 23 | TempLow: 2, 24 | TempHigh: 1, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /colorschemes/default.json: -------------------------------------------------------------------------------- 1 | // Example json file to put in `~/.config/gotop/{name}.json` and load with 2 | // `gotop -c {name}`. MUST DELETE THESE COMMENTS AND RENAME FILE in order to load. 3 | { 4 | "Fg": 7, 5 | "Bg": -1, 6 | 7 | "BorderLabel": 7, 8 | "BorderLine": 6, 9 | 10 | "CPULines": [4, 3, 2, 1, 5, 6, 7, 8], 11 | 12 | "BattLines": [4, 3, 2, 1, 5, 6, 7, 8], 13 | 14 | "MemLines": [5, 11, 4, 3, 2, 1, 6, 7, 8], 15 | 16 | "ProcCursor": 4, 17 | 18 | "Sparklines": [4, 5], 19 | 20 | "DiskBar": 7, 21 | 22 | "TempLow": 2, 23 | "TempHigh": 1 24 | } 25 | -------------------------------------------------------------------------------- /colorschemes/default_dark.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | func init() { 4 | register("default-dark", Colorscheme{ 5 | Fg: 235, 6 | Bg: -1, 7 | 8 | BorderLabel: 235, 9 | BorderLine: 6, 10 | 11 | CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 12 | 13 | BattLines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 14 | 15 | MemLines: []int{5, 3, 4, 2, 1, 6, 7, 8, 11}, 16 | 17 | ProcCursor: 33, 18 | 19 | Sparklines: [2]int{4, 5}, 20 | 21 | DiskBar: 252, 22 | 23 | TempLow: 2, 24 | TempHigh: 1, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /colorschemes/monokai.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | func init() { 4 | register("monokai", Colorscheme{ 5 | Fg: 249, 6 | Bg: -1, 7 | 8 | BorderLabel: 249, 9 | BorderLine: 239, 10 | 11 | CPULines: []int{81, 70, 208, 197, 249, 141, 221, 186}, 12 | 13 | BattLines: []int{81, 70, 208, 197, 249, 141, 221, 186}, 14 | 15 | MemLines: []int{208, 186, 81, 70, 208, 197, 249, 141, 221, 186}, 16 | 17 | ProcCursor: 197, 18 | 19 | Sparklines: [2]int{81, 186}, 20 | 21 | DiskBar: 102, 22 | 23 | TempLow: 70, 24 | TempHigh: 208, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /colorschemes/monokai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/colorschemes/monokai.png -------------------------------------------------------------------------------- /colorschemes/nord.go: -------------------------------------------------------------------------------- 1 | /* 2 | The standard 256 terminal colors are supported. 3 | 4 | -1 = clear 5 | 6 | You can combine a color with 'Bold', 'Underline', or 'Reverse' by using bitwise OR ('|') and the name of the Color. 7 | For example, to get Bold red Labels, you would do 'Labels: 2 | Bold'. 8 | 9 | Once you've created a colorscheme, add an entry for it in the `handleColorscheme` function in 'main.go'. 10 | */ 11 | 12 | package colorschemes 13 | 14 | func init() { 15 | register("nord", Colorscheme{ 16 | Name: "A Nord Approximation", 17 | Author: "@jrswab", 18 | Fg: 254, // lightest 19 | Bg: -1, 20 | 21 | BorderLabel: 254, 22 | BorderLine: 96, // Purple 23 | 24 | CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 25 | 26 | BattLines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 27 | 28 | MemLines: []int{172, 221, 4, 3, 2, 1, 5, 6, 7, 8}, 29 | 30 | ProcCursor: 31, // blue (nord9) 31 | 32 | Sparklines: [2]int{31, 96}, 33 | 34 | DiskBar: 254, 35 | 36 | TempLow: 64, // green 37 | TempHigh: 167, // red 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /colorschemes/registry_test.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | import ( 4 | "github.com/shibukawa/configdir" 5 | "path/filepath" 6 | "reflect" 7 | "testing" 8 | ) 9 | 10 | func TestColorRegistry(t *testing.T) { 11 | colors := []string{"default", "default-dark", "solarized", "solarized16-dark", "solarized16-light", "monokai", "vice"} 12 | zeroCS := Colorscheme{} 13 | cd := configdir.New("", "gotop") 14 | cd.LocalPath, _ = filepath.Abs(".") 15 | for _, cn := range colors { 16 | c, e := FromName(cd, cn) 17 | if e != nil { 18 | t.Errorf("unexpected error fetching built-in color %s: %s", cn, e) 19 | } 20 | if reflect.DeepEqual(c, zeroCS) { 21 | t.Error("expected a colorscheme, but got back a zero value.") 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /colorschemes/solarized.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | // This is a neutral version of the Solarized 256-color palette. The exception 4 | // is that the one grey color uses the average of base0 and base00, which are 5 | // already middle of the road. 6 | func init() { 7 | register("solarized", Colorscheme{ 8 | Fg: -1, 9 | Bg: -1, 10 | 11 | BorderLabel: -1, 12 | BorderLine: 37, 13 | 14 | CPULines: []int{61, 33, 37, 64, 125, 160, 166, 136}, 15 | 16 | BattLines: []int{61, 33, 37, 64, 125, 160, 166, 136}, 17 | 18 | MemLines: []int{125, 166, 61, 33, 37, 64, 125, 160, 166, 136}, 19 | 20 | ProcCursor: 136, 21 | 22 | Sparklines: [2]int{33, 136}, 23 | 24 | DiskBar: 243, 25 | 26 | TempLow: 64, 27 | TempHigh: 160, 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /colorschemes/solarized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/colorschemes/solarized.png -------------------------------------------------------------------------------- /colorschemes/solarized16_dark.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | // This scheme assumes the terminal already uses Solarized. Only DiskBar is 4 | // different between dark/light. 5 | func init() { 6 | register("solarized16-dark", Colorscheme{ 7 | Fg: -1, 8 | Bg: -1, 9 | 10 | BorderLabel: -1, 11 | BorderLine: 6, 12 | 13 | CPULines: []int{13, 4, 6, 2, 5, 1, 9, 3}, 14 | 15 | BattLines: []int{13, 4, 6, 2, 5, 1, 9, 3}, 16 | 17 | MemLines: []int{5, 9, 13, 4, 6, 2, 1, 3}, 18 | 19 | ProcCursor: 4, 20 | 21 | Sparklines: [2]int{4, 5}, 22 | 23 | DiskBar: 12, // base0 24 | 25 | TempLow: 2, 26 | TempHigh: 1, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /colorschemes/solarized16_light.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | // This scheme assumes the terminal already uses Solarized. Only DiskBar is 4 | // different between dark/light. 5 | func init() { 6 | register("solarized16-light", Colorscheme{ 7 | Fg: -1, 8 | Bg: -1, 9 | 10 | BorderLabel: -1, 11 | BorderLine: 6, 12 | 13 | CPULines: []int{13, 4, 6, 2, 5, 1, 9, 3}, 14 | 15 | BattLines: []int{13, 4, 6, 2, 5, 1, 9, 3}, 16 | 17 | MemLines: []int{5, 9, 13, 4, 6, 2, 1, 3}, 18 | 19 | ProcCursor: 4, 20 | 21 | Sparklines: [2]int{4, 5}, 22 | 23 | DiskBar: 11, // base00 24 | 25 | TempLow: 2, 26 | TempHigh: 1, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /colorschemes/vice.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | func init() { 4 | register("vice", Colorscheme{ 5 | Fg: 231, 6 | Bg: -1, 7 | 8 | BorderLabel: 123, 9 | BorderLine: 102, 10 | 11 | CPULines: []int{212, 218, 123, 159, 229, 158, 183, 146}, 12 | 13 | BattLines: []int{212, 218, 123, 159, 229, 158, 183, 146}, 14 | 15 | MemLines: []int{201, 97, 212, 218, 123, 159, 229, 158, 183, 146}, 16 | 17 | ProcCursor: 159, 18 | 19 | Sparklines: [2]int{183, 146}, 20 | 21 | DiskBar: 158, 22 | 23 | TempLow: 49, 24 | TempHigh: 197, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /devices/cpu_cpu.go: -------------------------------------------------------------------------------- 1 | package devices 2 | 3 | import ( 4 | "fmt" 5 | 6 | psCpu "github.com/shirou/gopsutil/v3/cpu" 7 | ) 8 | 9 | func init() { 10 | f := func(cpus map[string]int, l bool) map[string]error { 11 | cpuCount, err := CpuCount() 12 | if err != nil { 13 | return nil 14 | } 15 | formatString := "CPU%1d" 16 | if cpuCount > 10 { 17 | formatString = "CPU%02d" 18 | } 19 | vals, err := psCpu.Percent(0, l) 20 | if err != nil { 21 | return map[string]error{"gopsutil": err} 22 | } 23 | for i := 0; i < len(vals); i++ { 24 | key := fmt.Sprintf(formatString, i) 25 | v := vals[i] 26 | if v > 100 { 27 | v = 100 28 | } 29 | cpus[key] = int(v) 30 | } 31 | return nil 32 | } 33 | RegisterCPU(f) 34 | } 35 | -------------------------------------------------------------------------------- /devices/cpu_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | // +build linux 3 | 4 | package devices 5 | 6 | import "github.com/shirou/gopsutil/v3/cpu" 7 | 8 | func CpuCount() (int, error) { 9 | cpuCount, err := cpu.Counts(false) 10 | if err != nil { 11 | return 0, err 12 | } 13 | if cpuCount == 0 { 14 | is, err := cpu.Info() 15 | if err != nil { 16 | return 0, err 17 | } 18 | if is[0].Cores > 0 { 19 | return len(is) / 2, nil 20 | } 21 | return len(is), nil 22 | } 23 | return cpuCount, nil 24 | } 25 | -------------------------------------------------------------------------------- /devices/cpu_other.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | package devices 5 | 6 | import "github.com/shirou/gopsutil/v3/cpu" 7 | 8 | func CpuCount() (int, error) { 9 | return cpu.Counts(false) 10 | } 11 | -------------------------------------------------------------------------------- /devices/mem.go: -------------------------------------------------------------------------------- 1 | package devices 2 | 3 | import "log" 4 | 5 | var memFuncs []func(map[string]MemoryInfo) map[string]error 6 | 7 | // TODO Colors are wrong for #mem > 2 8 | // TODO Swap memory values for remote devices is bogus 9 | type MemoryInfo struct { 10 | Total uint64 11 | Used uint64 12 | UsedPercent float64 13 | } 14 | 15 | func RegisterMem(f func(map[string]MemoryInfo) map[string]error) { 16 | memFuncs = append(memFuncs, f) 17 | } 18 | 19 | func UpdateMem(mem map[string]MemoryInfo) { 20 | for _, f := range memFuncs { 21 | errs := f(mem) 22 | if errs != nil { 23 | for k, e := range errs { 24 | log.Printf("%s: %s", k, e) 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /devices/mem_mem.go: -------------------------------------------------------------------------------- 1 | package devices 2 | 3 | import ( 4 | psMem "github.com/shirou/gopsutil/v3/mem" 5 | ) 6 | 7 | func init() { 8 | mf := func(mems map[string]MemoryInfo) map[string]error { 9 | mainMemory, err := psMem.VirtualMemory() 10 | if err != nil { 11 | return map[string]error{"Main": err} 12 | } 13 | mems["Main"] = MemoryInfo{ 14 | Total: mainMemory.Total, 15 | Used: mainMemory.Used, 16 | UsedPercent: mainMemory.UsedPercent, 17 | } 18 | return nil 19 | } 20 | RegisterMem(mf) 21 | } 22 | -------------------------------------------------------------------------------- /devices/mem_swap_other.go: -------------------------------------------------------------------------------- 1 | //go:build !freebsd 2 | // +build !freebsd 3 | 4 | package devices 5 | 6 | import ( 7 | psMem "github.com/shirou/gopsutil/v3/mem" 8 | ) 9 | 10 | func init() { 11 | mf := func(mems map[string]MemoryInfo) map[string]error { 12 | memory, err := psMem.SwapMemory() 13 | if err != nil { 14 | return map[string]error{"Swap": err} 15 | } 16 | mems["Swap"] = MemoryInfo{ 17 | Total: memory.Total, 18 | Used: memory.Used, 19 | UsedPercent: memory.UsedPercent, 20 | } 21 | return nil 22 | } 23 | RegisterMem(mf) 24 | } 25 | -------------------------------------------------------------------------------- /devices/temp.go: -------------------------------------------------------------------------------- 1 | package devices 2 | 3 | import ( 4 | "log" 5 | ) 6 | 7 | // TODO add thermal history graph. Update when something changes? 8 | 9 | var tempUpdates []func(map[string]int) map[string]error 10 | 11 | func RegisterTemp(update func(map[string]int) map[string]error) { 12 | tempUpdates = append(tempUpdates, update) 13 | } 14 | 15 | func UpdateTemps(temps map[string]int) { 16 | for _, f := range tempUpdates { 17 | errs := f(temps) 18 | if errs != nil { 19 | for k, e := range errs { 20 | log.Printf(tr.Value("error.recovfetch", "temp", k, e.Error())) 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /devices/temp_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package devices 5 | 6 | import ( 7 | psHost "github.com/shirou/gopsutil/v3/host" 8 | ) 9 | 10 | func init() { 11 | RegisterTemp(update) 12 | RegisterDeviceList(Temperatures, devs, devs) 13 | } 14 | 15 | func update(temps map[string]int) map[string]error { 16 | sensors, err := psHost.SensorsTemperatures() 17 | if err != nil { 18 | return map[string]error{"gopsutil": err} 19 | } 20 | for _, sensor := range sensors { 21 | if _, ok := temps[sensor.SensorKey]; ok { 22 | temps[sensor.SensorKey] = int(sensor.Temperature + 0.5) 23 | } 24 | } 25 | return nil 26 | } 27 | 28 | func devs() []string { 29 | sensors, err := psHost.SensorsTemperatures() 30 | if err != nil { 31 | return []string{} 32 | } 33 | rv := make([]string, 0, len(sensors)) 34 | for _, sensor := range sensors { 35 | if sensor.Temperature != 0 { 36 | rv = append(rv, sensor.SensorKey) 37 | } 38 | } 39 | return rv 40 | } 41 | -------------------------------------------------------------------------------- /docs/colorschemes.md: -------------------------------------------------------------------------------- 1 | # Colorschemes 2 | 3 | gotop ships with a few colorschemes which can be set with the `-c` flag followed by the name of one. You can find all the colorschemes in the [colorschemes folder](../colorschemes). 4 | 5 | To make a custom colorscheme, check out the [template](../colorschemes/template.go) for instructions and then use [default.json](../colorschemes/default.json) as a starter. Then put the file at `~/.config/gotop/.json` and load it with `gotop -c `. Colorschemes PR's are welcome! 6 | 7 | To list all built-in color schemes, call: 8 | 9 | ``` 10 | gotop --list colorschemes 11 | ``` 12 | 13 | -------------------------------------------------------------------------------- /docs/nvidia-extension.md: -------------------------------------------------------------------------------- 1 | # gotop NVidia extension 2 | 3 | Provides NVidia GPU data to gotop 4 | 5 | To enable it, either run gotop with the `--nvidia` flag, or add the line `nvidia=true` to `gotop.config`. 6 | 7 | ## Dependencies 8 | 9 | - [nvidia-smi](https://wiki.archlinux.org/index.php/NVIDIA/Tips_and_tricks#nvidia-smi) 10 | 11 | ## Configuration 12 | 13 | The refresh rate of NVidia data is controlled by the `nvidia-refresh` parameter in the configuration file. This is a Go `time.Duration` format, for example `2s`, `500ms`, `1m`, etc. 14 | 15 | ## Alternatives to test 16 | 17 | https://github.com/mindprince/gonvml 18 | -------------------------------------------------------------------------------- /docs/releasing.md: -------------------------------------------------------------------------------- 1 | # Current steps for a release 2 | 3 | 1. Update CHANGELOG.md 4 | 2. Tag 5 | 3. Push everything 6 | 4. Wait for the github workflows to complete 7 | 5. Download and verify the correct version of one of the binaries 8 | 6. Finish the draft release and publish. 9 | 7. ~~Notify Nix~~ -- this seems to have been automated by the Nix folks? 10 | 8. ~~Notify Homebrew~~ ~~Automated now.~~ Automation broke. Notify manually. 11 | 9. Do the Arch release. 12 | 1. cd actions/arch-package 13 | 2. VERSION=v4.1.2 ./run.sh 14 | -------------------------------------------------------------------------------- /fonts/Lat15-VGA16-braille.psf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/fonts/Lat15-VGA16-braille.psf -------------------------------------------------------------------------------- /fonts/README: -------------------------------------------------------------------------------- 1 | `Lat15-VGA16-braille.psf` is a Linux console font based on `Lat15-VGA16.psf` 2 | with additional braille and graphic block characters suitable to run gotop 3 | on the Linux console without a graphic environment. To use the braille font, 4 | just run `setfont Lat15-VGA16-braille.psf`. 5 | 6 | To rebase the braille and graphic block characters on a different 16x8 7 | psf font, use the psf2txt and txt2psf from psftools[1]. In this case, make 8 | sure the `Length:` entry in the file header is set to 512. 9 | 10 | The original `Lat15-VGA16.psf` font file was obtained from the Ubuntu 18.04 11 | console-setup-linux package[2]. Console fonts are public domain by nature[3]. 12 | 13 | 14 | [1] https://www.seasip.info/Unix/PSF/ 15 | [2] https://launchpad.net/ubuntu/bionic/amd64/console-setup-linux/1.178ubuntu2.7 16 | [3] https://launchpad.net/ubuntu/bionic/+source/console-setup/+copyright 17 | -------------------------------------------------------------------------------- /layouts/consume_test: -------------------------------------------------------------------------------- 1 | 5:cpu 6:procs 2 | mem 3 | -------------------------------------------------------------------------------- /layouts/default: -------------------------------------------------------------------------------- 1 | 2:cpu 2 | disk/1 2:mem/2 3 | temp 4 | 2:net 2:procs 5 | 6 | -------------------------------------------------------------------------------- /layouts/disk: -------------------------------------------------------------------------------- 1 | cpu 4:procs 2 | 2:disk 3 | mem 4 | -------------------------------------------------------------------------------- /layouts/htop: -------------------------------------------------------------------------------- 1 | cpu mem 2 | 2:procs 3 | net temp disk 4 | -------------------------------------------------------------------------------- /layouts/kitchensink: -------------------------------------------------------------------------------- 1 | 3:cpu/2 3:mem/1 2 | 4:temp/1 3:disk/2 3 | power 4 | 3:net 3:procs 5 | -------------------------------------------------------------------------------- /layouts/procs: -------------------------------------------------------------------------------- 1 | cpu 4:procs 2 | disk 3 | mem 4 | net 5 | 6 | -------------------------------------------------------------------------------- /logging/logging_dup2.go: -------------------------------------------------------------------------------- 1 | // +build linux,!arm64,!riscv64 openbsd,!arm64 freebsd darwin 2 | 3 | package logging 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func stderrToLogfile(logfile *os.File) { 11 | syscall.Dup2(int(logfile.Fd()), 2) 12 | } 13 | -------------------------------------------------------------------------------- /logging/logging_dup3.go: -------------------------------------------------------------------------------- 1 | // +build !freebsd,!darwin,arm64 linux,riscv64 2 | 3 | package logging 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func stderrToLogfile(logfile *os.File) { 11 | syscall.Dup3(int(logfile.Fd()), 2, 0) 12 | } 13 | -------------------------------------------------------------------------------- /logging/logging_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package logging 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.MustLoadDLL("kernel32.dll") 12 | procSetStdHandle = kernel32.MustFindProc("SetStdHandle") 13 | ) 14 | 15 | func stderrToLogfile(logfile *os.File) { 16 | // https://groups.google.com/d/msg/golang-nuts/fG8hEAs7ZXs/tahEOuCEPn0J. 17 | syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(logfile.Fd()), 2, 0) 18 | } 19 | -------------------------------------------------------------------------------- /scripts/makeDarwin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GOOS=darwin 4 | GOARCH=amd64 5 | CGO_ENABLED=1 6 | MACOSX_DEPLOYMENT_TARGET=10.10.0 7 | CC=o64-clang 8 | CXX=o64-clang++ 9 | 10 | export GOOS GOARCH CGO_ENABLED MACOSX_DEPLOYMENT_TARGET CC CXX 11 | go build -o gotop.darwin ./cmd/gotop 12 | -------------------------------------------------------------------------------- /scripts/quality.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | go test -covermode=count -coverprofile=docs/coverage.out ./... 4 | go tool cover -html=docs/coverage.out -o docs/quality.html 5 | 6 | revive -config .revive.toml ./... > docs/lint.txt 7 | 8 | abcgo -path . -sort -no-test | sed 's%^/home/ser/workspace/gotop.d/gotop/%%' > docs/abcgo.txt 9 | -------------------------------------------------------------------------------- /scripts/size.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # size.sh is used to bisect the repository and find changes that negatively 4 | # impacted the gotop binary size. It does this by building gotop and exiting 5 | # successfully if the binary size is under a defined amount. 6 | # 7 | # Example: 8 | # ``` 9 | # git bisect start 10 | # git bisect bad master 11 | # git bisect good 755037d211cc8e58e9ce43ee74a95a3036053dee 12 | # git bisect run ./size 13 | # ``` 14 | 15 | GOODSIZE=6000000 16 | 17 | # Caleb's directory structure was different from the current structure, so 18 | # we have to find the main package first. 19 | pt=$(dirname $(find . -name main.go)) 20 | # Give the executable a unique-ish name 21 | fn=gotop_$(git rev-list -1 HEAD) 22 | go build -o $fn $pt 23 | sz=$(ls -l $fn | awk '{print $5}') 24 | git checkout -- . 25 | [[ $sz -gt $GOODSIZE ]] && exit 1 26 | exit 0 27 | -------------------------------------------------------------------------------- /termui/gauge.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | import ( 4 | . "github.com/gizak/termui/v3" 5 | gizak "github.com/gizak/termui/v3/widgets" 6 | ) 7 | 8 | // LineGraph implements a line graph of data points. 9 | type Gauge struct { 10 | *gizak.Gauge 11 | } 12 | 13 | func NewGauge() *Gauge { 14 | return &Gauge{ 15 | Gauge: gizak.NewGauge(), 16 | } 17 | } 18 | 19 | func (self *Gauge) Draw(buf *Buffer) { 20 | self.Gauge.Draw(buf) 21 | self.Gauge.SetRect(self.Min.X, self.Min.Y, self.Inner.Dx(), self.Inner.Dy()) 22 | } 23 | -------------------------------------------------------------------------------- /utils/bytes.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "math" 5 | ) 6 | 7 | var ( 8 | KB = uint64(math.Pow(2, 10)) 9 | MB = uint64(math.Pow(2, 20)) 10 | GB = uint64(math.Pow(2, 30)) 11 | TB = uint64(math.Pow(2, 40)) 12 | ) 13 | 14 | func CelsiusToFahrenheit(c int) int { 15 | return c*9/5 + 32 16 | } 17 | 18 | func BytesToKB(b uint64) float64 { 19 | return float64(b) / float64(KB) 20 | } 21 | 22 | func BytesToMB(b uint64) float64 { 23 | return float64(b) / float64(MB) 24 | } 25 | 26 | func BytesToGB(b uint64) float64 { 27 | return float64(b) / float64(GB) 28 | } 29 | 30 | func BytesToTB(b uint64) float64 { 31 | return float64(b) / float64(TB) 32 | } 33 | 34 | func ConvertBytes(b uint64) (float64, string) { 35 | switch { 36 | case b < KB: 37 | return float64(b), "B" 38 | case b < MB: 39 | return BytesToKB(b), "KB" 40 | case b < GB: 41 | return BytesToMB(b), "MB" 42 | case b < TB: 43 | return BytesToGB(b), "GB" 44 | default: 45 | return BytesToTB(b), "TB" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /utils/conversions.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | func ConvertLocalizedString(s string) string { 8 | if strings.ContainsAny(s, ",") { 9 | return strings.Replace(s, ",", ".", 1) 10 | } 11 | return s 12 | } 13 | -------------------------------------------------------------------------------- /utils/math.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | func MaxInt(a, b int) int { 4 | if a > b { 5 | return a 6 | } 7 | return b 8 | } 9 | -------------------------------------------------------------------------------- /utils/runes.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | rw "github.com/mattn/go-runewidth" 5 | ) 6 | 7 | func TruncateFront(s string, w int, prefix string) string { 8 | if rw.StringWidth(s) <= w { 9 | return s 10 | } 11 | r := []rune(s) 12 | pw := rw.StringWidth(prefix) 13 | w -= pw 14 | width := 0 15 | i := len(r) - 1 16 | for ; i >= 0; i-- { 17 | cw := rw.RuneWidth(r[i]) 18 | width += cw 19 | if width > w { 20 | break 21 | } 22 | } 23 | return prefix + string(r[i+1:len(r)]) 24 | } 25 | -------------------------------------------------------------------------------- /utils/xdg.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | ) 7 | 8 | func GetConfigDir(name string) string { 9 | var basedir string 10 | if env := os.Getenv("XDG_CONFIG_HOME"); env != "" { 11 | basedir = env 12 | } else { 13 | basedir = filepath.Join(os.Getenv("HOME"), ".config") 14 | } 15 | return filepath.Join(basedir, name) 16 | } 17 | 18 | func GetLogDir(name string) string { 19 | var basedir string 20 | if env := os.Getenv("XDG_STATE_HOME"); env != "" { 21 | basedir = env 22 | } else { 23 | basedir = filepath.Join(os.Getenv("HOME"), ".local", "state") 24 | } 25 | return filepath.Join(basedir, name) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/.gitignore: -------------------------------------------------------------------------------- 1 | toml.test 2 | /toml-test 3 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0). 2 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/decode_go116.go: -------------------------------------------------------------------------------- 1 | //go:build go1.16 2 | // +build go1.16 3 | 4 | package toml 5 | 6 | import ( 7 | "io/fs" 8 | ) 9 | 10 | // DecodeFS is just like Decode, except it will automatically read the contents 11 | // of the file at `path` from a fs.FS instance. 12 | func DecodeFS(fsys fs.FS, path string, v interface{}) (MetaData, error) { 13 | fp, err := fsys.Open(path) 14 | if err != nil { 15 | return MetaData{}, err 16 | } 17 | defer fp.Close() 18 | return NewDecoder(fp).Decode(v) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/deprecated.go: -------------------------------------------------------------------------------- 1 | package toml 2 | 3 | import ( 4 | "encoding" 5 | "io" 6 | ) 7 | 8 | // Deprecated: use encoding.TextMarshaler 9 | type TextMarshaler encoding.TextMarshaler 10 | 11 | // Deprecated: use encoding.TextUnmarshaler 12 | type TextUnmarshaler encoding.TextUnmarshaler 13 | 14 | // Deprecated: use MetaData.PrimitiveDecode. 15 | func PrimitiveDecode(primValue Primitive, v interface{}) error { 16 | md := MetaData{decoded: make(map[string]struct{})} 17 | return md.unify(primValue.undecoded, rvalue(v)) 18 | } 19 | 20 | // Deprecated: use NewDecoder(reader).Decode(&value). 21 | func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { return NewDecoder(r).Decode(v) } 22 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package toml implements decoding and encoding of TOML files. 3 | 4 | This package supports TOML v1.0.0, as listed on https://toml.io 5 | 6 | There is also support for delaying decoding with the Primitive type, and 7 | querying the set of keys in a TOML document with the MetaData type. 8 | 9 | The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator, 10 | and can be used to verify if TOML document is valid. It can also be used to 11 | print the type of each key. 12 | */ 13 | package toml 14 | -------------------------------------------------------------------------------- /vendor/github.com/StackExchange/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | 8 | --- 9 | 10 | NOTE: This project is no longer being actively maintained. If you would like 11 | to become its new owner, please contact tlimoncelli at stack over flow dot com. 12 | 13 | --- 14 | -------------------------------------------------------------------------------- /vendor/github.com/VictoriaMetrics/metrics/process_metrics_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package metrics 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func writeProcessMetrics(w io.Writer) { 10 | // TODO: implement it 11 | } 12 | 13 | func writeFDMetrics(w io.Writer) { 14 | // TODO: implement it. 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .*.sw? 3 | /coverage.txt -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "settingsInheritedFrom": "VividCortex/whitesource-config@master" 3 | } -------------------------------------------------------------------------------- /vendor/github.com/VividCortex/ewma/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 15% 6 | patch: off 7 | -------------------------------------------------------------------------------- /vendor/github.com/anatol/smart.go/.clang-format: -------------------------------------------------------------------------------- 1 | ColumnLimit: 140 2 | -------------------------------------------------------------------------------- /vendor/github.com/anatol/smart.go/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/anatol/smart.go/nvme_darwin.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | unsigned int smart_nvme_open_darwin(const char *path, void **ptr); 8 | unsigned int smart_nvme_identify_darwin(void *ptr, void *buffer, unsigned int nsid); 9 | unsigned int smart_nvme_readsmart_darwin(void *ptr, void *buffer); 10 | void smart_nvme_close_darwin(void *ptr); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif -------------------------------------------------------------------------------- /vendor/github.com/anatol/smart.go/nvme_other.go: -------------------------------------------------------------------------------- 1 | // go:build !linux && !darwin 2 | //go:build !linux && !darwin 3 | // +build !linux,!darwin 4 | 5 | package smart 6 | 7 | type NVMeDevice struct{} 8 | 9 | func OpenNVMe(name string) (*NVMeDevice, error) { 10 | return nil, ErrOSUnsupported 11 | } 12 | 13 | func (d *NVMeDevice) Close() error { 14 | return ErrOSUnsupported 15 | } 16 | 17 | func (d *NVMeDevice) ReadSMART() (*NvmeSMARTLog, error) { 18 | return nil, ErrOSUnsupported 19 | } 20 | 21 | func (d *NVMeDevice) readControllerIdentifyData() (*NvmeIdentController, error) { 22 | return nil, ErrOSUnsupported 23 | } 24 | 25 | func (d *NVMeDevice) readNamespaceIdentifyData(nsid int) (*NvmeIdentNamespace, error) { 26 | return nil, ErrOSUnsupported 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/anatol/smart.go/scsi_other.go: -------------------------------------------------------------------------------- 1 | // go:build !linux 2 | //go:build !linux 3 | // +build !linux 4 | 5 | package smart 6 | 7 | func OpenScsi(name string) (*ScsiDevice, error) { 8 | return nil, ErrOSUnsupported 9 | } 10 | 11 | func (d *ScsiDevice) Close() error { 12 | return ErrOSUnsupported 13 | } 14 | 15 | func (d *ScsiDevice) Capacity() (uint64, error) { 16 | return 0, ErrOSUnsupported 17 | } 18 | 19 | func (d *ScsiDevice) Inquiry() (*ScsiInquiry, error) { 20 | return nil, ErrOSUnsupported 21 | } 22 | 23 | func (d *ScsiDevice) SerialNumber() (string, error) { 24 | return "", ErrOSUnsupported 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry-attic/jibber_jabber/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.2 4 | before_install: 5 | - go get github.com/onsi/ginkgo/... 6 | - go get github.com/onsi/gomega/... 7 | - go install github.com/onsi/ginkgo/ginkgo 8 | script: PATH=$PATH:$HOME/gopath/bin ginkgo -r . 9 | branches: 10 | only: 11 | - master 12 | -------------------------------------------------------------------------------- /vendor/github.com/cloudfoundry-attic/jibber_jabber/jibber_jabber.go: -------------------------------------------------------------------------------- 1 | package jibber_jabber 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | const ( 8 | COULD_NOT_DETECT_PACKAGE_ERROR_MESSAGE = "Could not detect Language" 9 | ) 10 | 11 | func splitLocale(locale string) (string, string) { 12 | formattedLocale := strings.Split(locale, ".")[0] 13 | formattedLocale = strings.Replace(formattedLocale, "-", "_", -1) 14 | 15 | pieces := strings.Split(formattedLocale, "_") 16 | language := pieces[0] 17 | territory := "" 18 | if len(pieces) > 1 { 19 | territory = strings.Split(formattedLocale, "_")[1] 20 | } 21 | return language, territory 22 | } 23 | -------------------------------------------------------------------------------- /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/distatus/battery/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/battery/battery* 2 | coverage.html 3 | -------------------------------------------------------------------------------- /vendor/github.com/distatus/battery/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.3 5 | - 1.4 6 | - 1.5 7 | - 1.6 8 | - 1.7 9 | - 1.8 10 | - 1.9 11 | - "1.10" 12 | - 1.11 13 | - 1.12 14 | - tip 15 | 16 | matrix: 17 | allow_failures: 18 | - go: tip 19 | -------------------------------------------------------------------------------- /vendor/github.com/droundy/goopt/.build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ev 4 | 5 | make 6 | 7 | echo build successful! 8 | -------------------------------------------------------------------------------- /vendor/github.com/droundy/goopt/.gitignore: -------------------------------------------------------------------------------- 1 | *.[865a1] 2 | *~ 3 | testit 4 | example/goopt-example 5 | test-program/test-program 6 | _obj 7 | -------------------------------------------------------------------------------- /vendor/github.com/droundy/goopt/setup-git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script is to be run in the root of the repository, and will set 4 | # up git hooks to do reasonable things. 5 | 6 | set -ev 7 | 8 | test -d git 9 | test -d .git/hooks 10 | 11 | for i in `ls git | grep -v '~'`; do 12 | echo Setting up $i hook... 13 | ln -sf ../../git/$i .git/hooks/$i 14 | done 15 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX leaves these everywhere on SMB shares 2 | ._* 3 | 4 | # Eclipse files 5 | .classpath 6 | .project 7 | .settings/** 8 | 9 | # Emacs save files 10 | *~ 11 | 12 | # Vim-related files 13 | [._]*.s[a-w][a-z] 14 | [._]s[a-w][a-z] 15 | *.un~ 16 | Session.vim 17 | .netrwhist 18 | 19 | # Go test binaries 20 | *.test 21 | -------------------------------------------------------------------------------- /vendor/github.com/ghodss/yaml/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | script: 6 | - go test 7 | - go build 8 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/alignment.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | type Alignment uint 4 | 5 | const ( 6 | AlignLeft Alignment = iota 7 | AlignCenter 8 | AlignRight 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/backend.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | package termui 6 | 7 | import ( 8 | tb "github.com/nsf/termbox-go" 9 | ) 10 | 11 | // Init initializes termbox-go and is required to render anything. 12 | // After initialization, the library must be finalized with `Close`. 13 | func Init() error { 14 | if err := tb.Init(); err != nil { 15 | return err 16 | } 17 | tb.SetInputMode(tb.InputEsc | tb.InputMouse) 18 | tb.SetOutputMode(tb.Output256) 19 | return nil 20 | } 21 | 22 | // Close closes termbox-go. 23 | func Close() { 24 | tb.Close() 25 | } 26 | 27 | func TerminalDimensions() (int, int) { 28 | tb.Sync() 29 | width, height := tb.Size() 30 | return width, height 31 | } 32 | 33 | func Clear() { 34 | tb.Clear(tb.ColorDefault, tb.Attribute(Theme.Default.Bg+1)) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/canvas.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | import ( 4 | "image" 5 | 6 | "github.com/gizak/termui/v3/drawille" 7 | ) 8 | 9 | type Canvas struct { 10 | Block 11 | drawille.Canvas 12 | } 13 | 14 | func NewCanvas() *Canvas { 15 | return &Canvas{ 16 | Block: *NewBlock(), 17 | Canvas: *drawille.NewCanvas(), 18 | } 19 | } 20 | 21 | func (self *Canvas) SetPoint(p image.Point, color Color) { 22 | self.Canvas.SetPoint(p, drawille.Color(color)) 23 | } 24 | 25 | func (self *Canvas) SetLine(p0, p1 image.Point, color Color) { 26 | self.Canvas.SetLine(p0, p1, drawille.Color(color)) 27 | } 28 | 29 | func (self *Canvas) Draw(buf *Buffer) { 30 | for point, cell := range self.Canvas.GetCells() { 31 | if point.In(self.Rectangle) { 32 | convertedCell := Cell{ 33 | cell.Rune, 34 | Style{ 35 | Color(cell.Color), 36 | ColorClear, 37 | ModifierClear, 38 | }, 39 | } 40 | buf.SetCell(convertedCell, point) 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | /* 6 | Package termui is a library for creating terminal user interfaces (TUIs) using widgets. 7 | */ 8 | package termui 9 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | package termui 6 | 7 | import ( 8 | "image" 9 | "sync" 10 | 11 | tb "github.com/nsf/termbox-go" 12 | ) 13 | 14 | type Drawable interface { 15 | GetRect() image.Rectangle 16 | SetRect(int, int, int, int) 17 | Draw(*Buffer) 18 | sync.Locker 19 | } 20 | 21 | func Render(items ...Drawable) { 22 | for _, item := range items { 23 | buf := NewBuffer(item.GetRect()) 24 | item.Lock() 25 | item.Draw(buf) 26 | item.Unlock() 27 | for point, cell := range buf.CellMap { 28 | if point.In(buf.Rectangle) { 29 | tb.SetCell( 30 | point.X, point.Y, 31 | cell.Rune, 32 | tb.Attribute(cell.Style.Fg+1)|tb.Attribute(cell.Style.Modifier), tb.Attribute(cell.Style.Bg+1), 33 | ) 34 | } 35 | } 36 | } 37 | tb.Flush() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/symbols_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | // +build !windows 6 | 7 | package termui 8 | 9 | const ( 10 | TOP_LEFT = '┌' 11 | TOP_RIGHT = '┐' 12 | BOTTOM_LEFT = '└' 13 | BOTTOM_RIGHT = '┘' 14 | 15 | VERTICAL_LINE = '│' 16 | HORIZONTAL_LINE = '─' 17 | 18 | VERTICAL_LEFT = '┤' 19 | VERTICAL_RIGHT = '├' 20 | HORIZONTAL_UP = '┴' 21 | HORIZONTAL_DOWN = '┬' 22 | 23 | QUOTA_LEFT = '«' 24 | QUOTA_RIGHT = '»' 25 | 26 | VERTICAL_DASH = '┊' 27 | HORIZONTAL_DASH = '┈' 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/symbols_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package termui 8 | 9 | const ( 10 | TOP_LEFT = '+' 11 | TOP_RIGHT = '+' 12 | BOTTOM_LEFT = '+' 13 | BOTTOM_RIGHT = '+' 14 | 15 | VERTICAL_LINE = '|' 16 | HORIZONTAL_LINE = '-' 17 | 18 | VERTICAL_LEFT = '+' 19 | VERTICAL_RIGHT = '+' 20 | HORIZONTAL_UP = '+' 21 | HORIZONTAL_DOWN = '+' 22 | 23 | QUOTA_LEFT = '<' 24 | QUOTA_RIGHT = '>' 25 | 26 | VERTICAL_DASH = '|' 27 | HORIZONTAL_DASH = '-' 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.9.x 6 | - 1.10.x 7 | - 1.11.x 8 | - tip 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type ITypeInfo struct { 6 | IUnknown 7 | } 8 | 9 | type ITypeInfoVtbl struct { 10 | IUnknownVtbl 11 | GetTypeAttr uintptr 12 | GetTypeComp uintptr 13 | GetFuncDesc uintptr 14 | GetVarDesc uintptr 15 | GetNames uintptr 16 | GetRefTypeOfImplType uintptr 17 | GetImplTypeFlags uintptr 18 | GetIDsOfNames uintptr 19 | Invoke uintptr 20 | GetDocumentation uintptr 21 | GetDllEntry uintptr 22 | GetRefTypeInfo uintptr 23 | AddressOfMember uintptr 24 | CreateInstance uintptr 25 | GetMops uintptr 26 | GetContainingTypeLib uintptr 27 | ReleaseTypeAttr uintptr 28 | ReleaseFuncDesc uintptr 29 | ReleaseVarDesc uintptr 30 | } 31 | 32 | func (v *ITypeInfo) VTable() *ITypeInfoVtbl { 33 | return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | var ( 10 | modcombase = windows.NewLazySystemDLL("combase.dll") 11 | modkernel32 = windows.NewLazySystemDLL("kernel32.dll") 12 | modole32 = windows.NewLazySystemDLL("ole32.dll") 13 | modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") 14 | moduser32 = windows.NewLazySystemDLL("user32.dll") 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm.go: -------------------------------------------------------------------------------- 1 | // +build arm 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build arm64 2 | // +build arm64 3 | 4 | package ole 5 | 6 | type VARIANT struct { 7 | VT VT // 2 8 | wReserved1 uint16 // 4 9 | wReserved2 uint16 // 6 10 | wReserved3 uint16 // 8 11 | Val int64 // 16 12 | _ [8]byte // 24 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_386.go: -------------------------------------------------------------------------------- 1 | // +build windows,386 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows,amd64 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st))) 16 | if r != 0 { 17 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 18 | } 19 | return time.Now(), errors.New("Could not convert to time, passing current time.") 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm.go: -------------------------------------------------------------------------------- 1 | // +build windows,arm 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build windows && arm64 2 | // +build windows,arm64 3 | 4 | package ole 5 | 6 | import ( 7 | "errors" 8 | "syscall" 9 | "time" 10 | "unsafe" 11 | ) 12 | 13 | // GetVariantDate converts COM Variant Time value to Go time.Time. 14 | func GetVariantDate(value uint64) (time.Time, error) { 15 | var st syscall.Systemtime 16 | v1 := uint32(value) 17 | v2 := uint32(value >> 32) 18 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 19 | if r != 0 { 20 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 21 | } 22 | return time.Now(), errors.New("Could not convert to time, passing current time.") 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/winrt_doc.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // RoInitialize 6 | func RoInitialize(thread_type uint32) (err error) { 7 | return NewError(E_NOTIMPL) 8 | } 9 | 10 | // RoActivateInstance 11 | func RoActivateInstance(clsid string) (ins *IInspectable, err error) { 12 | return nil, NewError(E_NOTIMPL) 13 | } 14 | 15 | // RoGetActivationFactory 16 | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { 17 | return nil, NewError(E_NOTIMPL) 18 | } 19 | 20 | // HString is handle string for pointers. 21 | type HString uintptr 22 | 23 | // NewHString returns a new HString for Go string. 24 | func NewHString(s string) (hstring HString, err error) { 25 | return HString(uintptr(0)), NewError(E_NOTIMPL) 26 | } 27 | 28 | // DeleteHString deletes HString. 29 | func DeleteHString(hstring HString) (err error) { 30 | return NewError(E_NOTIMPL) 31 | } 32 | 33 | // String returns Go string value of HString. 34 | func (h HString) String() string { 35 | return "" 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | coverage*.* 3 | *~ 4 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.15-buster as builder 2 | WORKDIR /go/src/github.com/jaypipes/ghw 3 | 4 | # Force the go compiler to use modules. 5 | ENV GO111MODULE=on 6 | ENV GOPROXY=direct 7 | 8 | # go.mod and go.sum go into their own layers. 9 | COPY go.mod . 10 | COPY go.sum . 11 | 12 | # This ensures `go mod download` happens only when go.mod and go.sum change. 13 | RUN go mod download 14 | 15 | COPY . . 16 | 17 | RUN CGO_ENABLED=0 go build -o ghwc ./cmd/ghwc/ 18 | 19 | FROM alpine:3.7 20 | RUN apk add --no-cache ethtool 21 | 22 | WORKDIR /bin 23 | 24 | COPY --from=builder /go/src/github.com/jaypipes/ghw/ghwc /bin 25 | 26 | CMD ghwc 27 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/baseboard/baseboard_linux.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package baseboard 7 | 8 | import ( 9 | "github.com/jaypipes/ghw/pkg/linuxdmi" 10 | ) 11 | 12 | func (i *Info) load() error { 13 | i.AssetTag = linuxdmi.Item(i.ctx, "board_asset_tag") 14 | i.SerialNumber = linuxdmi.Item(i.ctx, "board_serial") 15 | i.Vendor = linuxdmi.Item(i.ctx, "board_vendor") 16 | i.Version = linuxdmi.Item(i.ctx, "board_version") 17 | i.Product = linuxdmi.Item(i.ctx, "board_name") 18 | 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/baseboard/baseboard_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package baseboard 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("baseboardFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/bios/bios_linux.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package bios 7 | 8 | import "github.com/jaypipes/ghw/pkg/linuxdmi" 9 | 10 | func (i *Info) load() error { 11 | i.Vendor = linuxdmi.Item(i.ctx, "bios_vendor") 12 | i.Version = linuxdmi.Item(i.ctx, "bios_version") 13 | i.Date = linuxdmi.Item(i.ctx, "bios_date") 14 | 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/bios/bios_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package bios 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("biosFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/bios/bios_windows.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package bios 7 | 8 | import ( 9 | "github.com/StackExchange/wmi" 10 | ) 11 | 12 | const wqlBIOS = "SELECT InstallDate, Manufacturer, Version FROM CIM_BIOSElement" 13 | 14 | type win32BIOS struct { 15 | InstallDate *string 16 | Manufacturer *string 17 | Version *string 18 | } 19 | 20 | func (i *Info) load() error { 21 | // Getting data from WMI 22 | var win32BIOSDescriptions []win32BIOS 23 | if err := wmi.Query(wqlBIOS, &win32BIOSDescriptions); err != nil { 24 | return err 25 | } 26 | if len(win32BIOSDescriptions) > 0 { 27 | i.Vendor = *win32BIOSDescriptions[0].Manufacturer 28 | i.Version = *win32BIOSDescriptions[0].Version 29 | i.Date = *win32BIOSDescriptions[0].InstallDate 30 | } 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/block/block_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !darwin && !windows 2 | // +build !linux,!darwin,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package block 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("blockFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/chassis/chassis_linux.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package chassis 7 | 8 | import ( 9 | "github.com/jaypipes/ghw/pkg/linuxdmi" 10 | "github.com/jaypipes/ghw/pkg/util" 11 | ) 12 | 13 | func (i *Info) load() error { 14 | i.AssetTag = linuxdmi.Item(i.ctx, "chassis_asset_tag") 15 | i.SerialNumber = linuxdmi.Item(i.ctx, "chassis_serial") 16 | i.Type = linuxdmi.Item(i.ctx, "chassis_type") 17 | typeDesc, found := chassisTypeDescriptions[i.Type] 18 | if !found { 19 | typeDesc = util.UNKNOWN 20 | } 21 | i.TypeDescription = typeDesc 22 | i.Vendor = linuxdmi.Item(i.ctx, "chassis_vendor") 23 | i.Version = linuxdmi.Item(i.ctx, "chassis_version") 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/chassis/chassis_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package chassis 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("chassisFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/cpu/cpu_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package cpu 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("cpu.Info.load not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/gpu/gpu_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package gpu 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("gpuFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/linuxdmi/dmi_linux.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package linuxdmi 7 | 8 | import ( 9 | "io/ioutil" 10 | "path/filepath" 11 | "strings" 12 | 13 | "github.com/jaypipes/ghw/pkg/context" 14 | "github.com/jaypipes/ghw/pkg/linuxpath" 15 | "github.com/jaypipes/ghw/pkg/util" 16 | ) 17 | 18 | func Item(ctx *context.Context, value string) string { 19 | paths := linuxpath.New(ctx) 20 | path := filepath.Join(paths.SysClassDMI, "id", value) 21 | 22 | b, err := ioutil.ReadFile(path) 23 | if err != nil { 24 | ctx.Warn("Unable to read %s: %s\n", value, err) 25 | return util.UNKNOWN 26 | } 27 | 28 | return strings.TrimSpace(string(b)) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/memory/memory_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package memory 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("mem.Info.load not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/net/net_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package net 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("netFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/pci/pci_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package pci 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("pciFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | 21 | // GetDevice returns a pointer to a Device struct that describes the PCI 22 | // device at the requested address. If no such device could be found, returns 23 | // nil 24 | func (info *Info) GetDevice(address string) *Device { 25 | return nil 26 | } 27 | 28 | // ListDevices returns a list of pointers to Device structs present on the 29 | // host system 30 | func (info *Info) ListDevices() []*Device { 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/product/product_linux.go: -------------------------------------------------------------------------------- 1 | // Use and distribution licensed under the Apache license version 2. 2 | // 3 | // See the COPYING file in the root project directory for full text. 4 | // 5 | 6 | package product 7 | 8 | import ( 9 | "github.com/jaypipes/ghw/pkg/linuxdmi" 10 | ) 11 | 12 | func (i *Info) load() error { 13 | 14 | i.Family = linuxdmi.Item(i.ctx, "product_family") 15 | i.Name = linuxdmi.Item(i.ctx, "product_name") 16 | i.Vendor = linuxdmi.Item(i.ctx, "sys_vendor") 17 | i.SerialNumber = linuxdmi.Item(i.ctx, "product_serial") 18 | i.UUID = linuxdmi.Item(i.ctx, "product_uuid") 19 | i.SKU = linuxdmi.Item(i.ctx, "product_sku") 20 | i.Version = linuxdmi.Item(i.ctx, "product_version") 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/product/product_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package product 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("productFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_gpu_linux.go: -------------------------------------------------------------------------------- 1 | // 2 | // Use and distribution licensed under the Apache license version 2. 3 | // 4 | // See the COPYING file in the root project directory for full text. 5 | // 6 | 7 | package snapshot 8 | 9 | import ( 10 | "strings" 11 | ) 12 | 13 | // ExpectedCloneGPUContent returns a slice of strings pertaining to the GPU devices ghw 14 | // cares about. We cannot use a static list because we want to grab only the first cardX data 15 | // (see comment in pkg/gpu/gpu_linux.go) 16 | // Additionally, we want to make sure to clone the backing device data. 17 | func ExpectedCloneGPUContent() []string { 18 | cardEntries := []string{ 19 | "device", 20 | } 21 | 22 | filterName := func(cardName string) bool { 23 | if !strings.HasPrefix(cardName, "card") { 24 | return false 25 | } 26 | if strings.ContainsRune(cardName, '-') { 27 | return false 28 | } 29 | return true 30 | } 31 | 32 | return cloneContentByClass("drm", cardEntries, filterName, filterNone) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/snapshot/clonetree_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | // 5 | // Use and distribution licensed under the Apache license version 2. 6 | // 7 | // See the COPYING file in the root project directory for full text. 8 | // 9 | 10 | package snapshot 11 | 12 | func setupScratchDir(scratchDir string) error { 13 | return nil 14 | } 15 | 16 | func ExpectedCloneStaticContent() []string { 17 | return []string{} 18 | } 19 | 20 | func ExpectedCloneGPUContent() []string { 21 | return []string{} 22 | } 23 | 24 | func ExpectedCloneNetContent() []string { 25 | return []string{} 26 | } 27 | 28 | func ExpectedClonePCIContent() []string { 29 | return []string{} 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/snapshot/testdata.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxxserxxx/gotop/06c04f588c74484c25c31f1b7ce07f9fa6b512fa/vendor/github.com/jaypipes/ghw/pkg/snapshot/testdata.tar.gz -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/snapshot/trace.go: -------------------------------------------------------------------------------- 1 | // 2 | // Use and distribution licensed under the Apache license version 2. 3 | // 4 | // See the COPYING file in the root project directory for full text. 5 | // 6 | 7 | package snapshot 8 | 9 | var trace func(msg string, args ...interface{}) 10 | 11 | func init() { 12 | trace = func(msg string, args ...interface{}) {} 13 | } 14 | 15 | func SetTraceFunction(fn func(msg string, args ...interface{})) { 16 | trace = fn 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/topology/topology_stub.go: -------------------------------------------------------------------------------- 1 | //go:build !linux && !windows 2 | // +build !linux,!windows 3 | 4 | // Use and distribution licensed under the Apache license version 2. 5 | // 6 | // See the COPYING file in the root project directory for full text. 7 | // 8 | 9 | package topology 10 | 11 | import ( 12 | "runtime" 13 | 14 | "github.com/pkg/errors" 15 | ) 16 | 17 | func (i *Info) load() error { 18 | return errors.New("topologyFillInfo not implemented on " + runtime.GOOS) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/ghw/pkg/unitutil/unit.go: -------------------------------------------------------------------------------- 1 | // 2 | // Use and distribution licensed under the Apache license version 2. 3 | // 4 | // See the COPYING file in the root project directory for full text. 5 | // 6 | 7 | package unitutil 8 | 9 | var ( 10 | KB int64 = 1024 11 | MB = KB * 1024 12 | GB = MB * 1024 13 | TB = GB * 1024 14 | PB = TB * 1024 15 | EB = PB * 1024 16 | ) 17 | 18 | // AmountString returns a string representation of the amount with an amount 19 | // suffix corresponding to the nearest kibibit. 20 | // 21 | // For example, AmountString(1022) == "1022). AmountString(1024) == "1KB", etc 22 | func AmountString(size int64) (int64, string) { 23 | switch { 24 | case size < MB: 25 | return KB, "KB" 26 | case size < GB: 27 | return MB, "MB" 28 | case size < TB: 29 | return GB, "GB" 30 | case size < PB: 31 | return TB, "TB" 32 | case size < EB: 33 | return PB, "PB" 34 | default: 35 | return EB, "EB" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/jaypipes/pcidb/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | coverage*.* 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/.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 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/README.md: -------------------------------------------------------------------------------- 1 | # plan9stats 2 | A module for retrieving statistics of Plan 9 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/doc.go: -------------------------------------------------------------------------------- 1 | // Package stats provides statistic utilities for Plan 9. 2 | package stats 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/int.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type intParser struct { 8 | err error 9 | } 10 | 11 | func (p *intParser) ParseInt(s string, base int) int { 12 | if p.err != nil { 13 | return 0 14 | } 15 | var n int64 16 | n, p.err = strconv.ParseInt(s, base, 0) 17 | return int(n) 18 | } 19 | 20 | func (p *intParser) ParseInt64(s string, base int) int64 { 21 | if p.err != nil { 22 | return 0 23 | } 24 | var n int64 25 | n, p.err = strconv.ParseInt(s, base, 64) 26 | return n 27 | } 28 | 29 | func (p *intParser) Err() error { 30 | return p.err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/opts.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | type Config struct { 4 | rootdir string 5 | } 6 | 7 | type Option func(*Config) 8 | 9 | func newConfig(opts ...Option) *Config { 10 | var cfg Config 11 | for _, opt := range opts { 12 | opt(&cfg) 13 | } 14 | return &cfg 15 | } 16 | 17 | func WithRootDir(dir string) Option { 18 | return func(cfg *Config) { 19 | cfg.rootdir = dir 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.13.x 5 | - tip 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | 10 | script: 11 | - go generate 12 | - git diff --cached --exit-code 13 | - ./go.test.sh 14 | 15 | after_success: 16 | - bash <(curl -s https://codecov.io/bash) 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.md: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) 5 | [![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package runewidth 4 | 5 | // IsEastAsian return true if the current locale is CJK 6 | func IsEastAsian() bool { 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | // +build !appengine 3 | 4 | package runewidth 5 | 6 | func IsEastAsian() bool { 7 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package runewidth 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.NewLazyDLL("kernel32") 12 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 13 | ) 14 | 15 | // IsEastAsian return true if the current locale is CJK 16 | func IsEastAsian() bool { 17 | r1, _, _ := procGetConsoleOutputCP.Call() 18 | if r1 == 0 { 19 | return false 20 | } 21 | 22 | switch int(r1) { 23 | case 932, 51932, 936, 949, 950: 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/README.md: -------------------------------------------------------------------------------- 1 | # go-homedir 2 | 3 | This is a Go library for detecting the user's home directory without 4 | the use of cgo, so the library can be used in cross-compilation environments. 5 | 6 | Usage is incredibly simple, just call `homedir.Dir()` to get the home directory 7 | for a user, and `homedir.Expand()` to expand the `~` in a path to the home 8 | directory. 9 | 10 | **Why not just use `os/user`?** The built-in `os/user` package requires 11 | cgo on Darwin systems. This means that any Go code that uses that package 12 | cannot cross compile. But 99% of the time the use for `os/user` is just to 13 | retrieve the home directory, which we can do for the current user without 14 | cgo. This library does that, enabling cross-compilation. 15 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/AUTHORS: -------------------------------------------------------------------------------- 1 | # Please keep this file sorted. 2 | 3 | Georg Reinke 4 | nsf 5 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/escwait.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package termbox 4 | 5 | // On all systems other than macOS, disable behavior which will wait before 6 | // deciding that the escape key was pressed, to account for partially send 7 | // escape sequences, especially with regard to lengthy mouse sequences. 8 | // See https://github.com/nsf/termbox-go/issues/132 9 | func enable_wait_for_escape_sequence() bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/escwait_darwin.go: -------------------------------------------------------------------------------- 1 | package termbox 2 | 3 | // On macOS, enable behavior which will wait before deciding that the escape 4 | // key was pressed, to account for partially send escape sequences, especially 5 | // with regard to lengthy mouse sequences. 6 | // See https://github.com/nsf/termbox-go/issues/132 7 | func enable_wait_for_escape_sequence() bool { 8 | return true 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_darwin.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | // +build !amd64 5 | 6 | package termbox 7 | 8 | type syscall_Termios struct { 9 | Iflag uint32 10 | Oflag uint32 11 | Cflag uint32 12 | Lflag uint32 13 | Cc [20]uint8 14 | Ispeed uint32 15 | Ospeed uint32 16 | } 17 | 18 | const ( 19 | syscall_IGNBRK = 0x1 20 | syscall_BRKINT = 0x2 21 | syscall_PARMRK = 0x8 22 | syscall_ISTRIP = 0x20 23 | syscall_INLCR = 0x40 24 | syscall_IGNCR = 0x80 25 | syscall_ICRNL = 0x100 26 | syscall_IXON = 0x200 27 | syscall_OPOST = 0x1 28 | syscall_ECHO = 0x8 29 | syscall_ECHONL = 0x10 30 | syscall_ICANON = 0x100 31 | syscall_ISIG = 0x80 32 | syscall_IEXTEN = 0x400 33 | syscall_CSIZE = 0x300 34 | syscall_PARENB = 0x1000 35 | syscall_CS8 = 0x300 36 | syscall_VMIN = 0x10 37 | syscall_VTIME = 0x11 38 | 39 | syscall_TCGETS = 0x402c7413 40 | syscall_TCSETS = 0x802c7414 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint64 8 | Oflag uint64 9 | Cflag uint64 10 | Lflag uint64 11 | Cc [20]uint8 12 | Pad_cgo_0 [4]byte 13 | Ispeed uint64 14 | Ospeed uint64 15 | } 16 | 17 | const ( 18 | syscall_IGNBRK = 0x1 19 | syscall_BRKINT = 0x2 20 | syscall_PARMRK = 0x8 21 | syscall_ISTRIP = 0x20 22 | syscall_INLCR = 0x40 23 | syscall_IGNCR = 0x80 24 | syscall_ICRNL = 0x100 25 | syscall_IXON = 0x200 26 | syscall_OPOST = 0x1 27 | syscall_ECHO = 0x8 28 | syscall_ECHONL = 0x10 29 | syscall_ICANON = 0x100 30 | syscall_ISIG = 0x80 31 | syscall_IEXTEN = 0x400 32 | syscall_CSIZE = 0x300 33 | syscall_PARENB = 0x1000 34 | syscall_CS8 = 0x300 35 | syscall_VMIN = 0x10 36 | syscall_VTIME = 0x11 37 | 38 | syscall_TCGETS = 0x40487413 39 | syscall_TCSETS = 0x80487414 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed uint32 13 | Ospeed uint32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_freebsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed uint32 13 | Ospeed uint32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_linux.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | import "syscall" 7 | 8 | type syscall_Termios syscall.Termios 9 | 10 | const ( 11 | syscall_IGNBRK = syscall.IGNBRK 12 | syscall_BRKINT = syscall.BRKINT 13 | syscall_PARMRK = syscall.PARMRK 14 | syscall_ISTRIP = syscall.ISTRIP 15 | syscall_INLCR = syscall.INLCR 16 | syscall_IGNCR = syscall.IGNCR 17 | syscall_ICRNL = syscall.ICRNL 18 | syscall_IXON = syscall.IXON 19 | syscall_OPOST = syscall.OPOST 20 | syscall_ECHO = syscall.ECHO 21 | syscall_ECHONL = syscall.ECHONL 22 | syscall_ICANON = syscall.ICANON 23 | syscall_ISIG = syscall.ISIG 24 | syscall_IEXTEN = syscall.IEXTEN 25 | syscall_CSIZE = syscall.CSIZE 26 | syscall_PARENB = syscall.PARENB 27 | syscall_CS8 = syscall.CS8 28 | syscall_VMIN = syscall.VMIN 29 | syscall_VTIME = syscall.VTIME 30 | 31 | syscall_TCGETS = syscall.TCGETS 32 | syscall_TCSETS = syscall.TCSETS 33 | ) 34 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_netbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed int32 13 | Ospeed int32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_openbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed int32 13 | Ospeed int32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/config.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #cgo LDFLAGS: -lperfstat 7 | 8 | #include 9 | */ 10 | import "C" 11 | 12 | func EnableLVMStat() { 13 | C.perfstat_config(C.PERFSTAT_ENABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 14 | } 15 | 16 | func DisableLVMStat() { 17 | C.perfstat_config(C.PERFSTAT_DISABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/fsstat.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #include "c_helpers.h" 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | ) 13 | 14 | func FileSystemStat() ([]FileSystem, error) { 15 | var fsinfo *C.struct_fsinfo 16 | var nmounts C.int 17 | 18 | fsinfo = C.get_all_fs(&nmounts) 19 | if nmounts <= 0 { 20 | return nil, fmt.Errorf("No mounts found") 21 | } 22 | 23 | fs := make([]FileSystem, nmounts) 24 | for i := 0; i < int(nmounts); i++ { 25 | f := C.get_filesystem_stat(fsinfo, C.int(i)) 26 | if f != nil { 27 | fs[i] = fsinfo2filesystem(f) 28 | } 29 | } 30 | return fs, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/lparstat.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #cgo LDFLAGS: -lperfstat 7 | 8 | #include 9 | */ 10 | import "C" 11 | 12 | import ( 13 | "fmt" 14 | ) 15 | 16 | func PartitionStat() (*PartitionConfig, error) { 17 | var part C.perfstat_partition_config_t 18 | 19 | rc := C.perfstat_partition_config(nil, &part, C.sizeof_perfstat_partition_config_t, 1) 20 | if rc != 1 { 21 | return nil, fmt.Errorf("perfstat_partition_config() error") 22 | } 23 | p := perfstatpartitionconfig2partitionconfig(part) 24 | return &p, nil 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/uptime.go: -------------------------------------------------------------------------------- 1 | // +build aix 2 | 3 | package perfstat 4 | 5 | /* 6 | #include "c_helpers.h" 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "time" 13 | ) 14 | 15 | func timeSince(ts uint64) uint64 { 16 | return uint64(time.Now().Unix()) - ts 17 | } 18 | 19 | // BootTime() returns the time of the last boot in UNIX seconds 20 | func BootTime() (uint64, error) { 21 | sec := C.boottime() 22 | if sec == -1 { 23 | return 0, fmt.Errorf("Can't determine boot time") 24 | } 25 | return uint64(sec), nil 26 | } 27 | 28 | // UptimeSeconds() calculates uptime in seconds 29 | func UptimeSeconds() (uint64, error) { 30 | boot, err := BootTime() 31 | if err != nil { 32 | return 0, err 33 | } 34 | return timeSince(boot), nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package uniseg implements Unicode Text Segmentation according to Unicode 3 | Standard Annex #29 (http://unicode.org/reports/tr29/). 4 | 5 | At this point, only the determination of grapheme cluster boundaries is 6 | implemented. 7 | */ 8 | package uniseg 9 | -------------------------------------------------------------------------------- /vendor/github.com/shibukawa/configdir/config_darwin.go: -------------------------------------------------------------------------------- 1 | package configdir 2 | 3 | import "os" 4 | 5 | var hasVendorName = true 6 | var systemSettingFolders = []string{"/Library/Application Support"} 7 | var globalSettingFolder = os.Getenv("HOME") + "/Library/Application Support" 8 | var cacheFolder = os.Getenv("HOME") + "/Library/Caches" 9 | -------------------------------------------------------------------------------- /vendor/github.com/shibukawa/configdir/config_windows.go: -------------------------------------------------------------------------------- 1 | package configdir 2 | 3 | import "os" 4 | 5 | var hasVendorName = true 6 | var systemSettingFolders = []string{os.Getenv("PROGRAMDATA")} 7 | var globalSettingFolder = os.Getenv("APPDATA") 8 | var cacheFolder = os.Getenv("LOCALAPPDATA") 9 | -------------------------------------------------------------------------------- /vendor/github.com/shibukawa/configdir/config_xdg.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!darwin 2 | 3 | package configdir 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | "strings" 9 | ) 10 | 11 | // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html 12 | 13 | var hasVendorName = true 14 | var systemSettingFolders []string 15 | var globalSettingFolder string 16 | var cacheFolder string 17 | 18 | func init() { 19 | if os.Getenv("XDG_CONFIG_HOME") != "" { 20 | globalSettingFolder = os.Getenv("XDG_CONFIG_HOME") 21 | } else { 22 | globalSettingFolder = filepath.Join(os.Getenv("HOME"), ".config") 23 | } 24 | if os.Getenv("XDG_CONFIG_DIRS") != "" { 25 | systemSettingFolders = strings.Split(os.Getenv("XDG_CONFIG_DIRS"), ":") 26 | } else { 27 | systemSettingFolders = []string{"/etc/xdg"} 28 | } 29 | if os.Getenv("XDG_CACHE_HOME") != "" { 30 | cacheFolder = os.Getenv("XDG_CACHE_HOME") 31 | } else { 32 | cacheFolder = filepath.Join(os.Getenv("HOME"), ".cache") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/common/env.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | type EnvKeyType string 4 | 5 | // EnvKey is a context key that can be used to set programmatically the environment 6 | // gopsutil relies on to perform calls against the OS. 7 | // Example of use: 8 | // 9 | // ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"}) 10 | // avg, err := load.AvgWithContext(ctx) 11 | var EnvKey = EnvKeyType("env") 12 | 13 | const ( 14 | HostProcEnvKey EnvKeyType = "HOST_PROC" 15 | HostSysEnvKey EnvKeyType = "HOST_SYS" 16 | HostEtcEnvKey EnvKeyType = "HOST_ETC" 17 | HostVarEnvKey EnvKeyType = "HOST_VAR" 18 | HostRunEnvKey EnvKeyType = "HOST_RUN" 19 | HostDevEnvKey EnvKeyType = "HOST_DEV" 20 | HostRootEnvKey EnvKeyType = "HOST_ROOT" 21 | ) 22 | 23 | type EnvMap map[EnvKeyType]string 24 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | ) 9 | 10 | func Times(percpu bool) ([]TimesStat, error) { 11 | return TimesWithContext(context.Background(), percpu) 12 | } 13 | 14 | func Info() ([]InfoStat, error) { 15 | return InfoWithContext(context.Background()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && !cgo 2 | // +build darwin,!cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/v3/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix 2 | // +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!dragonfly,!plan9,!aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | "runtime" 9 | 10 | "github.com/shirou/gopsutil/v3/internal/common" 11 | ) 12 | 13 | func Times(percpu bool) ([]TimesStat, error) { 14 | return TimesWithContext(context.Background(), percpu) 15 | } 16 | 17 | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { 18 | return []TimesStat{}, common.ErrNotImplementedError 19 | } 20 | 21 | func Info() ([]InfoStat, error) { 22 | return InfoWithContext(context.Background()) 23 | } 24 | 25 | func InfoWithContext(ctx context.Context) ([]InfoStat, error) { 26 | return []InfoStat{}, common.ErrNotImplementedError 27 | } 28 | 29 | func CountsWithContext(ctx context.Context, logical bool) (int, error) { 30 | return runtime.NumCPU(), nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Spin uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Spin uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Spin uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin && !cgo) || ios 2 | // +build darwin,!cgo ios 3 | 4 | package disk 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v3/internal/common" 10 | ) 11 | 12 | func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { 13 | return nil, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_openbsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && 386 2 | // +build openbsd,386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x60 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int32 35 | } 36 | 37 | type Diskstat struct{} 38 | type bintime struct{} 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_openbsd.go 3 | 4 | package disk 5 | 6 | const ( 7 | devstat_NO_DATA = 0x00 8 | devstat_READ = 0x01 9 | devstat_WRITE = 0x02 10 | devstat_FREE = 0x03 11 | ) 12 | 13 | const ( 14 | sizeOfDiskstats = 0x70 15 | ) 16 | 17 | type Diskstats struct { 18 | Name [16]int8 19 | Busy int32 20 | Pad_cgo_0 [4]byte 21 | Rxfer uint64 22 | Wxfer uint64 23 | Seek uint64 24 | Rbytes uint64 25 | Wbytes uint64 26 | Attachtime Timeval 27 | Timestamp Timeval 28 | Time Timeval 29 | } 30 | type Timeval struct { 31 | Sec int64 32 | Usec int64 33 | } 34 | 35 | type Diskstat struct{} 36 | type bintime struct{} 37 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm 2 | // +build openbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x60 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int32 35 | } 36 | 37 | type Diskstat struct{} 38 | type bintime struct{} 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm64 2 | // +build openbsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x70 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int64 35 | } 36 | 37 | type Diskstat struct{} 38 | type bintime struct{} 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/disk_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && riscv64 2 | // +build openbsd,riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x70 18 | ) 19 | 20 | type ( 21 | Diskstats struct { 22 | Name [16]int8 23 | Busy int32 24 | Rxfer uint64 25 | Wxfer uint64 26 | Seek uint64 27 | Rbytes uint64 28 | Wbytes uint64 29 | Attachtime Timeval 30 | Timestamp Timeval 31 | Time Timeval 32 | } 33 | Timeval struct { 34 | Sec int64 35 | Usec int64 36 | } 37 | ) 38 | 39 | type Diskstat struct{} 40 | type bintime struct{} 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/disk/iostat_darwin.h: -------------------------------------------------------------------------------- 1 | // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h 2 | typedef struct DriveStats DriveStats; 3 | typedef struct CPUStats CPUStats; 4 | 5 | enum { 6 | NDRIVE = 16, 7 | NAMELEN = 31 8 | }; 9 | 10 | struct DriveStats { 11 | char name[NAMELEN+1]; 12 | int64_t size; 13 | int64_t blocksize; 14 | 15 | int64_t read; 16 | int64_t written; 17 | int64_t nread; 18 | int64_t nwrite; 19 | int64_t readtime; 20 | int64_t writetime; 21 | int64_t readlat; 22 | int64_t writelat; 23 | }; 24 | 25 | struct CPUStats { 26 | natural_t user; 27 | natural_t nice; 28 | natural_t sys; 29 | natural_t idle; 30 | }; 31 | 32 | extern int gopsutil_v3_readdrivestat(DriveStats a[], int n); 33 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || freebsd || openbsd || netbsd 2 | // +build darwin freebsd openbsd netbsd 3 | 4 | package host 5 | 6 | import ( 7 | "context" 8 | "sync/atomic" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // cachedBootTime must be accessed via atomic.Load/StoreUint64 14 | var cachedBootTime uint64 15 | 16 | func BootTimeWithContext(ctx context.Context) (uint64, error) { 17 | if enableBootTimeCache { 18 | t := atomic.LoadUint64(&cachedBootTime) 19 | if t != 0 { 20 | return t, nil 21 | } 22 | } 23 | tv, err := unix.SysctlTimeval("kern.boottime") 24 | if err != nil { 25 | return 0, err 26 | } 27 | 28 | if enableBootTimeCache { 29 | atomic.StoreUint64(&cachedBootTime, uint64(tv.Sec)) 30 | } 31 | 32 | return uint64(tv.Sec), nil 33 | } 34 | 35 | func UptimeWithContext(ctx context.Context) (uint64, error) { 36 | boot, err := BootTimeWithContext(ctx) 37 | if err != nil { 38 | return 0, err 39 | } 40 | return timeSince(boot), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | 18 | type Timeval struct { 19 | Sec int32 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && arm64 2 | // +build darwin,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_darwin.go 6 | 7 | package host 8 | 9 | type Utmpx struct { 10 | User [256]int8 11 | Id [4]int8 12 | Line [32]int8 13 | Pid int32 14 | Type int16 15 | Tv Timeval 16 | Host [256]int8 17 | Pad [16]uint32 18 | } 19 | type Timeval struct { 20 | Sec int64 21 | Usec int32 22 | Pad_cgo_0 [4]byte 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build darwin && !cgo 2 | // +build darwin,!cgo 3 | 4 | package host 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v3/internal/common" 10 | ) 11 | 12 | func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { 13 | return []TemperatureStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 0xc5 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type uint8 31 | Tv uint64 32 | Id [8]int8 33 | Pid uint32 34 | User [32]int8 35 | Line [16]int8 36 | Host [128]int8 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build freebsd && arm64 2 | // +build freebsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_freebsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmpx = 0xc5 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [16]int8 28 | Host [16]int8 29 | Time int32 30 | } 31 | 32 | type Utmpx struct { 33 | Type uint8 34 | Tv uint64 35 | Id [8]int8 36 | Pid uint32 37 | User [32]int8 38 | Line [16]int8 39 | Host [128]int8 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && 386 2 | // +build openbsd,386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x130 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [32]int8 25 | Host [256]int8 26 | Time int64 27 | } 28 | 29 | type Timeval struct { 30 | Sec int64 31 | Usec int64 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm 2 | // +build openbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm64 2 | // +build openbsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int64 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && riscv64 2 | // +build openbsd,riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type ( 26 | Utmp struct { 27 | Line [8]int8 28 | Name [32]int8 29 | Host [256]int8 30 | Time int64 31 | } 32 | Timeval struct { 33 | Sec int64 34 | Usec int64 35 | } 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/host/host_posix.go: -------------------------------------------------------------------------------- 1 | //go:build linux || freebsd || openbsd || netbsd || darwin || solaris 2 | // +build linux freebsd openbsd netbsd darwin solaris 3 | 4 | package host 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | func KernelArch() (string, error) { 9 | var utsname unix.Utsname 10 | err := unix.Uname(&utsname) 11 | if err != nil { 12 | return "", err 13 | } 14 | return unix.ByteSliceToString(utsname.Machine[:]), nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "unsafe" 4 | 5 | // IsLittleEndian checks if the current platform uses little-endian. 6 | // copied from https://github.com/ntrrg/ntgo/blob/v0.8.0/runtime/infrastructure.go#L16 (MIT License) 7 | func IsLittleEndian() bool { 8 | var x int16 = 0x0011 9 | return *(*byte)(unsafe.Pointer(&x)) == 0x11 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/sleep.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "context" 5 | "time" 6 | ) 7 | 8 | // Sleep awaits for provided interval. 9 | // Can be interrupted by context cancellation. 10 | func Sleep(ctx context.Context, interval time.Duration) error { 11 | timer := time.NewTimer(interval) 12 | select { 13 | case <-ctx.Done(): 14 | if !timer.Stop() { 15 | <-timer.C 16 | } 17 | return ctx.Err() 18 | case <-timer.C: 19 | return nil 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/internal/common/warnings.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "fmt" 4 | 5 | type Warnings struct { 6 | List []error 7 | Verbose bool 8 | } 9 | 10 | func (w *Warnings) Add(err error) { 11 | w.List = append(w.List, err) 12 | } 13 | 14 | func (w *Warnings) Reference() error { 15 | if len(w.List) > 0 { 16 | return w 17 | } 18 | return nil 19 | } 20 | 21 | func (w *Warnings) Error() string { 22 | if w.Verbose { 23 | str := "" 24 | for i, e := range w.List { 25 | str += fmt.Sprintf("\tError %d: %s\n", i, e.Error()) 26 | } 27 | return str 28 | } 29 | return fmt.Sprintf("Number of warnings: %v", len(w.List)) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_aix.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package mem 5 | 6 | import ( 7 | "context" 8 | ) 9 | 10 | func VirtualMemory() (*VirtualMemoryStat, error) { 11 | return VirtualMemoryWithContext(context.Background()) 12 | } 13 | 14 | func SwapMemory() (*SwapMemoryStat, error) { 15 | return SwapMemoryWithContext(context.Background()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_386.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && 386 2 | // +build openbsd,386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package mem 5 | 6 | const ( 7 | CTLVfs = 10 8 | VfsGeneric = 0 9 | VfsBcacheStat = 3 10 | ) 11 | 12 | const ( 13 | sizeOfBcachestats = 0x78 14 | ) 15 | 16 | type Bcachestats struct { 17 | Numbufs int64 18 | Numbufpages int64 19 | Numdirtypages int64 20 | Numcleanpages int64 21 | Pendingwrites int64 22 | Pendingreads int64 23 | Numwrites int64 24 | Numreads int64 25 | Cachehits int64 26 | Busymapped int64 27 | Dmapages int64 28 | Highpages int64 29 | Delwribufs int64 30 | Kvaslots int64 31 | Avail int64 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm 2 | // +build openbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && arm64 2 | // +build openbsd,arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | //go:build openbsd && riscv64 2 | // +build openbsd,riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_aix_cgo.go: -------------------------------------------------------------------------------- 1 | //go:build aix && cgo 2 | // +build aix,cgo 3 | 4 | package net 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/power-devops/perfstat" 10 | ) 11 | 12 | func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { 13 | ifs, err := perfstat.NetIfaceStat() 14 | if err != nil { 15 | return nil, err 16 | } 17 | 18 | iocounters := make([]IOCountersStat, 0, len(ifs)) 19 | for _, netif := range ifs { 20 | n := IOCountersStat{ 21 | Name: netif.Name, 22 | BytesSent: uint64(netif.OBytes), 23 | BytesRecv: uint64(netif.IBytes), 24 | PacketsSent: uint64(netif.OPackets), 25 | PacketsRecv: uint64(netif.IPackets), 26 | Errin: uint64(netif.OErrors), 27 | Errout: uint64(netif.IErrors), 28 | Dropout: uint64(netif.XmitDrops), 29 | } 30 | iocounters = append(iocounters, n) 31 | } 32 | if pernic == false { 33 | return getIOCountersAll(iocounters) 34 | } 35 | return iocounters, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.16 2 | // +build !go1.16 3 | 4 | package net 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | func readDir(f *os.File, max int) ([]os.FileInfo, error) { 11 | return f.Readdir(max) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go: -------------------------------------------------------------------------------- 1 | //go:build go1.16 2 | // +build go1.16 3 | 4 | package net 5 | 6 | import ( 7 | "os" 8 | ) 9 | 10 | func readDir(f *os.File, max int) ([]os.DirEntry, error) { 11 | return f.ReadDir(max) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/shoenig/go-m1cpu/.golangci.yaml: -------------------------------------------------------------------------------- 1 | run: 2 | timeout: 5m 3 | linters: 4 | enable: 5 | - gofmt 6 | - errcheck 7 | - errname 8 | - errorlint 9 | - bodyclose 10 | - durationcheck 11 | - whitespace 12 | 13 | -------------------------------------------------------------------------------- /vendor/github.com/shoenig/go-m1cpu/Makefile: -------------------------------------------------------------------------------- 1 | SHELL = bash 2 | 3 | default: test 4 | 5 | .PHONY: test 6 | test: 7 | @echo "--> Running Tests ..." 8 | @go test -v -race ./... 9 | 10 | vet: 11 | @echo "--> Vet Go sources ..." 12 | @go vet ./... 13 | -------------------------------------------------------------------------------- /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/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/tklauser/go-sysconf/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.20 4 | 5 | freebsd_12_task: 6 | freebsd_instance: 7 | image_family: freebsd-12-3 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -v ./... 13 | test_script: bin/${GO_VERSION} test -race ./... 14 | 15 | freebsd_13_task: 16 | freebsd_instance: 17 | image_family: freebsd-13-0 18 | install_script: | 19 | pkg install -y go 20 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 21 | bin/${GO_VERSION} download 22 | build_script: bin/${GO_VERSION} build -v ./... 23 | test_script: bin/${GO_VERSION} test -race ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. All rights reserved. 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 sysconf implements the sysconf(3) function and provides the 6 | // associated SC_* constants to query system configuration values. 7 | package sysconf 8 | 9 | import "errors" 10 | 11 | //go:generate go run mksysconf.go 12 | 13 | var errInvalid = errors.New("invalid parameter value") 14 | 15 | // Sysconf returns the value of a sysconf(3) runtime system parameter. 16 | // The name parameter should be a SC_* constant define in this package. The 17 | // implementation is GOOS-specific and certain SC_* constants might not be 18 | // defined for all GOOSes. 19 | func Sysconf(name int) (int64, error) { 20 | return sysconf(name) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | 8 | package sysconf 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | func pathconf(path string, name int) int64 { 13 | if val, err := unix.Pathconf(path, name); err == nil { 14 | return int64(val) 15 | } 16 | return -1 17 | } 18 | 19 | func sysctl32(name string) int64 { 20 | if val, err := unix.SysctlUint32(name); err == nil { 21 | return int64(val) 22 | } 23 | return -1 24 | } 25 | 26 | func sysctl64(name string) int64 { 27 | if val, err := unix.SysctlUint64(name); err == nil { 28 | return int64(val) 29 | } 30 | return -1 31 | } 32 | 33 | func yesno(val int64) int64 { 34 | if val == 0 { 35 | return -1 36 | } 37 | return val 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 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 sysconf 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | func sysconf(name int) (int64, error) { 10 | if name < 0 { 11 | return -1, errInvalid 12 | } 13 | return unix.Sysconf(name) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 2 | // Use 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 6 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 7 | 8 | package sysconf 9 | 10 | import ( 11 | "fmt" 12 | "runtime" 13 | ) 14 | 15 | func sysconf(name int) (int64, error) { 16 | return -1, fmt.Errorf("unsupported on %s", runtime.GOOS) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && 386 5 | // +build freebsd,386 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && amd64 5 | // +build freebsd,amd64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm 5 | // +build freebsd,arm 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm64 5 | // +build freebsd,arm64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && riscv64 5 | // +build freebsd,riscv64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | _SHRT_MAX = 0x7fff 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && 386 5 | // +build netbsd,386 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && amd64 5 | // +build netbsd,amd64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm 5 | // +build netbsd,arm 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm64 5 | // +build netbsd,arm64 6 | 7 | package sysconf 8 | 9 | const ( 10 | _LONG_MAX = 0x7fffffffffffffff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/numcpus/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.20 4 | 5 | freebsd_12_task: 6 | freebsd_instance: 7 | image_family: freebsd-12-3 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -buildvcs=false -v ./... 13 | test_script: bin/${GO_VERSION} test -buildvcs=false -race ./... 14 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/fastrand/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.7 5 | - 1.8 6 | 7 | script: 8 | # build test for supported platforms 9 | - GOOS=linux go build 10 | - GOOS=darwin go build 11 | - GOOS=freebsd go build 12 | - GOARCH=386 go build 13 | 14 | # run tests on a standard platform 15 | - go test -v ./... 16 | 17 | -------------------------------------------------------------------------------- /vendor/github.com/valyala/histogram/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/valyala/histogram?status.svg)](http://godoc.org/github.com/valyala/histogram) 2 | [![Go Report](https://goreportcard.com/badge/github.com/valyala/histogram)](https://goreportcard.com/report/github.com/valyala/histogram) 3 | 4 | 5 | # histogram 6 | 7 | Fast histograms for Go. 8 | 9 | See [docs](https://godoc.org/github.com/valyala/histogram). 10 | -------------------------------------------------------------------------------- /vendor/github.com/yusufpapurcu/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | 15 | func ioctl(fd int, req uint, arg uintptr) (err error) { 16 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 17 | if r0 == -1 && er != nil { 18 | err = er 19 | } 20 | return 21 | } 22 | 23 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 24 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 25 | if r0 == -1 && er != nil { 26 | err = er 27 | } 28 | return 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && !race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/mksyscall.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 generate 6 | 7 | package registry 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_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_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/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "1.14.x" 15 | - "tip" 16 | 17 | go_import_path: gopkg.in/yaml.v2 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.wasm 8 | 9 | # Test binary, built with `go test -c` 10 | *.test 11 | 12 | # Output of the go coverage tool, specifically when used with LiteIDE 13 | *.out 14 | 15 | # Dependency directories (remove the comment below to include it) 16 | # vendor/ 17 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: golang:alpine 2 | stages: 3 | - test 4 | 5 | variables: 6 | GO_PACKAGE: "howett.net/plist" 7 | 8 | before_script: 9 | - "mkdir -p $(dirname $GOPATH/src/$GO_PACKAGE)" 10 | - "ln -s $(pwd) $GOPATH/src/$GO_PACKAGE" 11 | - "cd $GOPATH/src/$GO_PACKAGE" 12 | 13 | .template:go-test: &template-go-test 14 | stage: test 15 | script: 16 | - go test 17 | 18 | go-test-cover:latest: 19 | stage: test 20 | script: 21 | - go test -v -cover 22 | coverage: '/^coverage: \d+\.\d+/' 23 | 24 | go-test-appengine:latest: 25 | stage: test 26 | script: 27 | - go test -tags appengine 28 | 29 | go-test:1.6: 30 | <<: *template-go-test 31 | image: golang:1.6-alpine 32 | 33 | go-test:1.4: 34 | <<: *template-go-test 35 | image: golang:1.4-alpine 36 | 37 | go-test:1.2: 38 | <<: *template-go-test 39 | image: golang:1.2 40 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/README.md: -------------------------------------------------------------------------------- 1 | # plist - A pure Go property list transcoder [![coverage report](https://gitlab.howett.net/go/plist/badges/main/coverage.svg)](https://gitlab.howett.net/go/plist/commits/main) 2 | ## INSTALL 3 | ``` 4 | $ go get howett.net/plist 5 | ``` 6 | 7 | ## FEATURES 8 | * Supports encoding/decoding property lists (Apple XML, Apple Binary, OpenStep and GNUStep) from/to arbitrary Go types 9 | 10 | ## USE 11 | ```go 12 | package main 13 | import ( 14 | "howett.net/plist" 15 | "os" 16 | ) 17 | func main() { 18 | encoder := plist.NewEncoder(os.Stdout) 19 | encoder.Encode(map[string]string{"hello": "world"}) 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/bplist.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | type bplistTrailer struct { 4 | Unused [5]uint8 5 | SortVersion uint8 6 | OffsetIntSize uint8 7 | ObjectRefSize uint8 8 | NumObjects uint64 9 | TopObject uint64 10 | OffsetTableOffset uint64 11 | } 12 | 13 | const ( 14 | bpTagNull uint8 = 0x00 15 | bpTagBoolFalse = 0x08 16 | bpTagBoolTrue = 0x09 17 | bpTagInteger = 0x10 18 | bpTagReal = 0x20 19 | bpTagDate = 0x30 20 | bpTagData = 0x40 21 | bpTagASCIIString = 0x50 22 | bpTagUTF16String = 0x60 23 | bpTagUID = 0x80 24 | bpTagArray = 0xA0 25 | bpTagDictionary = 0xD0 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/doc.go: -------------------------------------------------------------------------------- 1 | // Package plist implements encoding and decoding of Apple's "property list" format. 2 | // Property lists come in three sorts: plain text (GNUStep and OpenStep), XML and binary. 3 | // plist supports all of them. 4 | // The mapping between property list and Go objects is described in the documentation for the Marshal and Unmarshal functions. 5 | package plist 6 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package plist 4 | 5 | import ( 6 | "bytes" 7 | ) 8 | 9 | func Fuzz(data []byte) int { 10 | buf := bytes.NewReader(data) 11 | 12 | var obj interface{} 13 | if err := NewDecoder(buf).Decode(&obj); err != nil { 14 | return 0 15 | } 16 | return 1 17 | } 18 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/must.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | import ( 4 | "io" 5 | "strconv" 6 | ) 7 | 8 | type mustWriter struct { 9 | io.Writer 10 | } 11 | 12 | func (w mustWriter) Write(p []byte) (int, error) { 13 | n, err := w.Writer.Write(p) 14 | if err != nil { 15 | panic(err) 16 | } 17 | return n, nil 18 | } 19 | 20 | func mustParseInt(str string, base, bits int) int64 { 21 | i, err := strconv.ParseInt(str, base, bits) 22 | if err != nil { 23 | panic(err) 24 | } 25 | return i 26 | } 27 | 28 | func mustParseUint(str string, base, bits int) uint64 { 29 | i, err := strconv.ParseUint(str, base, bits) 30 | if err != nil { 31 | panic(err) 32 | } 33 | return i 34 | } 35 | 36 | func mustParseFloat(str string, bits int) float64 { 37 | i, err := strconv.ParseFloat(str, bits) 38 | if err != nil { 39 | panic(err) 40 | } 41 | return i 42 | } 43 | 44 | func mustParseBool(str string) bool { 45 | i, err := strconv.ParseBool(str) 46 | if err != nil { 47 | panic(err) 48 | } 49 | return i 50 | } 51 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/util.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | import "io" 4 | 5 | type countedWriter struct { 6 | io.Writer 7 | nbytes int 8 | } 9 | 10 | func (w *countedWriter) Write(p []byte) (int, error) { 11 | n, err := w.Writer.Write(p) 12 | w.nbytes += n 13 | return n, err 14 | } 15 | 16 | func (w *countedWriter) BytesWritten() int { 17 | return w.nbytes 18 | } 19 | 20 | func unsignedGetBase(s string) (string, int) { 21 | if len(s) > 1 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X') { 22 | return s[2:], 16 23 | } 24 | return s, 10 25 | } 26 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/zerocopy.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package plist 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | func zeroCopy8BitString(buf []byte, off int, len int) string { 11 | if len == 0 { 12 | return "" 13 | } 14 | 15 | var s string 16 | hdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) 17 | hdr.Data = uintptr(unsafe.Pointer(&buf[off])) 18 | hdr.Len = len 19 | return s 20 | } 21 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/zerocopy_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package plist 4 | 5 | func zeroCopy8BitString(buf []byte, off int, len int) string { 6 | return string(buf[off : off+len]) 7 | } 8 | -------------------------------------------------------------------------------- /widgets/help.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/gizak/termui/v3/widgets" 7 | "github.com/xxxserxxx/lingo/v2" 8 | ) 9 | 10 | // Used by all widgets 11 | var tr lingo.Translations 12 | 13 | type HelpMenu struct { 14 | widgets.Paragraph 15 | } 16 | 17 | func NewHelpMenu(tra lingo.Translations) *HelpMenu { 18 | tr = tra 19 | help := &HelpMenu{ 20 | Paragraph: *widgets.NewParagraph(), 21 | } 22 | help.Paragraph.Text = tra.Value("help.help") 23 | return help 24 | } 25 | 26 | func (help *HelpMenu) Resize(termWidth, termHeight int) { 27 | textWidth := 53 28 | var nlines int 29 | var line string 30 | for nlines, line = range strings.Split(help.Text, "\n") { 31 | if textWidth < len(line) { 32 | textWidth = len(line) + 2 33 | } 34 | } 35 | textHeight := nlines + 2 36 | x := (termWidth - textWidth) / 2 37 | y := (termHeight - textHeight) / 2 38 | 39 | help.Paragraph.SetRect(x, y, textWidth+x, textHeight+y) 40 | } 41 | -------------------------------------------------------------------------------- /widgets/metrics.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // makeName creates a prometheus metric name in the gotop space 9 | // This function doesn't have to be very efficient because it's only 10 | // called at init time, and only a few dozen times... and it isn't 11 | // (very efficient). 12 | func makeName(parts ...interface{}) string { 13 | args := make([]string, len(parts)+1) 14 | args[0] = "gotop" 15 | for i, v := range parts { 16 | args[i+1] = fmt.Sprintf("%v", v) 17 | } 18 | return strings.Join(args, "_") 19 | } 20 | -------------------------------------------------------------------------------- /widgets/scalable.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import termui "github.com/gizak/termui/v3" 4 | 5 | type Scalable interface { 6 | termui.Drawable 7 | Scale(i int) 8 | } 9 | --------------------------------------------------------------------------------