Imports #
"encoding/json"
"os"
"strings"
"golang.org/x/telemetry/internal/telemetry"
"encoding/json"
"os"
"strings"
"golang.org/x/telemetry/internal/telemetry"
Config is a wrapper around telemetry.UploadConfig that provides some convenience methods for checking the contents of a report.
type Config struct {
*telemetry.UploadConfig
program map[string]bool
goos map[string]bool
goarch map[string]bool
goversion map[string]bool
pgversion map[pgkey]bool
pgcounter map[pgkey]bool
pgcounterprefix map[pgkey]bool
pgstack map[pgkey]bool
rate map[pgkey]float64
}
type pgkey struct {
program string
key string
}
Expand takes a counter defined with buckets and expands it into distinct strings for each bucket.
func Expand(counter string) []string
func (r *Config) HasCounter(program string, counter string) bool
func (r *Config) HasCounterPrefix(program string, prefix string) bool
func (r *Config) HasGOARCH(s string) bool
func (r *Config) HasGOOS(s string) bool
func (r *Config) HasGoVersion(s string) bool
func (r *Config) HasProgram(s string) bool
func (r *Config) HasStack(program string, stack string) bool
func (r *Config) HasVersion(program string, version string) bool
func NewConfig(cfg *telemetry.UploadConfig) *Config
func (r *Config) Rate(program string, name string) float64
func ReadConfig(file string) (*Config, error)
func set(slice []string) map[string]bool
Generated with Arrow