Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
test: add user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
myishay committed Apr 20, 2021
1 parent 535060f commit 4248c00
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/cliClient/osManager.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package cliClient

import "github.com/shirou/gopsutil/host"

type UserAgent struct {
OS string `json:"os"`
PlatformVersion string `json:"platformVersion"`
KernelVersion string `json:"kernelVersion"`
}

func getUserAgent() (*UserAgent, error) {
osInfo, err := host.Info()
if err != nil {
return nil, err
}
return &UserAgent{
OS: osInfo.OS,
PlatformVersion: osInfo.PlatformVersion,
KernelVersion: osInfo.KernelVersion,
}, nil
}

0 comments on commit 4248c00

Please sign in to comment.