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(*RequestContext) (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 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.
type RequestContext ¶ added in v0.19.2
type RequestContext struct {
FastHttp *fasthttp.RequestCtx
Parsed *hits.ParsedRequest
}
RequestContext wraps both the fasthttp request context and parsed request.
Click to show internal directories.
Click to hide internal directories.