thread

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package thread reconstructs conversations from a flat set of records. It is pure: tweets in, ordered threads out, no network and no clock, so it carries golden tests for the ordering rules (spec §14). A "thread" here is every captured tweet sharing a conversation id, ordered chronologically; a tweet alone in its conversation is a standalone post, represented as a one-tweet thread so the renderers treat both uniformly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thread

type Thread struct {
	RootID string
	Root   *x.Tweet
	Tweets []*x.Tweet
}

Thread is one reconstructed conversation: a root tweet and every captured tweet in the same conversation, ordered oldest-first.

func Assemble

func Assemble(tweets []*x.Tweet) []Thread

Assemble groups tweets into threads keyed by conversation id. Within a thread the tweets are ordered by id ascending (chronological); the root is the tweet whose id equals the conversation id when present, else the earliest tweet in the group. The returned threads are ordered by root id descending (newest first), the natural reverse-chronological order for a profile index. The order is a pure function of the input, so it is reproducible (TP5).

func (Thread) Standalone

func (t Thread) Standalone() bool

Standalone reports whether the thread is a single post with no captured replies — the common case for a profile timeline.

Jump to

Keyboard shortcuts

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