datahappy

package
v0.0.0-...-81f452b Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Build   string `json:"build,omitempty"`
}

type CAPI

type CAPI struct {
	FBP string `json:"fbp,omitempty"`
	FBC string `json:"fbc,omitempty"`
}

type Client

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

func NewClient

func NewClient(baseURL, authToken string) *Client

func (*Client) Track

func (c *Client) Track(ctx context.Context, req *TrackRequest) error

type Context

type Context struct {
	Library *Library `json:"library,omitempty"`
	// Campaign   *Campaign `json:"campaign,omitempty"`
	// Device     *Device   `json:"device,omitempty"`
	App    *App   `json:"app,omitempty"`
	IP     string `json:"ip,omitempty"`
	Locale string `json:"locale,omitempty"`
	// Location   *Location `json:"location,omitempty"`
	// Network    *Network  `json:"network,omitempty"`
	// OS         *OS       `json:"os,omitempty"`
	// Page       *Page     `json:"page,omitempty"`
	// Referrer   *Referrer `json:"referrer,omitempty"`
	// Screen     *Screen   `json:"screen,omitempty"`
	Timezone   string  `json:"timezone,omitempty"`
	GroupID    string  `json:"groupId,omitempty"`
	Traits     *Traits `json:"traits,omitempty"`
	UserAgent  string  `json:"userAgent,omitempty"`
	ExternalID string  `json:"externalId,omitempty"`
}

type GAds

type GAds struct {
	GCLID  string `json:"gclid,omitempty"`
	GBRAID string `json:"gbraid,omitempty"`
	WBRAID string `json:"wbraid,omitempty"`
}

type Integrations

type Integrations struct {
	CAPI *CAPI `json:"capi,omitempty"`
	GAds *GAds `json:"gads,omitempty"`
}

type Library

type Library struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type RequestType

type RequestType string
const (
	RequestTypeTrack  RequestType = "track"
	RequestTypeUpdate RequestType = "update"
	RequestTypeDelete RequestType = "delete"
)

type TrackRequest

type TrackRequest struct {
	Type         RequestType    `json:"type"`
	AnonymousID  string         `json:"anonymousId,omitempty"`
	UserID       string         `json:"userId,omitempty"`
	Event        string         `json:"event"`
	MessageID    string         `json:"messageId,omitempty"`
	Properties   map[string]any `json:"properties,omitempty"`
	Context      *Context       `json:"context,omitempty"`
	Integrations *Integrations  `json:"integrations,omitempty"`
	Timestamp    *time.Time     `json:"timestamp,omitempty"`
	Channel      string         `json:"channel,omitempty"`
	AuthToken    string         `json:"authToken"`
}

type Traits

type Traits struct {
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Name      string `json:"name,omitempty"`
	Email     string `json:"email,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Title     string `json:"title,omitempty"`
	// Company     *Company    `json:"company,omitempty"`
	Website     string      `json:"website,omitempty"`
	Description string      `json:"description,omitempty"`
	Gender      string      `json:"gender,omitempty"`
	Birthday    *civil.Date `json:"birthday,omitempty"`
	// Address     *Address    `json:"address,omitempty"`
	CreatedAt *time.Time `json:"createdAt,omitempty"`
}

Jump to

Keyboard shortcuts

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