analytics

package
v0.0.0-...-a5f9fc7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisabledInFedrampErr = errors.New("analytics are disabled in FedRAMP environments")

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

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

Jump to

Keyboard shortcuts

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