Versions in this module Expand all Collapse all v1 v1.4.2 Nov 10, 2020 Changes in this version + const ExportVersion + const PathTotals + const PlanBusiness + const PlanBusinessPlus + const PlanChild + const PlanPersonal + const PlanPersonalPlus + const StateActive + const StateDeleted + const StateRequest + var Memstore ms + var Now = func() time.Time + var Plans = []string + var RefSchemeCampaign = ptr("c") + var RefSchemeGenerated = ptr("g") + var RefSchemeHTTP = ptr("h") + var RefSchemeOther = ptr("o") + var SQLiteHook = func(c *sqlite3.SQLiteConn) error + var States = []string + var TestSeqSession = zint.Uint128 + var TestSession = zint.Uint128 + func BarChart(ctx context.Context, stats []Stat, max int, daily bool) template.HTML + func ChunkStat(stats []Stat) (int, []int) + func EmailTemplate(tplname string, args interface{}) func() ([]byte, error) + func GetMax(ctx context.Context, start, end time.Time, filter string, daily bool) (int, error) + func GetTotalCount(ctx context.Context, start, end time.Time, filter string) (int, int, error) + func GetTotalCountUTC(ctx context.Context, start, end time.Time, filter string) (int, int, error) + func HorizontalChart(ctx context.Context, stats Stats, total, pageSize int, link, paginate bool) template.HTML + func Import(ctx context.Context, fp io.Reader, replace, email bool) + func NewContext(ctx context.Context) context.Context + func ResetCache() + func TextChart(ctx context.Context, stats []Stat, max int, daily bool) template.HTML + func WithSite(ctx context.Context, s *Site) context.Context + func WithUser(ctx context.Context, u *User) context.Context + type APIToken struct + CreatedAt time.Time + ID int64 + Name string + Permissions APITokenPermissions + SiteID int64 + Token string + UserID int64 + func (t *APIToken) ByID(ctx context.Context, id int64) error + func (t *APIToken) ByToken(ctx context.Context, token string) error + func (t *APIToken) Defaults(ctx context.Context) + func (t *APIToken) Delete(ctx context.Context) error + func (t *APIToken) Insert(ctx context.Context) error + func (t *APIToken) Validate(ctx context.Context) error + type APITokenPermissions struct + Count bool + Export bool + SiteCreate bool + SiteRead bool + SiteUpdate bool + func (tp *APITokenPermissions) Scan(v interface{}) error + func (tp APITokenPermissions) String() string + func (tp APITokenPermissions) Value() (driver.Value, error) + type APITokens []APIToken + func (t *APITokens) List(ctx context.Context) error + type AdminBotlog struct + Bot int + Headers http.Header + ID int64 + IP int64 + URL string + UserAgent string + func (b AdminBotlog) Insert(ctx context.Context, ip string) error + type AdminBotlogIP struct + Count int + CreatedAt time.Time + Hide zdb.Bool + ID int64 + IP string + Info *string + LastSeen time.Time + Links [][]string + PTR *string + type AdminBotlogIPs []AdminBotlogIP + func (b *AdminBotlogIPs) List(ctx context.Context) error + type AdminSiteStat struct + CountLastMonth int + CountPrevMonth int + CountTotal int + LastData time.Time + Site Site + User User + func (a *AdminSiteStat) ByCode(ctx context.Context, code string) error + func (a *AdminSiteStat) ByID(ctx context.Context, id int64) error + type AdminStat struct + BillingAmount *string + Code string + CreatedAt time.Time + Email string + ID int64 + LastMonth int + LinkDomain string + Parent *int64 + Plan string + Stripe *string + Total int + type AdminStats []AdminStat + func (a *AdminStats) List(ctx context.Context) error + type Export struct + CreatedAt time.Time + Error *string + FinishedAt *time.Time + Hash *string + ID int64 + LastHitID *int64 + NumRows *int + Path string + SiteID int64 + Size *string + StartFromHitID int64 + func (e *Export) ByID(ctx context.Context, id int64) error + func (e *Export) Create(ctx context.Context, startFrom int64) (*os.File, error) + func (e *Export) Run(ctx context.Context, fp *os.File, mailUser bool) + type ExportRow struct + Bot string + Browser string + CreatedAt string + Event string + FirstVisit string + Location string + Path string + Ref string + RefScheme string + Session string + Size string + Title string + func (row *ExportRow) Read(line []string) error + func (row ExportRow) Hit(siteID int64) (Hit, error) + type Exports []Export + func (e *Exports) List(ctx context.Context) error + type Hit struct + Bot int + Browser string + CreatedAt time.Time + Event zdb.Bool + FirstVisit zdb.Bool + ID int64 + Location string + OldSession *int64 + Path string + Query string + Random string + Ref string + RefScheme *string + RefURL *url.URL + RemoteAddr string + Session zint.Uint128 + Site int64 + Size zdb.Floats + Title string + UserSessionID string + func (h *Hit) Defaults(ctx context.Context) + func (h *Hit) Validate(ctx context.Context) error + func (h Hit) String() string + type HitStat struct + Count int + CountUnique int + Event zdb.Bool + Max int + Path string + RefScheme *string + Stats []Stat + Title string + func (h *HitStat) Totals(ctx context.Context, start, end time.Time, filter string, daily bool) (int, error) + type HitStats []HitStat + func (h *HitStats) List(ctx context.Context, start, end time.Time, filter string, exclude []string, ...) (int, int, bool, error) + func (h *HitStats) ListPathsLike(ctx context.Context, path string, matchTitle bool) error + func (h *HitStats) PathCountUnique(ctx context.Context, path string) error + func (h *HitStats) SiteTotalUnique(ctx context.Context) error + type Hits []Hit + func (h *Hits) Count(ctx context.Context) (int64, error) + func (h *Hits) List(ctx context.Context, limit, paginate int64) (int64, error) + func (h *Hits) Purge(ctx context.Context, path string, matchTitle bool) error + type Site struct + BillingAmount *string + Cname *string + CnameSetupAt *time.Time + Code string + CreatedAt time.Time + ID int64 + LinkDomain string + Parent *int64 + Plan string + ReceivedData bool + Settings SiteSettings + State string + Stripe *string + UpdatedAt *time.Time + func GetSite(ctx context.Context) *Site + func MustGetSite(ctx context.Context) *Site + func (s *Site) ByCode(ctx context.Context, code string) error + func (s *Site) ByHost(ctx context.Context, host string) error + func (s *Site) ByID(ctx context.Context, id int64) error + func (s *Site) Defaults(ctx context.Context) + func (s *Site) Delete(ctx context.Context) error + func (s *Site) Insert(ctx context.Context) error + func (s *Site) ListSubs(ctx context.Context) ([]string, error) + func (s *Site) Update(ctx context.Context) error + func (s *Site) UpdateCnameSetupAt(ctx context.Context) error + func (s *Site) UpdateCode(ctx context.Context, code string) error + func (s *Site) UpdateReceivedData(ctx context.Context) error + func (s *Site) UpdateStripe(ctx context.Context, stripeID, plan, amount string) error + func (s *Site) Validate(ctx context.Context) error + func (s Site) Admin() bool + func (s Site) DeleteAll(ctx context.Context) error + func (s Site) DeleteOlderThan(ctx context.Context, days int) error + func (s Site) Display() string + func (s Site) Domain() string + func (s Site) FreePlan() bool + func (s Site) IDOrParent() int64 + func (s Site) PayExternal() string + func (s Site) PlanCustomDomain(ctx context.Context) bool + func (s Site) ShowPayBanner(ctx context.Context) bool + func (s Site) URL() string + type SiteSettings struct + AllowAdmin bool + AllowCounter bool + Campaigns zdb.Strings + DataRetention int + DateFormat string + IgnoreIPs zdb.Strings + Limits struct{ ... } + NumberFormat rune + Public bool + SundayStartsWeek bool + Timezone *tz.Zone + TwentyFourHours bool + func (ss *SiteSettings) Scan(v interface{}) error + func (ss SiteSettings) String() string + func (ss SiteSettings) Value() (driver.Value, error) + type Sites []Site + func (s *Sites) ContainsCNAME(ctx context.Context, cname string) (bool, error) + func (s *Sites) ListSubs(ctx context.Context) error + func (s *Sites) OldSoftDeleted(ctx context.Context) error + func (s *Sites) UnscopedList(ctx context.Context) error + func (s *Sites) UnscopedListCnames(ctx context.Context) error + type Stat struct + Daily int + DailyUnique int + Day string + Hourly []int + HourlyUnique []int + type StatT struct + Count int + CountUnique int + Name string + RefScheme *string + type Stats struct + More bool + Stats []StatT + func (h *Stats) ByRef(ctx context.Context, start, end time.Time, ref string) error + func (h *Stats) ListBrowser(ctx context.Context, browser string, start, end time.Time) error + func (h *Stats) ListBrowsers(ctx context.Context, start, end time.Time, limit, offset int) error + func (h *Stats) ListLocations(ctx context.Context, start, end time.Time, limit, offset int) error + func (h *Stats) ListRefsByPath(ctx context.Context, path string, start, end time.Time, offset int) error + func (h *Stats) ListSize(ctx context.Context, name string, start, end time.Time) error + func (h *Stats) ListSizes(ctx context.Context, start, end time.Time) error + func (h *Stats) ListSystem(ctx context.Context, system string, start, end time.Time) error + func (h *Stats) ListSystems(ctx context.Context, start, end time.Time, limit, offset int) error + func (h *Stats) ListTopRefs(ctx context.Context, start, end time.Time, offset int) error + type Update struct + Body string + CreatedAt time.Time + ID int64 + Seen bool + ShowAt time.Time + Subject string + type Updates []Update + func (u *Updates) HasSince(ctx context.Context, since time.Time) (bool, error) + func (u *Updates) List(ctx context.Context, since time.Time) error + type User struct + CSRFToken *string + CreatedAt time.Time + Email string + EmailToken *string + EmailVerified zdb.Bool + ID int64 + LoginAt *time.Time + LoginRequest *string + LoginToken *string + Password []byte + ResetAt *time.Time + Role string + SeenUpdatesAt time.Time + Site int64 + TOTPEnabled zdb.Bool + TOTPSecret []byte + UpdatedAt *time.Time + func GetUser(ctx context.Context) *User + func (u *User) ByEmail(ctx context.Context, email string) error + func (u *User) ByEmailToken(ctx context.Context, key string) error + func (u *User) ByResetToken(ctx context.Context, key string) error + func (u *User) BySite(ctx context.Context, id int64) error + func (u *User) ByToken(ctx context.Context, token string) error + func (u *User) ByTokenAndSite(ctx context.Context, token string) error + func (u *User) Defaults(ctx context.Context) + func (u *User) DisableTOTP(ctx context.Context) error + func (u *User) EnableTOTP(ctx context.Context) error + func (u *User) GetToken() string + func (u *User) Insert(ctx context.Context) error + func (u *User) Login(ctx context.Context) error + func (u *User) Logout(ctx context.Context) error + func (u *User) RequestReset(ctx context.Context) error + func (u *User) SeenUpdates(ctx context.Context) error + func (u *User) Update(ctx context.Context, emailChanged bool) error + func (u *User) UpdatePassword(ctx context.Context, pwd string) error + func (u *User) Validate(ctx context.Context, validatePassword bool) error + func (u *User) VerifyEmail(ctx context.Context) error + func (u User) CorrectPassword(pwd string) (bool, error) + func (u User) Widgets() []string + type Users []User + func (u *Users) ByEmail(ctx context.Context, email string) error Other modules containing this package zgo.at/goatcounter/v2