insights

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package insights persists saved reports — the "pin this report" feature that turns ad-hoc Explore into a dashboard you open every morning. Config-shaped (small, mutable), so it's a single JSON file rewritten atomically on change, separate from the append-only event log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Insight

type Insight struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Type    string            `json:"type"`
	Params  map[string]string `json:"params"`
	Created time.Time         `json:"created"`
}

Insight is one saved report: a type (funnel|trend|breakdown|retention) plus the params Explore needs to re-run it.

type Store

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

Store holds saved insights in memory and (when path != "") persists them.

func Open

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

Open loads saved insights from path (empty/missing = start fresh). An empty path means in-memory only (used by the throwaway demo).

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete removes an insight by id (no error if it's already gone).

func (*Store) List

func (s *Store) List() []Insight

func (*Store) Save

func (s *Store) Save(in Insight) (Insight, error)

Save validates and stores an insight (assigning an id), then persists. Returns the stored copy.

Jump to

Keyboard shortcuts

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