usagereporter

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertUserEventRequestToUsageEvent

func ConvertUserEventRequestToUsageEvent(req CreateUserEventRequest) (*usageeventsv1.UsageEventOneOf, error)

ConvertUserEventRequestToUsageEvent receives a CreateUserEventRequest and creates a new *usageeventsv1.UsageEventOneOf. Based on the event's name, it creates the corresponding *usageeventsv1.UsageEventOneOf adding the required fields.

Types

type CreatePreUserEventRequest

type CreatePreUserEventRequest struct {
	// Event describes the event being capture
	Event string `json:"event"`
	// Username token is set for unauthenticated event requests
	Username string `json:"username"`

	// Alert is the alert clicked via the UI banner
	// Alert is only set for bannerClick events
	Alert string `json:"alert"`
	// MfaType is the type of MFA used
	// MfaType is only set for registerChallenge events
	MfaType string `json:"mfaType"`
	// LoginFlow is the login flow used
	// LoginFlow is only set for registerChallenge events
	LoginFlow string `json:"loginFlow"`
}

CreatePreUserEventRequest contains the event and properties associated with a user event the usageReporter convert event function will later set the timestamp and anonymize/set the cluster name the username is required for pre-user events

func (*CreatePreUserEventRequest) CheckAndSetDefaults

func (r *CreatePreUserEventRequest) CheckAndSetDefaults() error

CheckAndSetDefaults validates the Request has the required fields.

type CreateUserEventRequest

type CreateUserEventRequest struct {
	// Event describes the event being capture
	Event string `json:"event"`
	// Alert is a banner click event property
	Alert string `json:"alert"`

	// EventData contains the event's metadata.
	// This field dependes on the Event name, hence the json.RawMessage
	EventData *json.RawMessage `json:"eventData"`
}

CreateUserEventRequest contains the event and properties associated with a user event the usageReporter convert event function will later set the timestamp and anonymize/set the cluster name

func (*CreateUserEventRequest) CheckAndSetDefaults

func (r *CreateUserEventRequest) CheckAndSetDefaults() error

CheckAndSetDefaults validates the Request has the required fields.

type DiscoverEventData

type DiscoverEventData struct {
	// ID is a unique ID per wizard session
	ID string `json:"id,omitempty"`

	// Resource is the resource type that the user selected.
	// Its possible values are the usageevents.DiscoverResource proto enum values.
	// Example: "DISCOVER_RESOURCE_SERVER"
	Resource string `json:"resource,omitempty"`

	// AutoDiscoverResourcesCount is the number of auto-discovered resources in the Auto Discovering resources screen.
	// This value is only considered for the 'tp.ui.discover.autoDiscoveredResources'.
	AutoDiscoverResourcesCount int `json:"autoDiscoverResourcesCount,omitempty"`

	// SelectedResourcesCount is the number of resources that a user has selected
	// eg: number of RDS databases selected in the RDS enrollment screen for the
	// event tp.ui.discover.database.enroll.rds
	SelectedResourcesCount int `json:"selectedResourcesCount,omitempty"`

	ServiceDeploy discoverServiceDeploy `json:"serviceDeploy,omitempty"`

	// StepStatus is the Wizard step status result.
	// Its possible values are the usageevents.DiscoverStepStatus proto enum values.
	// Example: "DISCOVER_STATUS_SUCCESS"
	StepStatus string `json:"stepStatus,omitempty"`
	// StepStatusError is the error of the Step, when the StepStatus is `DISCOVER_STATUS_ERROR`.
	StepStatusError string `json:"stepStatusError,omitempty"`
}

DiscoverEventData contains the required properties to create a Discover UsageEvent.

func (*DiscoverEventData) ToUsageEvent

func (d *DiscoverEventData) ToUsageEvent(eventName string) (*usageeventsv1.UsageEventOneOf, error)

ToUsageEvent converts a discoverEventData into a v1.UsageEventOneOf. This is mostly copying data around, except for Enum properties. Enum props are converted from its string representation to its int32 values.

type IntegrationEnrollEventData

type IntegrationEnrollEventData struct {
	// ID is a unique ID per wizard session
	ID string `json:"id"`

	// Kind is the integration type that the user selected to enroll.
	// Values should be the string version of the enum names as found
	// in usageevents.IntegrationEnrollKind.
	// Example: "INTEGRATION_ENROLL_KIND_AWS_OIDC"
	Kind string `json:"kind"`
}

IntegrationEnrollEventData contains the required properties to create a IntegrationEnroll UsageEvent.

Jump to

Keyboard shortcuts

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