Versions in this module Expand all Collapse all v0 v0.1.0 Jan 23, 2024 Changes in this version + func NewAdminAPI(debug bool) *echo.Echo + func SetConfigDefaults() + type AsyncEventSaver struct + func NewAsyncEventSaver(events chan PicolyticsEvent, salter Salter, validEventNames []string, ...) *AsyncEventSaver + func (es *AsyncEventSaver) SaveEvent(event PicolyticsEvent) + type Config struct + AdminListen string + AppVersion string + AutotlsEnabled bool + AutotlsHost string + AutotlsStaging bool + BatchMaxMsec int + BatchMaxSize int + BodyMaxSize int64 + Debug bool + DisableHostMetrics bool + GeoIPFile string + GitBranch string + GitCommit string + IPExtractor string + ListenAddr string + LogFormat string + PgConnAttempts int + PgConnString string + PgDatabase string + PgHost string + PgPassword string + PgPort int + PgSslMode string + PgUser string + PruneCheckHours int + PruneDays int + QueueSize int + RequestRateLimit int + RootRedirect string + SessionTimeoutMin int + SkipMigrations bool + StaticCacheMaxAge int + StaticDir string + StaticFiles fs.FS + TrustedProxies []string + ValidEventNames []string + type DailySalt struct + func NewDailySalt(pool PgxIface) *DailySalt + type EchoAPI struct + E *echo.Echo + func NewEchoAPI(config *Config, o11y *PicolyticsO11y) (EchoAPI, error) + func (api EchoAPI) Shutdown(ctx context.Context) error + func (api EchoAPI) Start(address string, autotls bool) error + func (e *EchoAPI) HandleStatic(c echo.Context) error + type EventDomains map[string]int32 + type EventSaver interface + SaveEvent func(event PicolyticsEvent) + type EventSessions map[string]int64 + type Metrics struct + type PgxIface interface + Begin func(context.Context) (pgx.Tx, error) + Close func() + CopyFrom func(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error) + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + type Picolytics struct + O11y *PicolyticsO11y + func New(config *Config, logHandler slog.Handler, pool PgxIface) (Picolytics, error) + func (p *Picolytics) HandleShutdown() + func (p *Picolytics) Run() + func (p *Picolytics) Shutdown() + type PicolyticsEvent struct + Bot bool + Browser string + BrowserVersion string + City string + ClientIpDONOTSTORE string + Country string + Created time.Time + DeviceType string + Domain string + Lang string + Latitude float64 + LoadTime int32 + Location string + Longitude float64 + Name string + Os string + OsVersion string + Path string + PixelDepth int32 + PixelRatio float64 + Platform string + Referrer string + ScreenH int32 + ScreenW int32 + Subdivision string + TTFB int32 + Timezone string + UaDONOTSTORE string + UtmCampaign string + UtmContent string + UtmMedium string + UtmSource string + UtmTerm string + VisitorID string + type PicolyticsO11y struct + Logger *slog.Logger + Metrics *Metrics + type PostgresAutocertCache struct + func NewPostgresCache(pool PgxIface) *PostgresAutocertCache + func (c *PostgresAutocertCache) Delete(ctx context.Context, key string) error + func (c *PostgresAutocertCache) Get(ctx context.Context, key string) ([]byte, error) + func (c *PostgresAutocertCache) Put(ctx context.Context, key string, data []byte) error + type Pruner struct + func NewPruner(config *Config, pool PgxIface, o11y *PicolyticsO11y) (*Pruner, error) + type Salter interface + type Trackers struct + func NewTrackers(eventSaver EventSaver, bodyMaxSize int64) *Trackers + type UsingEmbeddedStaticFiles bool + type Worker struct + func NewWorker(config *Config, pool PgxIface, o11y *PicolyticsO11y) (*Worker, error) + func (w *Worker) Shutdown()