Documentation ¶
Index ¶
- func BodyOrEmptyJsonObj(c *fiber.Ctx) []byte
- func ComputeDeviceId(bytesSlice ...[]byte) uint64
- func ComputeVisitorId(bytesSlice ...[]byte) string
- func ContextTimeout(ctx context.Context) time.Duration
- func ExtractClientHints(headers *fasthttp.RequestHeader, client *uaparser.Client)
- func ExtractUtmParams(args *fasthttp.Args) event.UtmParams
- func PeekAndParseReferrerHeader(c *fiber.Ctx) (uri.Uri, error)
- func PeekAndParseReferrerQueryHeader(c *fiber.Ctx) (uri.Uri, error)
- func PeekReferrerHeader(c *fiber.Ctx) []byte
- func PeekReferrerQueryOrHeader(c *fiber.Ctx) []byte
- func Xxh3(bytesSlice ...[]byte) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyOrEmptyJsonObj ¶
func BodyOrEmptyJsonObj(c *fiber.Ctx) []byte
BodyOrEmptyJsonObj returns request body or an empty JSON object buffer otherwise.
func ComputeDeviceId ¶
ComputeDeviceId computes xxh3 hash of the given byte slices. This is the same as Xxh3 function.
func ComputeVisitorId ¶
ComputeVisitorId computes xxh3 hash of the given byte slices and adds result as hexadecimal suffix to "prisme_".
func ContextTimeout ¶
ContextTimeout extract duration until context timeout and panics if no deadline is found.
func ExtractClientHints ¶ added in v0.18.0
func ExtractClientHints(headers *fasthttp.RequestHeader, client *uaparser.Client)
ExtractClientHints parses Sec-Ch-Ua-XXX headers and adds them to the given *uaparser.Client.
func ExtractUtmParams ¶
ExtractUtmParams extracts UTM parameters from the given query args. If no utm_source arg is found, it fallbacks to ref arg.
func PeekAndParseReferrerHeader ¶ added in v0.18.0
PeekAndParseReferrerHeader retrieves and parses prisme or standard referrer header. In case of error, a fiber error with status 400 bad request is returned.
func PeekAndParseReferrerQueryHeader ¶ added in v0.18.0
PeekAndParseReferrerHeader retrieves and parses referrer from query parameter or standard header. In case of error, a fiber error with status 400 bad request is returned.
func PeekReferrerHeader ¶
func PeekReferrerHeader(c *fiber.Ctx) []byte
PeekReferrerHeader peek X-Prisme-Referrer header and fallback to standard Referer header otherwise.
func PeekReferrerQueryOrHeader ¶
func PeekReferrerQueryOrHeader(c *fiber.Ctx) []byte
PeekReferrerQueryOrHeader peek referrer from "referrer" query parameter and fallback to standard Referer header otherwise.
Types ¶
This section is empty.