Documentation ¶
Index ¶
- Constants
- func AskForConsent()
- func GetContext(ctx context.Context) context.Context
- func GetCreateUserIdentity(userIdFile string) (string, error)
- func GetProperty(ctx context.Context, key propertyKeyType) (string, bool)
- func GetUserIdFilePath() string
- func MaskErrorContent(err error) string
- func PushEvent(ctx context.Context, segmentClient analytics.Client, userId, eventName string, ...) error
- func SetProperty[T string | bool | int](ctx context.Context, key propertyKeyType, value T)
Constants ¶
const ( KeyManifest propertyKeyType = "manifest" KeyExitCode propertyKeyType = "exit-code" KeyClient propertyKeyType = "client" KeyTotalVulnerabilities propertyKeyType = "total-vulnerabilities" KeyEcosystem propertyKeyType = "ecosystem" KeySnykTokenAssociated propertyKeyType = "snyk-token-associated" KeyJSonOutput propertyKeyType = "json" KeyVerboseOutput propertyKeyType = "verbose" KeySuccess propertyKeyType = "success" KeyPlatform propertyKeyType = "platform" KeyVersion propertyKeyType = "version" KeyDuration propertyKeyType = "duration" KeyError propertyKeyType = "error" )
Variables ¶
This section is empty.
Functions ¶
func AskForConsent ¶
func AskForConsent()
AskForConsent is used to prompt the user for selecting Yes|No|Later in regard to telemetry consent Yes or No: config will be updated accordingly, and we won't ask again Later: no updates to config, will ask again
if consent config already recorded, will not ask at all
func GetContext ¶
GetContext is used for instantiating a value context storing telemetry client and properties invoke this functions once to get the context and pass it back when using telemetry
func GetCreateUserIdentity ¶
GetCreateUserIdentity is used for loading or creating a new user id for telemetry reporting will return error if failed loading/creating the uuid for telemetry
func GetProperty ¶
GetProperty is used to get a stored telemetry event property
func GetUserIdFilePath ¶
func GetUserIdFilePath() string
GetUserIdFilePath is used to construct the path for the telemetry user id the user id is shared between all application using red hat telemetry i.e. vscode rh extensions, intellij rh plugins, etc. $HOME/.redhat/anonymousId
func MaskErrorContent ¶
func PushEvent ¶
func PushEvent(ctx context.Context, segmentClient analytics.Client, userId, eventName string, startTime time.Time) error
PushEvent is used to push a track event the event properties will be fetched from the context the duration wil be calculated based on the start time returns error if failed identifying or pushing the track event to segment
Types ¶
This section is empty.