Documentation
¶
Overview ¶
Package posthog contains posthog helper functions and utilities
Index ¶
- Variables
- func Capture(command *cobra.Command, userID string)
- func GetPackageToPosthogProperties(header *http.Header) posthog.Properties
- func ToPosthogProperties(orgName string) map[string]interface{}
- type PostHog
- func (p *PostHog) AssociateUser(userID string, organizationID string)
- func (p *PostHog) Cleanup()
- func (p *PostHog) Event(eventName string, properties posthog.Properties)
- func (p *PostHog) NewOrganization(organizationID, userID string, properties posthog.Properties)
- func (p *PostHog) NewUser(userID string, properties posthog.Properties)
- func (p *PostHog) OrganizationEvent(organizationID, userID, eventName string, properties posthog.Properties)
- func (p *PostHog) OrganizationProperties(organizationID string, properties posthog.Properties)
- func (p *PostHog) UserEvent(userID, eventName string, properties posthog.Properties)
- func (p *PostHog) UserProperties(userID string, properties posthog.Properties)
Constants ¶
This section is empty.
Variables ¶
var ( // PosthogAPIKey is the PostHog API Key PosthogAPIKey = os.Getenv("POSTHOG_API_KEY") // PosthogAPIHost is the PostHog API Host PosthogAPIHost = "https://app.posthog.com" )
Functions ¶
func Capture ¶
Capture is intended to be a wrapper around CLI commands to generate generic events associated with the CLI actions
func GetPackageToPosthogProperties ¶
func GetPackageToPosthogProperties(header *http.Header) posthog.Properties
GetPackageToPosthogProperties can be used to parse out an http header and map the headers to posthog properties array
func ToPosthogProperties ¶
Types ¶
type PostHog ¶
type PostHog struct {
Identifier string
// contains filtered or unexported fields
}
func (*PostHog) AssociateUser ¶
AssociateUser function is used to associate a user with an organization in PostHog
func (*PostHog) Event ¶
func (p *PostHog) Event(eventName string, properties posthog.Properties)
Event is used to send an event to PostHog
func (*PostHog) NewOrganization ¶
func (p *PostHog) NewOrganization(organizationID, userID string, properties posthog.Properties)
NewOrganization uses the NewGroups reference to create a new organization in the organization groups category, and also sets attributes for the organization
func (*PostHog) NewUser ¶
func (p *PostHog) NewUser(userID string, properties posthog.Properties)
NewUser maps the userID to the user group
func (*PostHog) OrganizationEvent ¶
func (p *PostHog) OrganizationEvent(organizationID, userID, eventName string, properties posthog.Properties)
OrganizationEvent creates an event associated with the organization, where the eventName can be passed in generically and associated with the org ID if provided
func (*PostHog) OrganizationProperties ¶
func (p *PostHog) OrganizationProperties(organizationID string, properties posthog.Properties)
OrganizationProperties sets org properties
func (*PostHog) UserEvent ¶
func (p *PostHog) UserEvent(userID, eventName string, properties posthog.Properties)
UserEvent captures user properties
func (*PostHog) UserProperties ¶
func (p *PostHog) UserProperties(userID string, properties posthog.Properties)
UserProperties is to expand the properties of the user in the user group