ro2

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupDOmain

func CleanupDOmain(domain string) string

func PasswordMatch

func PasswordMatch(pwd string) bool

func StatToValue

func StatToValue(metric string) func(s *Stats) float64

Types

type And

type And []Filter

func (And) Apply

func (a And) Apply(rtx *Tx, shard uint64, view uint64, columns *roaring.Bitmap) *roaring.Bitmap

type DB

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

func (*DB) ApplyLicense

func (db *DB) ApplyLicense(licenseKey []byte) error

func (*DB) Badger

func (db *DB) Badger() *badger.DB

func (*DB) Close

func (db *DB) Close() error

func (*DB) CreateSite

func (db *DB) CreateSite(domain string, public bool) (err error)

func (*DB) DeleteDomain

func (db *DB) DeleteDomain(domain string) (err error)
func (db *DB) DeleteSharedLink(site *v1.Site, slug string) error

func (*DB) Domains

func (db *DB) Domains(f func(*v1.Site))
func (db *DB) EditSharedLink(site *v1.Site, slug, name string) error
func (db *DB) FindOrCreateCreateSharedLink(domain string, name, password string) (share *v1.Share)

func (*DB) LockSites

func (db *DB) LockSites(locked bool) error

func (*DB) PatchLicense

func (db *DB) PatchLicense(key *v1.License) error

func (*DB) Save

func (db *DB) Save(u *v1.Site) error

func (*DB) SeenFirstStats

func (db *DB) SeenFirstStats(domain string) (ok bool)

func (*DB) Site

func (db *DB) Site(domain string) (u *v1.Site)

func (*DB) Start

func (db *DB) Start(ctx context.Context)

func (*DB) Update

func (db *DB) Update(f func(tx *Tx) error) error

func (*DB) ValidateSiteDomain

func (db *DB) ValidateSiteDomain(domain string) (good, bad string)

func (*DB) View

func (db *DB) View(f func(tx *Tx) error) error

type Filter

type Filter interface {
	Apply(rtx *Tx, shard uint64, view uint64, columns *roaring.Bitmap) *roaring.Bitmap
}

type Match

type Match struct {
	Field  v1.Field
	Values []int64
	Negate bool
	Op     roaring.Operation
}

func (*Match) Apply

func (m *Match) Apply(rtx *Tx, shard uint64, view uint64, columns *roaring.Bitmap) (b *roaring.Bitmap)

type Reject

type Reject struct{}

func (Reject) Apply

func (Reject) Apply(rtx *Tx, shard uint64, view uint64, columns *roaring.Bitmap) *roaring.Bitmap

type Result

type Result struct {
	Results []map[string]any `json:"results"`
}

type Stats

type Stats struct {
	Visitors, Visits, PageViews, ViewsPerVisits, BounceRate, VisitDuration float64
	// contains filtered or unexported fields
}

func NewStats

func NewStats(fs fieldset.Set) *Stats

func (*Stats) Compute

func (s *Stats) Compute()

func (*Stats) Read

func (d *Stats) Read(tx *Tx, shard, view uint64, match *roaring.Bitmap, fields fieldset.Set) error

type Store

type Store struct {
	*DB
}

func Open

func Open(path string) (*Store, error)

func (*Store) Breakdown

func (o *Store) Breakdown(domain string, params *query.Query, metrics []string, field v1.Field) (*Result, error)

func (*Store) BreakdownCity

func (o *Store) BreakdownCity(domain string, params *query.Query) (*Result, error)

func (*Store) BreakdownExitPages

func (o *Store) BreakdownExitPages(domain string, params *query.Query) (*Result, error)

func (*Store) BreakdownVisitorsWithPercentage

func (o *Store) BreakdownVisitorsWithPercentage(domain string, params *query.Query, field v1.Field) (*Result, error)

func (*Store) CurrentVisitors

func (o *Store) CurrentVisitors(domain string) (visitors uint64, err error)

func (*Store) Delete

func (s *Store) Delete(_ context.Context, key string) error

func (*Store) Get

func (s *Store) Get(_ context.Context, key string) ([]byte, error)

func (*Store) Put

func (s *Store) Put(_ context.Context, key string, data []byte) error

func (*Store) Stats

func (o *Store) Stats(domain string, start, end time.Time, interval query.Interval, filters query.Filters, metrics []string) (*Stats, error)

func (*Store) Timeseries

func (o *Store) Timeseries(domain string, params *query.Query, metrics []string) (map[string]*Stats, error)

func (*Store) Visitors

func (o *Store) Visitors(domain string) (visitors uint64, err error)

func (*Store) Web

func (o *Store) Web() (secret *age.X25519Identity, err error)

type Tx

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

func (*Tx) Bitmap

func (tx *Tx) Bitmap(shard, view uint64, field v1.Field, f func(bs *roaring.BSI)) error

func (*Tx) Close

func (tx *Tx) Close()

func (*Tx) Count

func (tx *Tx) Count(shard, view uint64, field v1.Field, match *roaring.Bitmap) (count uint64, err error)

func (*Tx) Find

func (tx *Tx) Find(field v1.Field, id uint64) (o string)

func (*Tx) ID

func (tx *Tx) ID(field v1.Field, value string) (id uint64, ok bool)

func (*Tx) Iter

func (tx *Tx) Iter() *badger.Iterator

func (*Tx) RecordID

func (tx *Tx) RecordID() uint64

func (*Tx) Release

func (tx *Tx) Release()

func (*Tx) Search

func (tx *Tx) Search(field v1.Field, prefix []byte, f func([]byte, uint64))

func (*Tx) Select

func (tx *Tx) Select(domain string, start,
	end time.Time, intrerval query.Interval, filters query.Filters, cb func(shard, view uint64, columns *roaring.Bitmap) error) error

func (*Tx) Sum

func (tx *Tx) Sum(shard, view uint64, field v1.Field, match *roaring.Bitmap) (sum int64, err error)

func (*Tx) Translate

func (tx *Tx) Translate(field v1.Field, value string) (id uint64)

func (*Tx) Transpose

func (tx *Tx) Transpose(shard, view uint64, field v1.Field, match *roaring.Bitmap) (result *roaring.Bitmap, err error)

func (*Tx) TransposeSet

func (tx *Tx) TransposeSet(shard, view uint64, field v1.Field, match *roaring.Bitmap) (result map[int64][]uint64, err error)

func (*Tx) Unique

func (tx *Tx) Unique(shard, view uint64, field v1.Field, match *roaring.Bitmap) (uint64, error)

Jump to

Keyboard shortcuts

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