Documentation
¶
Overview ¶
Package cohort defines reusable user groups — "users who did checkout", "users from Hacker News who activated" — that you define once and apply across every report. A definition is event membership + property filters; Resolve turns it into the matching user-id set; the Store persists definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterToUsers ¶
FilterToUsers keeps only events belonging to the given user set.
Types ¶
type Definition ¶
type Definition struct {
ID string `json:"id"`
Name string `json:"name"`
Match string `json:"match"` // "any" (default) or "all"
Events []string `json:"events"`
Filters []query.Filter `json:"filters"`
Created time.Time `json:"created"`
}
Definition is a saved cohort: users who did the listed events (any/all), with optional property filters applied when checking membership.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists cohort definitions to a JSON file (atomic rewrite), like saved reports. Empty path = in-memory only.
func (*Store) List ¶
func (s *Store) List() []Definition
func (*Store) Save ¶
func (s *Store) Save(d Definition) (Definition, error)
Click to show internal directories.
Click to hide internal directories.