Documentation ¶
Index ¶
- func CreateSegmentIdentifyNewUser(user *models.User, registeredViaGithub bool) *segmentIdentifyNewUser
- func CreateSegmentNewUserTrack(user *models.User) *segmentNewUserTrack
- func CreateSegmentRedeployViaWebhookTrack(userId string, repository string) *segmentRedeployViaWebhookTrack
- type AnalyticsSegment
- type AnalyticsSegmentClient
- type SegmentEvent
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 ¶
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 ¶
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" )