app

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphTypeToString added in v1.1.0

func GraphTypeToString(g GraphType) string

func PeriodToString added in v1.1.0

func PeriodToString(p Period) string

Types

type GraphType added in v1.1.0

type GraphType int
const (
	GraphLine GraphType = iota
	GraphBar
)

func GraphTypeFromString added in v1.1.0

func GraphTypeFromString(s string) GraphType

type Model

type Model struct {
	Site             string
	Client           *api.Client
	Period           Period
	Graph            GraphType
	Aggregate        api.Aggregate
	Pages            []api.PageStats
	Sources          []api.SourceStats
	TimeSeries       []api.TimeSeriesPoint
	RealtimeVisitors int
	Loading          bool
	Err              error
	Width            int
	Height           int
	LiveTick         bool // toggles for blinking indicator
}

func New

func New(site string, client *api.Client, graphType GraphType, period Period) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) ToggleGraph added in v1.1.0

func (m *Model) ToggleGraph()

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Period

type Period int
const (
	PeriodToday Period = iota
	PeriodYesterday
	PeriodWeek
	PeriodMonth
)

func PeriodFromString added in v1.1.0

func PeriodFromString(s string) Period

func (Period) DateRange

func (p Period) DateRange() string

func (Period) Label

func (p Period) Label() string

func (Period) TimeDimension

func (p Period) TimeDimension() string

Jump to

Keyboard shortcuts

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