Files
moby/pkg/platform/platform.go
Sebastiaan van Stijn b034dc41a2 deprecate pkg/platform and move internal
Functions in this package are only used internally in the daemon for
the `/info` endpoint (Architecture), and as part of `stats` (NumProcs).

I was not able to find external consumers, but deprecating the package
first, so that we can remove / dismantle the package in a follow-up.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-13 15:05:56 +01:00

28 lines
1006 B
Go

// Package platform provides helper function to get the runtime architecture
// for different platforms.
//
// Deprecated: this package is only used internally, and will be removed in the next release.
package platform // import "github.com/docker/docker/pkg/platform"
import (
"github.com/docker/docker/internal/platform"
)
// Architecture holds the runtime architecture of the process.
//
// Unlike [runtime.GOARCH] (which refers to the compiler platform),
// Architecture refers to the running platform.
//
// For example, Architecture reports "x86_64" as architecture, even
// when running a "linux/386" compiled binary on "linux/amd64" hardware.
//
// Deprecated: this package is only used internally, and will be removed in the next release.
var Architecture = platform.Architecture()
// NumProcs returns the number of processors on the system
//
// Deprecated: this package is only used internally, and will be removed in the next release.
func NumProcs() uint32 {
return platform.NumProcs()
}