drafty

package
Version: v0.17.10 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package drafty contains utilities for conversion from Drafty to plain text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preview added in v0.16.10

func Preview(content interface{}, length int) (string, error)

Preview shortens Drafty to the specified length (in runes) and removes large content from entities making them suitable for a one-line preview, for example for showing in push notifications.

func ToPlainText

func ToPlainText(content interface{}) (string, error)

ToPlainText converts message payload from Drafy to string. If content is plain string, then it's returned unchanged. If content is not recognized as either Drafy (as a map[string]interface{}) or as a string, an error is returned.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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