protocol

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package protocol defines the interface for different tracking protocol implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PropertyIDExtractor added in v0.19.0

type PropertyIDExtractor interface {
	PropertyID(request *hits.ParsedRequest) (string, error)
}

PropertyIDExtractor extracts a property ID from a parsed request.

type Protocol

type Protocol interface {
	ID() string
	Columns() schema.Columns
	Interfaces() any
	Endpoints() []ProtocolEndpoint
	Hits(*fasthttp.RequestCtx, *hits.ParsedRequest) ([]*hits.Hit, error)
}

Protocol defines the interface for different tracking protocol implementations.

type ProtocolEndpoint added in v0.18.0

type ProtocolEndpoint struct {
	Methods []string
	Path    string
	// Normal endpoints are hit-creating ones, Custom endpoints are called directly
	// and may serve different purposes.
	IsCustom      bool
	CustomHandler func(*fasthttp.RequestCtx)
}

ProtocolEndpoint describes a web endpoint that is used by a protocol.

type Registry

type Registry interface {
	Get(propertyID string) (Protocol, error)
}

Registry allows to get a protocol for a given property ID.

func NewStaticRegistry

func NewStaticRegistry(protocols map[string]Protocol, defaultProtocol Protocol) Registry

NewStaticRegistry creates a new static protocol registry.

type Request

type Request struct {
	Method      []byte
	Host        []byte
	Path        []byte
	QueryParams url.Values
	Headers     http.Header
	Body        io.Reader
}

Request contains all information about an incoming tracking request.

Directories

Path Synopsis
Package ga4 provides GA4 protocol specific column definitions.
Package ga4 provides GA4 protocol specific column definitions.

Jump to

Keyboard shortcuts

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