Documentation
¶
Overview ¶
Package render は論理イベントを各種フォーマットで出力する。
Index ¶
- func AccountLabel(r model.Resource) string
- func CSV(w io.Writer, events []model.LogicalEvent) error
- func Countdown(status string, start, now time.Time) string
- func FormatDate(t time.Time) string
- func FormatTime(t time.Time) string
- func GroupLabel(g model.EventGroup, topicMode bool) string
- func GroupMarkdown(w io.Writer, groups []model.EventGroup, now time.Time, topicMode bool)
- func GroupTable(w io.Writer, groups []model.EventGroup, now time.Time, ...)
- func JSON(w io.Writer, events []model.LogicalEvent) error
- func JoinRegions(regions []string) string
- func Markdown(w io.Writer, events []model.LogicalEvent, now time.Time, ...)
- func OrDash(s string) string
- func Render(w io.Writer, format string, events []model.LogicalEvent, now time.Time, ...) error
- func RenderGroups(w io.Writer, format string, groups []model.EventGroup, now time.Time, ...) error
- func SanitizeCell(s string) string
- func SanitizeText(s string) string
- func SetDisplayLocation(loc *time.Location)
- func StatusSummary(counts map[string]int) string
- func Table(w io.Writer, events []model.LogicalEvent, now time.Time, ...)
- func ZoneAbbrev(t time.Time) string
- func ZoneName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountLabel ¶
func CSV ¶
func CSV(w io.Writer, events []model.LogicalEvent) error
CSV はリソース単位の行で出力する(リソースが無いイベントは1行、リソース列は空)。
func FormatDate ¶
FormatDate は日付のみ "2006-01-02"(displayLoc)で整形する(ゼロ値は "-")。
func FormatTime ¶
func GroupLabel ¶
func GroupLabel(g model.EventGroup, topicMode bool) string
GroupLabel は表示ラベル(topicMode なら話題ラベル、無ければ eventTypeCode)。
func GroupMarkdown ¶
GroupMarkdown はファミリーのサマリ表を Markdown で出力する。
func GroupTable ¶
func GroupTable(w io.Writer, groups []model.EventGroup, now time.Time, topicMode, showDetails, showResources, showOccurrences bool)
GroupTable はファミリーのサマリ表+(オプションで)説明・リソース・配下日程を出力する。
func JoinRegions ¶
func Markdown ¶
func Markdown(w io.Writer, events []model.LogicalEvent, now time.Time, showDetails, showResources bool)
Markdown はテーブルと、変更内容説明・影響リソースのサブセクションを出力する。
func Render ¶
func Render(w io.Writer, format string, events []model.LogicalEvent, now time.Time, showDetails, showResources bool) error
Render は指定フォーマットで論理イベントを出力する。
func RenderGroups ¶
func RenderGroups(w io.Writer, format string, groups []model.EventGroup, now time.Time, topicMode, showDetails, showResources, showOccurrences bool) error
RenderGroups は eventTypeCode/topic 単位のロールアップを出力する。 topicMode が true のとき TOPIC 列(話題ラベル)を表示する。
func SanitizeCell ¶ added in v0.5.0
SanitizeCell は 1 行セル向け。ANSI を除去し、改行・タブ・CR を含むすべての制御文字を 空白化してテーブル/CSV のレイアウト崩れと端末インジェクションを防ぐ。
func SanitizeText ¶ added in v0.5.0
SanitizeText は複数行ブロック向け。改行・タブは保持しつつ ANSI と他の制御文字を除去する。
func SetDisplayLocation ¶
SetDisplayLocation は時刻表示のタイムゾーンを設定する(CLI 起動時に一度だけ呼ぶ想定)。
func StatusSummary ¶
StatusSummary は status 件数を深刻度順に "open:2 upcoming:5" のように整形する。
func Table ¶
func Table(w io.Writer, events []model.LogicalEvent, now time.Time, showDetails, showResources bool)
Table はマージ済みイベントを tabwriter のテーブルで出力する。 IN 列は開始までの残り時間(now 基準)。showDetails で変更内容説明、 showResources で影響リソースを各イベントの下に展開する。
func ZoneAbbrev ¶
ZoneAbbrev は t を表示タイムゾーンに変換したときのゾーン略称("UTC"/"JST" 等)を返す。
Types ¶
This section is empty.