format

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptiveCodeBlock added in v0.14.0

func AdaptiveCodeBlock(msg string) string

AdaptiveCodeBlock trims whitespace and wraps a message in a code block. If message is a single line, an inline code block is used.

func BulletPointEventAttachments added in v0.15.0

func BulletPointEventAttachments(event event.Event) string

BulletPointEventAttachments returns formatted lists of event messages, recommendations and warnings.

func BulletPointListFromMessages added in v0.15.0

func BulletPointListFromMessages(msgs []string) string

BulletPointListFromMessages creates a Markdown bullet-point list from messages. See https://api.slack.com/reference/surfaces/formatting#block-formatting

func CodeBlock

func CodeBlock(msg string) string

CodeBlock trims whitespace and wraps a message in a code block.

func JoinMessages

func JoinMessages(msgs []string) string

JoinMessages joins strings in slice with new line characters. It also appends a trailing newline at the end of message.

func RemoveHyperlinks(in string) string

RemoveHyperlinks removes the hyperlink text from url

func ShortMessage

func ShortMessage(event event.Event) string

ShortMessage prepares message in short event format.

func ShortNotificationHeader added in v0.15.0

func ShortNotificationHeader(event event.Event) string

ShortNotificationHeader returns short header for event notification.

func StructDumper added in v0.16.0

func StructDumper() litter.Options

StructDumper default dumper for structs

func ToTitle added in v0.18.0

func ToTitle(in fmt.Stringer) string

ToTitle returns English specific title casing.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳