config

Imports

Imports #

"encoding/json"
"os"
"strings"
"golang.org/x/telemetry/internal/telemetry"

Structs

Config struct #

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
}

pgkey struct #

type pgkey struct {
program string
key string
}

Functions

Expand function #

Expand takes a counter defined with buckets and expands it into distinct strings for each bucket.

func Expand(counter string) []string

HasCounter method #

func (r *Config) HasCounter(program string, counter string) bool

HasCounterPrefix method #

func (r *Config) HasCounterPrefix(program string, prefix string) bool

HasGOARCH method #

func (r *Config) HasGOARCH(s string) bool

HasGOOS method #

func (r *Config) HasGOOS(s string) bool

HasGoVersion method #

func (r *Config) HasGoVersion(s string) bool

HasProgram method #

func (r *Config) HasProgram(s string) bool

HasStack method #

func (r *Config) HasStack(program string, stack string) bool

HasVersion method #

func (r *Config) HasVersion(program string, version string) bool

NewConfig function #

func NewConfig(cfg *telemetry.UploadConfig) *Config

Rate method #

func (r *Config) Rate(program string, name string) float64

ReadConfig function #

func ReadConfig(file string) (*Config, error)

set function #

func set(slice []string) map[string]bool

Generated with Arrow