group

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package group organizes journal entries by month for chronological display.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGroupedIndex

func BuildGroupedIndex(
	entries []entity.JournalEntry, extractKeys func(entity.JournalEntry) []string,
) []entity.GroupedIndex

BuildGroupedIndex aggregates entries by keys extracted via extractKeys, marks groups with 2+ sessions as popular, and sorts by count descending then alphabetically.

Parameters:

  • entries: Journal entries to aggregate
  • extractKeys: Function that returns grouping keys for a given entry

Returns:

  • []GroupedIndex: Sorted groups with popularity flags

func GroupByMonth

func GroupByMonth(
	entries []entity.JournalEntry,
) (map[string][]entity.JournalEntry, []string)

GroupByMonth groups journal entries by their YYYY-MM date prefix, preserving insertion order of months.

Parameters:

  • entries: Journal entries to group (must have Date field set)

Returns:

  • map[string][]JournalEntry: Entries keyed by month string
  • []string: Month strings in first-seen order

Types

This section is empty.

Jump to

Keyboard shortcuts

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