server

package
v0.0.0-...-b46bf14 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiscriminatorPattern            = "event_type\":\"%s\""
	DiscriminatorV1Search           = "search"
	DiscriminatorV1DetailPageView   = "detail-page-view"
	DiscriminatorV1AddToCart        = "add-to-cart"
	DiscriminatorV1PurchaseComplete = "purchase-complete"
)
View Source
const (
	ConfigFile = "-configFile=examples/configs/events-test-config.json"
	SampleRate = "-sampleRate=1"
)

Variables

This section is empty.

Functions

func BuildV1Discriminator

func BuildV1Discriminator(value string) string

func TestMain

func TestMain(m *testing.M)

Types

type AddToCart

type AddToCart struct {
	CommonData
}

type CommonData

type CommonData struct {
	EventType      string          `json:"event_type"`
	EventTime      string          `json:"event_time"`
	VisitorId      string          `json:"visitor_id"`
	SessionId      string          `json:"session_id"`
	ProductDetails []ProductDetail `json:"product_details"`
}

type DetailPageView

type DetailPageView struct {
	CommonData //
}

type Product

type Product struct {
	Id        string `json:"id,omitempty"`
	PriceInfo struct {
		Price        float32 `json:"price,omitempty"`
		CurrencyCode string  `json:"currency_code,omitempty"`
	} `json:"price_info,omitempty"`
}

type ProductDetail

type ProductDetail struct {
	Quantity int32   `json:"quantity,omitempty,string"`
	Product  Product `json:"product,omitempty"`
}

type PurchaseComplete

type PurchaseComplete struct {
	CommonData
	PurchaseTransaction struct {
		Id           string  `json:"id"`
		Revenue      float32 `json:"revenue"`
		Tax          float32 `json:"tax"`
		CurrencyCode string  `json:"currency_code"`
	} `json:"purchase_transaction"`
}
type Search struct {
	CommonData
	SearchQuery string `json:"search_query"`
}

Jump to

Keyboard shortcuts

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