analytics

package
v2.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client uses segment to trigger life-cycle emails (quota, billing, etc).

func NewClient

func NewClient(segmentAPIKey, prefix string, debug bool) (*Client, error)

NewClient return a segment client.

func (*Client) FormatUnix

func (c *Client) FormatUnix(seconds int64) string

FormatUnix converts seconds to string in same format for all analytics requests

func (*Client) Identify

func (c *Client) Identify(key string, accountType mdb.AccountType, active bool, email string, properties map[string]interface{})

Identify creates or updates the user traits

func (*Client) TrackEvent

func (c *Client) TrackEvent(key string, accountType mdb.AccountType, active bool, event Event, properties map[string]string)

TrackEvent logs a new event

type Event

type Event int

Event is a type of usage event

const (
	SignIn Event = iota
	AccountDestroyed
	KeyAccountCreated
	KeyUserCreated
	OrgCreated
	OrgLeave
	OrgDestroyed
	OrgInviteCreated
	GracePeriodStart
	GracePeriodEnd
	BillingSetup
	BucketCreated
	BucketArchiveCreated
	MailboxCreated
	ThreadDbCreated
)

func (Event) String

func (e Event) String() string

Jump to

Keyboard shortcuts

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