analytics

package
v2.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 5 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{}) error

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) error

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