affirmations

package
v0.0.0-...-0c3cbb8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package affirmations serves a random affirmation from the embedded dataset. Backed by datasets/affirmations.jsonl — each line is a {prompt, completion} object; only the completion text is exposed (the prompt encodes category metadata not needed for random pick).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(fsys fs.FS) error

Load reads datasets/affirmations.jsonl from fsys into memory. Call once at startup. After Load returns nil, Random is safe for concurrent use.

func Random

func Random() string

Random returns a uniformly random affirmation. Returns "" if Load has not been called or the dataset is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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