package gomig

import "zgo.at/goatcounter/v2/db/migrate/gomig"

Index

Variables

var Migrations = map[string]func(context.Context) error{
	"2021-12-08-1-set-chart-text":    KeepAsText,
	"2022-11-15-1-correct-hit-stats": CorrectHitStats,
}

Functions

func CorrectHitStats

func CorrectHitStats(ctx context.Context) error

func KeepAsText

func KeepAsText(ctx context.Context) error

Types

type Hit

type Hit struct {
	ID          int64        `db:"hit_id" json:"-"`
	Site        int64        `db:"site_id" json:"-"`
	PathID      int64        `db:"path_id" json:"-"`
	UserAgentID *int64       `db:"user_agent_id" json:"-"`
	CampaignID  *int64       `db:"campaign" json:"-"`
	Session     zint.Uint128 `db:"session" json:"-"`

	Path  string             `db:"-" json:"p,omitempty"`
	Title string             `db:"-" json:"t,omitempty"`
	Ref   string             `db:"ref" json:"r,omitempty"`
	Event zbool.Bool         `db:"-" json:"e,omitempty"`
	Size  goatcounter.Floats `db:"size" json:"s,omitempty"`
	Query string             `db:"-" json:"q,omitempty"`
	Bot   int                `db:"bot" json:"b,omitempty"`

	RefScheme       *string    `db:"ref_scheme" json:"-"`
	UserAgentHeader string     `db:"-" json:"-"`
	Location        string     `db:"location" json:"-"`
	Language        *string    `db:"language" json:"-"`
	FirstVisit      zbool.Bool `db:"first_visit" json:"-"`
	CreatedAt       time.Time  `db:"created_at" json:"-"`

	RefURL *url.URL `db:"-" json:"-"`   // Parsed Ref
	Random string   `db:"-" json:"rnd"` // Browser cache buster, as they don't always listen to Cache-Control

	// Some values we need to pass from the HTTP handler to memstore
	RemoteAddr    string `db:"-" json:"-"`
	UserSessionID string `db:"-" json:"-"`
	BrowserID     int64  `db:"-" json:"-"`
	SystemID      int64  `db:"-" json:"-"`
	// contains filtered or unexported fields
}

Source Files

2021-12-08-1-set-chart-text.go 2022-11-15-1-correct-hit-stats.go gomig.go

Version
v2.5.0 (latest)
Published
Dec 14, 2023
Platform
linux/amd64
Imports
12 packages
Last checked
1 day ago

Tools for package owners.