api

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadJSON = errors.New("api: invalid json ")

Functions

func Events

func Events(w http.ResponseWriter, r *http.Request)

Events accepts events payloads from vince client script.

func Health

func Health(w http.ResponseWriter, r *http.Request)

func Version

func Version(w http.ResponseWriter, r *http.Request)

Types

type Request

type Request struct {
	EventName   string `json:"n"`
	URI         string `json:"url"`
	Referrer    string `json:"r"`
	Domain      string `json:"d"`
	ScreenWidth int    `json:"w"`
	HashMode    bool   `json:"h"`
}

Request is sent by the vince script embedded in client websites. For faster performance we use simd if available

func (*Request) Parse

func (r *Request) Parse(body io.Reader) error

Parse opportunistic parses request body to r object. This is crucial method any gains here translates to smooth events ingestion pipeline.

A hard size limitation of 32kb is imposed. This is arbitrary value, any change to it must be be supported with statistics.

Jump to

Keyboard shortcuts

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