forked from shirou/gopsutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from LokeshOpsramp/master
merge upstream chanages
- Loading branch information
Showing
79 changed files
with
1,490 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
Security updates are applied only to the latest release. | ||
|
||
## Reporting a Vulnerability | ||
|
||
If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. | ||
|
||
Please disclose it at [Security Advisories](https://github.com/shirou/gopsutil/security/advisories/new). | ||
|
||
This project is maintained by a team of volunteers on a reasonable-effort basis. As such, vulnerability reports will be investigated and fixed or disclosed as soon as possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: SBOM Generator | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
|
||
- uses: advanced-security/sbom-generator-action@375dee8e6144d9fd0ec1f5667b4f6fb4faacefed # v0.0.1 | ||
id: sbom | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
with: | ||
path: ${{steps.sbom.outputs.fileName }} | ||
name: "SBOM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package common | ||
|
||
type EnvKeyType string | ||
|
||
// EnvKey is a context key that can be used to set programmatically the environment | ||
// gopsutil relies on to perform calls against the OS. | ||
// Example of use: | ||
// | ||
// ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"}) | ||
// avg, err := load.AvgWithContext(ctx) | ||
var EnvKey = EnvKeyType("env") | ||
|
||
const ( | ||
HostProcEnvKey EnvKeyType = "HOST_PROC" | ||
HostSysEnvKey EnvKeyType = "HOST_SYS" | ||
HostEtcEnvKey EnvKeyType = "HOST_ETC" | ||
HostVarEnvKey EnvKeyType = "HOST_VAR" | ||
HostRunEnvKey EnvKeyType = "HOST_RUN" | ||
HostDevEnvKey EnvKeyType = "HOST_DEV" | ||
HostRootEnvKey EnvKeyType = "HOST_ROOT" | ||
) | ||
|
||
type EnvMap map[EnvKeyType]string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//go:build darwin | ||
// +build darwin | ||
|
||
package cpu | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/shoenig/go-m1cpu" | ||
) | ||
|
||
func Test_CpuInfo_AppleSilicon(t *testing.T) { | ||
if !m1cpu.IsAppleSilicon() { | ||
t.Skip("wrong cpu type") | ||
} | ||
|
||
v, err := Info() | ||
if err != nil { | ||
t.Errorf("cpu info should be implemented on darwin systems") | ||
} | ||
|
||
for _, vv := range v { | ||
if vv.ModelName == "" { | ||
t.Errorf("could not get CPU info: %v", vv) | ||
} | ||
if vv.Mhz <= 0 { | ||
t.Errorf("could not get frequency of: %s", vv.ModelName) | ||
} | ||
if vv.Mhz > 6000 { | ||
t.Errorf("cpu frequency is absurdly high value: %f MHz", vv.Mhz) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.