staples

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var False = ptr(false)
View Source
var True = ptr(true)

Functions

func Fingerprint

func Fingerprint(remoteIP, userAgent, domain, host string) (sum uint64)

func NewRecordBuilder

func NewRecordBuilder(mem memory.Allocator, as *arrow.Schema) (*array.RecordBuilder, func(reflect.Value))

func NewTaker

func NewTaker(mem memory.Allocator, as *arrow.Schema) (*array.RecordBuilder, func(arrow.Record, []int, []uint32))

func Schema

func Schema[T any]() *arrow.Schema

Types

type Arrow

type Arrow[T any] struct {
	// contains filtered or unexported fields
}

func NewArrow

func NewArrow[T any](mem memory.Allocator) *Arrow[T]

func (*Arrow[T]) Append

func (a *Arrow[T]) Append(v *T)

func (*Arrow[T]) NewRecord

func (a *Arrow[T]) NewRecord() arrow.Record

func (*Arrow[T]) Release

func (a *Arrow[T]) Release()

type Event

type Event struct {
	Timestamp int64
	ID        int64
	// When a new session is established for the first time we set Bounce to 1, if
	// a user visits another page within the same session for the first time Bounce
	// is set to -1, any subsequent visits within the session sets Bounce to 0.
	//
	// This allows effective calculation of bounce rate by just summing the Bounce
	// column with faster math.Int64.Sum.
	//
	// NOTE: Bounce is calculated per session. We simply want to know if a user
	// stayed and browsed the website.
	Bounce   *bool
	Session  bool
	View     bool
	Duration float64

	Browser        string
	BrowserVersion string
	City           string
	Country        string
	Domain         string
	EntryPage      string
	ExitPage       string
	Host           string
	Event          string
	Os             string
	OsVersion      string
	Path           string
	Referrer       string
	ReferrerSource string
	Region         string
	Screen         string
	UtmCampaign    string
	UtmContent     string
	UtmMedium      string
	UtmSource      string
	UtmTerm        string
}

func NewEvent

func NewEvent() *Event

func Parse

func Parse(ctx context.Context, req *v1.Event) *Event

func (*Event) Hit

func (e *Event) Hit()

func (*Event) Release

func (e *Event) Release()

func (*Event) Size added in v0.0.61

func (e *Event) Size() (n int)

Size in bytes of e in memory. We use this as a cost to control cache size.

func (*Event) TS

func (e *Event) TS() int64

func (*Event) Update

func (s *Event) Update(e *Event)

type FullIndex

type FullIndex struct {
	// contains filtered or unexported fields
}

func NewFullIdx added in v0.0.61

func NewFullIdx(m map[string]*index.FullColumn, min, max uint64) *FullIndex

func (*FullIndex) CanIndex added in v0.0.61

func (idx *FullIndex) CanIndex() bool

func (*FullIndex) Columns

func (idx *FullIndex) Columns(f func(column index.Column) error) error

func (*FullIndex) Match

func (idx *FullIndex) Match(b *roaring.Bitmap, m []*filters.CompiledFilter)

func (*FullIndex) Max added in v0.0.61

func (idx *FullIndex) Max() (n uint64)

func (*FullIndex) Min added in v0.0.61

func (idx *FullIndex) Min() (n uint64)

func (*FullIndex) Size

func (idx *FullIndex) Size() (n uint64)

type Index

type Index struct{}

func NewIndex

func NewIndex() *Index

func (*Index) Index

func (idx *Index) Index(r arrow.Record) (index.Full, error)

type Merger

type Merger struct {
	// contains filtered or unexported fields
}

func NewMerger

func NewMerger(mem memory.Allocator, as *arrow.Schema) *Merger

func (*Merger) Merge

func (m *Merger) Merge(records ...arrow.Record) arrow.Record

Jump to

Keyboard shortcuts

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