analytics

package
v1.26.1-rc Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SegmentWriteKey string `help:"segment write key" default:""`
	Enabled         bool   `help:"enable analytics reporting" default:"false"`
}

Config is a configuration struct for analytics Service.

type Service

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

Service for sending analytics.

architecture: Service

func NewService

func NewService(log *zap.Logger, config Config, satelliteName string) *Service

NewService creates new service for creating sending analytics.

func (*Service) Close

func (service *Service) Close() error

Close closes the Segment client.

func (*Service) TrackCreateUser

func (service *Service) TrackCreateUser(fields TrackCreateUserFields)

TrackCreateUser sends an "Account Created" event to Segment.

type TrackCreateUserFields

type TrackCreateUserFields struct {
	ID            uuid.UUID
	FullName      string
	Email         string
	Type          UserType
	EmployeeCount string
	CompanyName   string
	JobTitle      string
}

TrackCreateUserFields contains input data for tracking a create user event.

type UserType

type UserType string

UserType is a type for distinguishing personal vs. professional users.

const (
	// Professional defines a "professional" user type.
	Professional UserType = "Professional"
	// Personal defines a "personal" user type.
	Personal UserType = "Personal"
)

Jump to

Keyboard shortcuts

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