Documentation
¶
Overview ¶
Package buddie serves a random image of the dog BuddieBot was named after, embedded in the binary alongside the text datasets. Call Load once at startup with the embed.FS from the parent package, then call Random freely from anywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count() int
Count returns the number of loaded images. 0 means Load wasn't called or the dataset directory was empty.
func Load ¶
Load reads every file under datasets/buddie/ into memory. Call once at startup. After Load returns nil, Random is safe for concurrent use. Eager-loads to match the rest of bb_data's "load once, lock-free reads" pattern; the embedded folder is small (~2 MiB), so the memory cost is trivial vs the per-call simplicity it buys.