analytics

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSegmentIdentifyNewUser

func CreateSegmentIdentifyNewUser(user *models.User, registeredViaGithub bool) *segmentIdentifyNewUser

Creates a segment Identifier struct for new users. As we handle registration with github, it also accepts a param to check if the new user has registered with github or not.

func CreateSegmentNewClusterEvent added in v0.7.2

func CreateSegmentNewClusterEvent(opts *NewClusterEventOpts) *segmentNewClusterEventTrack

CreateSegmentNewClusterEvent creates a track of type "New Cluster Event", which tracks whenever a cluster is newly provisioned, connected, or destroyed.

func CreateSegmentNewUserTrack

func CreateSegmentNewUserTrack(user *models.User) *segmentNewUserTrack

CreateSegmentNewUserTrack creates a track of type "New User", which tracks when a user has registered

func CreateSegmentRedeployViaWebhookTrack

func CreateSegmentRedeployViaWebhookTrack(userId string, repository string) *segmentRedeployViaWebhookTrack

CreateSegmentRedeployViaWebhookTrack creates a track of type "Triggered Re-deploy via Webhook", which tracks whenever a repository is redeployed via webhook call

Types

type AnalyticsSegment

type AnalyticsSegment struct {
	segment.Client
	// contains filtered or unexported fields
}

func (*AnalyticsSegment) Identify

func (c *AnalyticsSegment) Identify(identifier segmentIdentifier) error

func (*AnalyticsSegment) Track

func (c *AnalyticsSegment) Track(track segmentTrack) error

Superset of segment client track function, this will accept analytics defined tracks only and will log an error if the client is not initialized

type AnalyticsSegmentClient

type AnalyticsSegmentClient interface {
	Identify(segmentIdentifier) error
	Track(segmentTrack) error
}

func InitializeAnalyticsSegmentClient

func InitializeAnalyticsSegmentClient(segmentClientKey string, logger *logger.Logger) AnalyticsSegmentClient

Initialize the segment client and return a superset of it, the AnalyticsSegmentClient will handle cases when the segment client failed on initialization or not enabled

type NewClusterEventOpts added in v0.7.2

type NewClusterEventOpts struct {
	UserId      string
	ProjId      string
	ClusterName string
	ClusterType string // EKS, DOKS, or GKE
	EventType   string // connected, provisioned, or destroyed
}

NewClusterEventOpts are the parameters for creating a "New Cluster Event" track

type SegmentEvent

type SegmentEvent string
const (
	NewUser            SegmentEvent = "New User"
	RedeployViaWebhook SegmentEvent = "Triggered Re-deploy via Webhook"
	NewClusterEvent    SegmentEvent = "New Cluster Event"
)

Jump to

Keyboard shortcuts

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