Documentation ¶
Overview ¶
Package sysmetrics Golang bindings: collect and report system and hardware metrics from your system.
Index ¶
- func Collect() ([]byte, error)
- func CollectAndSend(r ReportType, alwaysReport bool, baseURL string) error
- func CollectAndSendOnUpgrade(alwaysReport bool, baseURL string) error
- func SendDecline(alwaysReport bool, baseURL string) error
- func SendPendingReport(baseURL string) error
- func SendReport(data []byte, alwaysReport bool, baseURL string) error
- type ReportType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectAndSend ¶
func CollectAndSend(r ReportType, alwaysReport bool, baseURL string) error
CollectAndSend gather system info and send them The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.
func CollectAndSendOnUpgrade ¶
CollectAndSendOnUpgrade gather system info and send them The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. It will only send if a previous report has been found, collect latest report answer (opt-in or opt-out) and decides what to send on that new version based on those facts. If "baseURL" is not an empty string, this overrides the server the report is sent to.
func SendDecline ¶
SendDecline POST to the baseURL server data denial report message. The denial message will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.
func SendPendingReport ¶
SendPendingReport will try to send any pending report which didn't succeed previously due to network issues. It will try sending and exponentially back off until a send is successful.
func SendReport ¶
SendReport POST to the baseURL server data coming from a previous collect. The report will not be sent if a report has already been sent for this version unless "alwaysReport" is true. If "baseURL" is not an empty string, this overrides the server the report is sent to.
Types ¶
type ReportType ¶
type ReportType int
ReportType define the desired kind of interaction in CollectAndSend()
const ( // ReportInteractive will show report content on stdout and read anwser on stdin ReportInteractive ReportType = iota // ReportAuto will send a report without printing report ReportAuto // ReportOptOut will send opt-out message without printing report ReportOptOut )