Documentation ¶
Index ¶
- Variables
- func GetV2InstrumentationObject(collector InstrumentationCollector) (*api.AnalyticsRequestBody, error)
- func SanitizeStaticValues(valuesToSanitize []string, replacementValue string, content []byte) ([]byte, error)
- func SanitizeUsername(rawUserName string, userHomeDir string, replacementValue string, ...) ([]byte, error)
- func SanitizeValuesByKey(keysToFilter []string, replacementValue string, content []byte) ([]byte, error)
- type Analytics
- type AnalyticsImpl
- func (a *AnalyticsImpl) AddError(err error)
- func (a *AnalyticsImpl) AddHeader(headerFunc func() http.Header)
- func (a *AnalyticsImpl) GetInstrumentation() InstrumentationCollector
- func (a *AnalyticsImpl) GetOutputData() *analyticsOutput
- func (a *AnalyticsImpl) GetRequest() (*http.Request, error)
- func (a *AnalyticsImpl) IsCiEnvironment() bool
- func (a *AnalyticsImpl) Send() (*http.Response, error)
- func (a *AnalyticsImpl) SetApiUrl(apiUrl string)
- func (a *AnalyticsImpl) SetClient(clientFunc func() *http.Client)
- func (a *AnalyticsImpl) SetCmdArguments(args []string)
- func (a *AnalyticsImpl) SetCommand(command string)
- func (a *AnalyticsImpl) SetIntegration(name string, version string)
- func (a *AnalyticsImpl) SetOperatingSystem(os string)
- func (a *AnalyticsImpl) SetOrg(org string)
- func (a *AnalyticsImpl) SetVersion(version string)
- type InstrumentationCollector
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var DisabledInFedrampErr = errors.New("analytics are disabled in FedRAMP environments") //nolint:errname // breaking API change
Functions ¶
func GetV2InstrumentationObject ¶
func GetV2InstrumentationObject(collector InstrumentationCollector) (*api.AnalyticsRequestBody, error)
func SanitizeStaticValues ¶
Types ¶
type Analytics ¶
type Analytics interface { SetCmdArguments(args []string) SetOrg(org string) SetVersion(version string) SetApiUrl(apiUrl string) SetIntegration(name string, version string) SetCommand(command string) SetOperatingSystem(os string) AddError(err error) AddHeader(headerFunc func() http.Header) SetClient(clientFunc func() *http.Client) IsCiEnvironment() bool GetOutputData() *analyticsOutput GetRequest() (*http.Request, error) Send() (*http.Response, error) GetInstrumentation() InstrumentationCollector }
Analytics is an interface for managing analytics.
type AnalyticsImpl ¶
type AnalyticsImpl struct {
// contains filtered or unexported fields
}
AnalyticsImpl is the default implementation of the Analytics interface.
func (*AnalyticsImpl) AddError ¶
func (a *AnalyticsImpl) AddError(err error)
AddError adds an error to the error list.
func (*AnalyticsImpl) AddHeader ¶
func (a *AnalyticsImpl) AddHeader(headerFunc func() http.Header)
AddHeader adds a header to the request.
func (*AnalyticsImpl) GetInstrumentation ¶
func (a *AnalyticsImpl) GetInstrumentation() InstrumentationCollector
func (*AnalyticsImpl) GetOutputData ¶
func (a *AnalyticsImpl) GetOutputData() *analyticsOutput
GetOutputData returns the analyticsOutput data.
func (*AnalyticsImpl) GetRequest ¶
func (a *AnalyticsImpl) GetRequest() (*http.Request, error)
GetRequest returns the HTTP request.
func (*AnalyticsImpl) IsCiEnvironment ¶
func (a *AnalyticsImpl) IsCiEnvironment() bool
IsCiEnvironment returns true if the command is running in a CI environment.
func (*AnalyticsImpl) SetApiUrl ¶
func (a *AnalyticsImpl) SetApiUrl(apiUrl string)
SetApiUrl sets the API URL.
func (*AnalyticsImpl) SetClient ¶
func (a *AnalyticsImpl) SetClient(clientFunc func() *http.Client)
SetClient sets the HTTP client.
func (*AnalyticsImpl) SetCmdArguments ¶
func (a *AnalyticsImpl) SetCmdArguments(args []string)
SetCmdArguments sets the command arguments.
func (*AnalyticsImpl) SetCommand ¶
func (a *AnalyticsImpl) SetCommand(command string)
func (*AnalyticsImpl) SetIntegration ¶
func (a *AnalyticsImpl) SetIntegration(name string, version string)
SetIntegration sets the integration name and version.
func (*AnalyticsImpl) SetOperatingSystem ¶
func (a *AnalyticsImpl) SetOperatingSystem(os string)
func (*AnalyticsImpl) SetOrg ¶
func (a *AnalyticsImpl) SetOrg(org string)
SetOrg sets the organization.
func (*AnalyticsImpl) SetVersion ¶
func (a *AnalyticsImpl) SetVersion(version string)
SetVersion sets the version.
type InstrumentationCollector ¶
type InstrumentationCollector interface { SetUserAgent(ua networking.UserAgentInfo) SetInteractionId(id string) SetTimestamp(t time.Time) SetDuration(duration time.Duration) GetDuration() time.Duration SetStage(s string) SetType(t string) SetInteractionType(t string) SetCategory(c []string) GetCategory() []string SetStatus(s Status) SetTestSummary(s json_schemas.TestSummary) SetTargetId(t string) // maybe use package-url library and types AddError(err error) AddExtension(key string, value interface{}) }
func NewInstrumentationCollector ¶
func NewInstrumentationCollector() InstrumentationCollector
Click to show internal directories.
Click to hide internal directories.