posthog

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package posthog contains posthog helper functions and utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

type Config

type Config struct {
	// Enabled is a flag to enable or disable PostHog
	Enabled bool `json:"enabled" koanf:"enabled" default:"false"`
	// APIKey is the PostHog API Key
	APIKey string `json:"apiKey" koanf:"apiKey"`
	// Host is the PostHog API Host
	Host string `json:"host" koanf:"host" default:"https://app.posthog.com"`
}

Config is the configuration for PostHog

func (*Config) Init

func (c *Config) Init() *PostHog

Init returns a pointer to a PostHog object

type PostHog

type PostHog struct {
	Identifier string
	// contains filtered or unexported fields
}

func (*PostHog) Event

func (p *PostHog) Event(eventName string, properties posthog.Properties)

Event is used to send an event to PostHog

func (*PostHog) Properties

func (p *PostHog) Properties(id, obj string, properties posthog.Properties)

Properties sets generic properties

Jump to

Keyboard shortcuts

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