...

Package configstore

import "cmd/vendor/golang.org/x/telemetry/internal/configstore"
Overview
Index

Overview ▾

Package configstore abstracts interaction with the telemetry config server. Telemetry config (golang.org/x/telemetry/config) is distributed as a go module containing go.mod and config.json. Programs that upload collected counters download the latest config using `go mod download`. This provides verification of downloaded configuration and cacheability.

Constants

const (
    ModulePath = "golang.org/x/telemetry/config"
)

func Download

func Download(version string, envOverlay []string) (*telemetry.UploadConfig, string, error)

Download fetches the requested telemetry UploadConfig using "go mod download". If envOverlay is provided, it is appended to the environment used for invoking the go command.

The second result is the canonical version of the requested configuration.

func Downloads

func Downloads() int64

Downloads reports, for testing purposes, the number of times Download has been called.