analytics

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeStaticValues

func SanitizeStaticValues(valuesToSanitize []string, replacementValue string, content []byte) ([]byte, error)

func SanitizeUsername

func SanitizeUsername(rawUserName string, userHomeDir string, replacementValue string, content []byte) ([]byte, error)

SanitizeUsername sanitizes the given content by replacing the given username with the replacement string.

func SanitizeValuesByKey

func SanitizeValuesByKey(keysToFilter []string, replacementValue string, content []byte) ([]byte, error)

Types

type Analytics

type Analytics interface {
	SetCmdArguments(args []string)
	SetOrg(org string)
	SetVersion(version string)
	SetApiUrl(apiUrl string)
	SetIntegration(name string, version 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)
}

Analytics is an interface for managing analytics.

func New

func New() Analytics

New creates a new Analytics instance.

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) 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) Send

func (a *AnalyticsImpl) Send() (*http.Response, error)

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) SetIntegration

func (a *AnalyticsImpl) SetIntegration(name string, version string)

SetIntegration sets the integration name and version.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL