internal

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package internal implements various functionality (such as caching, emoji character mapping, and ID handling) relied upon by other packages in the Lightning suite.

Index

Constants

This section is empty.

Variables

View Source
var Emoji = map[string]string{}/* 1833 elements not displayed */

Emoji is a mapping of Discord-style emoji shortcodes to their corresponding Unicode character representations.

Functions

func MakeID

func MakeID() string

MakeID creates a random, cryptographically secure, and URL-safe ID string.

func ParseULID

func ParseULID(ulid []byte) time.Time

ParseULID extracts a time.Time from a string containing a ULID.

Types

type Cache

type Cache[K comparable, V any] struct {
	TTL time.Duration
	// contains filtered or unexported fields
}

Cache represents an in-memory cache with a configurable TTL. If the TTL is set to -1, the cleanup routine will never be ran, and items will remain in memory until the process is killed. Concurrent access is safe across goroutines.

func (*Cache[K, V]) Get

func (c *Cache[K, V]) Get(key K) (V, bool)

Get retrieves an item from the Cache using the provided key. It will not modify expiration time, nor will it return items which have expired and still remain in memory.

func (*Cache[K, V]) Set

func (c *Cache[K, V]) Set(key K, value V)

Set creates an item in the Cache using the provided key and the default TTL.

type ExtSpoiler added in v0.9.2

type ExtSpoiler struct{}

ExtSpoiler implements spoilers for goldmark.

func (*ExtSpoiler) Extend added in v0.9.2

func (*ExtSpoiler) Extend(m goldmark.Markdown)

Extend implements the spoiler parser.

type SpoilerNode added in v0.9.2

type SpoilerNode struct {
	ast.BaseInline
}

SpoilerNode is an ast.Node for spoilers.

func (*SpoilerNode) Dump added in v0.9.2

func (n *SpoilerNode) Dump(src []byte, lvl int)

Dump returns information about the node.

func (*SpoilerNode) Kind added in v0.9.2

func (*SpoilerNode) Kind() ast.NodeKind

Kind returns the kind of node it is.

Jump to

Keyboard shortcuts

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