Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TitleSanitizer *strings.Replacer
TitleSanitizer replaces characters in paste titles that could cause path traversal or filesystem issues, replacing them with safe alternatives.
Functions ¶
func ExtToLang ¶
ExtToLang converts a file extension (e.g. ".py") to a language name (e.g. "python"). Returns "text" if the extension is not recognized.
func GenerateID ¶
func GenerateID() string
GenerateID creates a cryptographically random 6-character alphanumeric string suitable for use as a paste identifier. Uses crypto/rand to prevent ID prediction.
func GetHighlightedPreview ¶
GetHighlightedPreview returns a plain-text preview snippet centered around the first match of query. The frontend is responsible for highlighting.
func GetPreview ¶
GetPreview returns a cleaned, truncated preview snippet of paste content for display in the sidebar. Returns plain text (no HTML escaping); the frontend is responsible for escaping before rendering.
Types ¶
This section is empty.