output

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package output renders command results. Default is compact JSON (machine friendly, since the primary consumer is an automated agent); --pretty emits indented JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(w io.Writer, v any, pretty bool) error

Emit writes v as JSON to w. When pretty is true the output is indented.

Types

type RenderedPost

type RenderedPost struct {
	ID        string `json:"id"`
	Time      string `json:"time"`
	User      string `json:"user"`
	ChannelID string `json:"channel_id"`
	RootID    string `json:"root_id,omitempty"`
	Message   string `json:"message"`
}

RenderedPost is the flattened, enriched shape we emit for posts: human time and resolved username instead of raw epoch/IDs.

func One

func One(p *mm.Post, usernames map[string]string) RenderedPost

One renders a single post.

func Posts

func Posts(pl *mm.PostList, usernames map[string]string) []RenderedPost

Posts flattens a PostList into chronological RenderedPosts (oldest first), resolving user IDs via the supplied username map. Mattermost's PostList.Order is not reliably time-sorted (notably the thread endpoint), so we sort by CreateAt explicitly.

Jump to

Keyboard shortcuts

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