package telemetry
import "cuelang.org/go/internal/golangorgx/telemetry/internal/telemetry"
Package telemetry manages the telemetry mode file.
Index ¶
- Constants
- Variables
- func Mode() (string, time.Time)
- func SetMode(mode string) error
- type ModeFilePath
Constants ¶
const DisabledOnPlatform = false || runtime.GOOS == "openbsd" || runtime.GOOS == "solaris" || runtime.GOOS == "android" || runtime.GOOS == "js" || runtime.GOOS == "wasip1" || runtime.GOOS == "plan9" || runtime.GOARCH == "386" // #60615 #60692 #60965 #60967
DisabledOnPlatform indicates whether telemetry is disabled due to bugs in the current platform.
Variables ¶
var ( // Default directory containing count files and local reports (not yet uploaded) LocalDir string // Default directory containing uploaded reports. UploadDir string // Default file path that holds the telemetry mode info. ModeFile ModeFilePath )
The followings are the process' default Settings. The values are subdirectories and a file under os.UserConfigDir()/go/telemetry. For convenience, each field is made to global and they are not supposed to be changed.
Functions ¶
func Mode ¶
Mode returns the current telemetry mode, as well as the time that the mode was effective.
If there is no effective time, the second result is the zero time.
func SetMode ¶
SetMode updates the telemetry mode with the given mode. Acceptable values for mode are "on", "off", or "local".
SetMode always writes the mode file, and explicitly records the date at which the modefile was updated. This means that calling SetMode with "on" effectively resets the timeout before the next telemetry report is uploaded.
Types ¶
type ModeFilePath ¶
type ModeFilePath string
ModeFilePath is the telemetry mode file path with methods to manipulate the file contents.
func (ModeFilePath) Mode ¶
func (m ModeFilePath) Mode() (string, time.Time)
func (ModeFilePath) SetMode ¶
func (m ModeFilePath) SetMode(mode string) error
func (ModeFilePath) SetModeAsOf ¶
func (m ModeFilePath) SetModeAsOf(mode string, asofTime time.Time) error
SetModeAsOf is like SetMode, but accepts an explicit time to use to back-date the mode state. This exists only for testing purposes.
Source Files ¶
mode.go
- Version
- v0.10.0-alpha.3
- Published
- Jul 31, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 3 hours ago –
Tools for package owners.