add SPDX License, remove old build tag, and replace import

pull/1628/head
shirou 1 year ago
parent 87b0257e5b
commit bc060cc227

@ -5,7 +5,13 @@
This is a port of psutil (https://github.com/giampaolo/psutil). The This is a port of psutil (https://github.com/giampaolo/psutil). The
challenge is porting all psutil functions on some architectures. challenge is porting all psutil functions on some architectures.
## v3 migration ## migration
### v4 migration
See v4 release note.
### v3 migration
From v3.20.10, gopsutil becomes v3 which breaks backwards compatibility. From v3.20.10, gopsutil becomes v3 which breaks backwards compatibility.
See [v3Changes.md](_tools/v3migration/v3Changes.md) for more detailed changes. See [v3Changes.md](_tools/v3migration/v3Changes.md) for more detailed changes.
@ -15,10 +21,10 @@ See [v3Changes.md](_tools/v3migration/v3Changes.md) for more detailed changes.
gopsutil tag policy is almost same as Semantic Versioning, but gopsutil tag policy is almost same as Semantic Versioning, but
automatically increases like [Ubuntu versioning](https://calver.org/). automatically increases like [Ubuntu versioning](https://calver.org/).
For example, v2.17.04 means For example, v4.24.04 means
- v2: major version - v4: major version
- 17: release year, 2017 - 24: release year, 2024
- 04: release month - 04: release month
gopsutil aims to keep backwards compatibility until major version change. gopsutil aims to keep backwards compatibility until major version change.
@ -52,7 +58,7 @@ package main
import ( import (
"fmt" "fmt"
"github.com/shirou/gopsutil/v3/mem" "github.com/shirou/gopsutil/v4/mem"
// "github.com/shirou/gopsutil/mem" // to use v2 // "github.com/shirou/gopsutil/mem" // to use v2
) )
@ -122,7 +128,7 @@ Be very careful that enabling the cache may cause inconsistencies. For example,
## Documentation ## Documentation
See https://pkg.go.dev/github.com/shirou/gopsutil/v3 or https://godocs.io/github.com/shirou/gopsutil/v3 See https://pkg.go.dev/github.com/shirou/gopsutil/v4 or https://godocs.io/github.com/shirou/gopsutil/v4
## Requirements ## Requirements

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package common package common
type EnvKeyType string type EnvKeyType string

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (
@ -11,7 +12,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
// TimesStat contains the amounts of time the CPU has spent performing different // TimesStat contains the amounts of time the CPU has spent performing different

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix //go:build aix
// +build aix
package cpu package cpu

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix && cgo //go:build aix && cgo
// +build aix,cgo
package cpu package cpu

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix && !cgo //go:build aix && !cgo
// +build aix,!cgo
package cpu package cpu
@ -8,7 +8,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin //go:build darwin
// +build darwin
package cpu package cpu

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && cgo //go:build darwin && cgo
// +build darwin,cgo
package cpu package cpu

@ -1,9 +1,9 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && !cgo //go:build darwin && !cgo
// +build darwin,!cgo
package cpu package cpu
import "github.com/shirou/gopsutil/v3/internal/common" import "github.com/shirou/gopsutil/v4/internal/common"
func perCPUTimes() ([]TimesStat, error) { func perCPUTimes() ([]TimesStat, error) {
return []TimesStat{}, common.ErrNotImplementedError return []TimesStat{}, common.ErrNotImplementedError

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin //go:build darwin
// +build darwin
package cpu package cpu

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (
@ -10,7 +11,7 @@ import (
"strings" "strings"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/tklauser/go-sysconf" "github.com/tklauser/go-sysconf"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix
// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!dragonfly,!plan9,!aix
package cpu package cpu
@ -7,7 +7,7 @@ import (
"context" "context"
"runtime" "runtime"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func Times(percpu bool) ([]TimesStat, error) { func Times(percpu bool) ([]TimesStat, error) {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (
@ -10,7 +11,7 @@ import (
"strings" "strings"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/tklauser/go-sysconf" "github.com/tklauser/go-sysconf"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (
@ -5,7 +6,7 @@ import (
"runtime" "runtime"
"testing" "testing"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func TestParseDmesgBoot(t *testing.T) { func TestParseDmesgBoot(t *testing.T) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux //go:build linux
// +build linux
package cpu package cpu
@ -13,7 +13,7 @@ import (
"github.com/tklauser/go-sysconf" "github.com/tklauser/go-sysconf"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
var ClocksPerSec = float64(100) var ClocksPerSec = float64(100)

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build netbsd //go:build netbsd
// +build netbsd
package cpu package cpu
@ -9,7 +9,7 @@ import (
"runtime" "runtime"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/tklauser/go-sysconf" "github.com/tklauser/go-sysconf"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd //go:build openbsd
// +build openbsd
package cpu package cpu
@ -9,7 +9,7 @@ import (
"runtime" "runtime"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/tklauser/go-sysconf" "github.com/tklauser/go-sysconf"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
type cpuTimes struct { type cpuTimes struct {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build plan9 //go:build plan9
// +build plan9
package cpu package cpu
@ -9,7 +9,7 @@ import (
"runtime" "runtime"
stats "github.com/lufia/plan9stats" stats "github.com/lufia/plan9stats"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func Times(percpu bool) ([]TimesStat, error) { func Times(percpu bool) ([]TimesStat, error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build plan9 //go:build plan9
// +build plan9
package cpu package cpu

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package cpu package cpu
import ( import (
@ -10,7 +11,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func skipIfNotImplementedErr(t *testing.T, err error) { func skipIfNotImplementedErr(t *testing.T, err error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build windows //go:build windows
// +build windows
package cpu package cpu
@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/yusufpapurcu/wmi" "github.com/yusufpapurcu/wmi"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )

@ -1,10 +1,11 @@
// SPDX-License-Identifier: BSD-3-Clause
package disk package disk
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
var invoke common.Invoker = common.Invoke{} var invoke common.Invoker = common.Invoke{}

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix //go:build aix
// +build aix
package disk package disk
@ -8,7 +8,7 @@ import (
"errors" "errors"
"strings" "strings"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix && cgo //go:build aix && cgo
// +build aix,cgo
package disk package disk

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build aix && !cgo //go:build aix && !cgo
// +build aix,!cgo
package disk package disk
@ -9,7 +9,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin //go:build darwin
// +build darwin
package disk package disk
@ -8,7 +8,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
// PartitionsWithContext returns disk partition. // PartitionsWithContext returns disk partition.

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && cgo && !ios //go:build darwin && cgo && !ios
// +build darwin,cgo,!ios
package disk package disk
@ -14,7 +14,7 @@ import "C"
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) {

@ -1,12 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build (darwin && !cgo) || ios //go:build (darwin && !cgo) || ios
// +build darwin,!cgo ios
package disk package disk
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) {

@ -1,12 +1,12 @@
//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !windows && !solaris && !aix // SPDX-License-Identifier: BSD-3-Clause
// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!windows,!solaris,!aix //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !windows && !solaris && !aix
package disk package disk
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd //go:build freebsd
// +build freebsd
package disk package disk
@ -12,7 +12,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd && arm64 //go:build freebsd && arm64
// +build freebsd,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs disk/types_freebsd.go // cgo -godefs disk/types_freebsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux //go:build linux
// +build linux
package disk package disk
@ -16,7 +16,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
const ( const (

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build netbsd //go:build netbsd
// +build netbsd
package disk package disk
@ -7,7 +7,7 @@ import (
"context" "context"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build netbsd && amd64 //go:build netbsd && amd64
// +build netbsd,amd64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_netbsd.go // cgo -godefs types_netbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build netbsd && arm64 //go:build netbsd && arm64
// +build netbsd,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_netbsd.go // cgo -godefs types_netbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd //go:build openbsd
// +build openbsd
package disk package disk
@ -8,7 +8,7 @@ import (
"context" "context"
"encoding/binary" "encoding/binary"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd && 386 //go:build openbsd && 386
// +build openbsd,386
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs disk/types_openbsd.go // cgo -godefs disk/types_openbsd.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_openbsd.go // cgo -godefs types_openbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd && arm //go:build openbsd && arm
// +build openbsd,arm
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs disk/types_openbsd.go // cgo -godefs disk/types_openbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd && arm64 //go:build openbsd && arm64
// +build openbsd,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs disk/types_openbsd.go // cgo -godefs disk/types_openbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build openbsd && riscv64 //go:build openbsd && riscv64
// +build openbsd,riscv64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs disk/types_openbsd.go // cgo -godefs disk/types_openbsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build solaris //go:build solaris
// +build solaris
package disk package disk
@ -16,7 +16,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package disk package disk
import ( import (
@ -7,7 +8,7 @@ import (
"sync" "sync"
"testing" "testing"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func skipIfNotImplementedErr(t *testing.T, err error) { func skipIfNotImplementedErr(t *testing.T, err error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd || linux || darwin //go:build freebsd || linux || darwin
// +build freebsd linux darwin
package disk package disk

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build windows //go:build windows
// +build windows
package disk package disk
@ -10,7 +10,7 @@ import (
"syscall" "syscall"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
"golang.org/x/sys/windows/registry" "golang.org/x/sys/windows/registry"
) )

@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: Copyright (c) 2017, kadota kyohei
// https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.c // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.c
#include <stdint.h> #include <stdint.h>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>

@ -1,3 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: Copyright (c) 2017, kadota kyohei
// https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h
typedef struct DriveStats DriveStats; typedef struct DriveStats DriveStats;
typedef struct CPUStats CPUStats; typedef struct CPUStats CPUStats;

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build ignore //go:build ignore
// +build ignore
// Hand writing: _Ctype_struct___0 // Hand writing: _Ctype_struct___0

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build ignore //go:build ignore
// +build ignore
// Hand writing: _Ctype_struct___0 // Hand writing: _Ctype_struct___0

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build ignore //go:build ignore
// +build ignore
// Hand writing: _Ctype_struct___0 // Hand writing: _Ctype_struct___0

@ -1 +1,2 @@
// SPDX-License-Identifier: BSD-3-Clause
package gopsutil package gopsutil

@ -1,11 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
package docker package docker
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/shirou/gopsutil/v3/cpu" "github.com/shirou/gopsutil/v4/cpu"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
var ( var (

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux //go:build linux
// +build linux
package docker package docker
@ -13,8 +13,8 @@ import (
"strconv" "strconv"
"strings" "strings"
cpu "github.com/shirou/gopsutil/v3/cpu" cpu "github.com/shirou/gopsutil/v4/cpu"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
// GetDockerStat returns a list of Docker basic stats. // GetDockerStat returns a list of Docker basic stats.

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux //go:build linux
// +build linux
package docker package docker

@ -1,12 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build !linux //go:build !linux
// +build !linux
package docker package docker
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
// GetDockerStat returns a list of Docker basic stats. // GetDockerStat returns a list of Docker basic stats.

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package docker package docker
import ( import (

@ -21,4 +21,10 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )
retract v3.22.11 require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
package host package host
import ( import (
@ -8,7 +9,7 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
type Warnings = common.Warnings type Warnings = common.Warnings

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin || freebsd || openbsd || netbsd //go:build darwin || freebsd || openbsd || netbsd
// +build darwin freebsd openbsd netbsd
package host package host

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin //go:build darwin
// +build darwin
package host package host
@ -15,8 +15,8 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/shirou/gopsutil/v3/process" "github.com/shirou/gopsutil/v4/process"
) )
// from utmpx.h // from utmpx.h

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_darwin.go // cgo -godefs types_darwin.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && arm64 //go:build darwin && arm64
// +build darwin,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs host/types_darwin.go // cgo -godefs host/types_darwin.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && cgo //go:build darwin && cgo
// +build darwin,cgo
package host package host

@ -1,12 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build darwin && !cgo //go:build darwin && !cgo
// +build darwin,!cgo
package host package host
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) {

@ -1,12 +1,12 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !aix //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !aix
// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!aix
package host package host
import ( import (
"context" "context"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
func HostIDWithContext(ctx context.Context) (string, error) { func HostIDWithContext(ctx context.Context) (string, error) {

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd //go:build freebsd
// +build freebsd
package host package host
@ -13,8 +13,8 @@ import (
"strings" "strings"
"unsafe" "unsafe"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
"github.com/shirou/gopsutil/v3/process" "github.com/shirou/gopsutil/v4/process"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_freebsd.go // cgo -godefs types_freebsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build freebsd && arm64 //go:build freebsd && arm64
// +build freebsd,arm64
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs host/types_freebsd.go // cgo -godefs host/types_freebsd.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux //go:build linux
// +build linux
package host package host
@ -17,7 +17,7 @@ import (
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v4/internal/common"
) )
type lsbStruct struct { type lsbStruct struct {

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// ATTENTION - FILE MANUAL FIXED AFTER CGO. // ATTENTION - FILE MANUAL FIXED AFTER CGO.
// Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv
// Created by cgo -godefs, MANUAL FIXED // Created by cgo -godefs, MANUAL FIXED

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go | sed "s/uint8/int8/g" // cgo -godefs types_linux.go | sed "s/uint8/int8/g"

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs types_linux.go
package host package host

@ -1,8 +1,8 @@
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by cmd/cgo -godefs; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs host/types_linux.go // cgo -godefs host/types_linux.go
//go:build linux && loong64 //go:build linux && loong64
// +build linux,loong64
package host package host

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,3 +1,4 @@
// SPDX-License-Identifier: BSD-3-Clause
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux && ppc64 //go:build linux && ppc64
// +build linux,ppc64
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
//go:build linux && ppc64le //go:build linux && ppc64le
// +build linux,ppc64le
// Created by cgo -godefs - DO NOT EDIT // Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_linux.go // cgo -godefs types_linux.go

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save