utils

package
v0.17.0-beta09 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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

func ComputeDeviceId(bytesSlice ...[]byte) uint64

ComputeDeviceId computes xxh3 hash of the given byte slices. This is the same as Xxh3 function.

func ComputeVisitorId

func ComputeVisitorId(bytesSlice ...[]byte) string

ComputeVisitorId computes xxh3 hash of the given byte slices and adds result as hexadecimal suffix to "prisme_".

func ContextTimeout

func ContextTimeout(ctx context.Context) time.Duration

ContextTimeout extract duration until context timeout and panics if no deadline is found.

func ExtractUtmParams

func ExtractUtmParams(args *fasthttp.Args) event.UtmParams

ExtractUtmParams extracts UTM parameters from the given query args. If no utm_source arg is found, it fallbacks to ref arg.

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.

func Xxh3

func Xxh3(bytesSlice ...[]byte) uint64

Xxh3 computes xxh3 hash of the given byte slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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