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 ¶
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.