analytics

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 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 CreateSegmentNewUserTrack

func CreateSegmentNewUserTrack(user *models.User) *segmentNewUserTrack

Constructor for track of type "New User" Tracks when a user has registered

func CreateSegmentRedeployViaWebhookTrack

func CreateSegmentRedeployViaWebhookTrack(userId string, repository string) *segmentRedeployViaWebhookTrack

Constructor for track of type "Triggered Re-deploy via Webhook" 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 SegmentEvent

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

Jump to

Keyboard shortcuts

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