primordium

module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0

README

Primordium

A Go library containing a handful of primitives shared in all our projects.

Initial core building blocks in tissue

Primordium

Purpose

Primordium provides generic primivites for all Mycophonic audio Go project, addressing several classic footguns, platform dependent code, deep optimization paths, safer storage abstractions, etc.

Right now:

  • filesystem layer that provides locking, atomic writes, buffered readers and writers, OS specific limitations handling
  • networking secure defaults for ssh and http
  • roundtripper with backoff / retry
  • standardized errors
  • output formatting helpers
  • digest computation
  • r2 helpers
  • sentry integration
  • mmap primitives
  • process management and machine information helpers
  • logger configuration helpers and other "app" oriented helpers
  • SIMD assembly
  • generic digest helper
  • compression wrapper
  • base sqlite struct with tailored pragmas
  • store primitives (ref-counting, content-addressable, mmap index, volatile store)

Directories

Path Synopsis
app
Package app provides application lifecycle helpers (initialization for filesystem, network, logger) and shutdown.
Package app provides application lifecycle helpers (initialization for filesystem, network, logger) and shutdown.
logger
Package logger installs the process-wide stdlib slog handler with sensible defaults: lmittmann/tint for colored console output on a terminal, and slog's JSON handler when stderr is redirected.
Package logger installs the process-wide stdlib slog handler with sensible defaults: lmittmann/tint for colored console output on a terminal, and slog's JSON handler when stderr is redirected.
reporter
Package reporter provides a wrapper abstracting Sentry.
Package reporter provides a wrapper abstracting Sentry.
shutdown
Package shutdown manages graceful process exit with registered cleanup handlers.
Package shutdown manages graceful process exit with registered cleanup handlers.
Package compress provides streaming zstd compression and registry-based decompression.
Package compress provides streaming zstd compression and registry-based decompression.
bzip2
Package bzip2 registers bzip2 decompression with the compress registry.
Package bzip2 registers bzip2 decompression with the compress registry.
gzip
Package gzip registers gzip decompression with the compress registry.
Package gzip registers gzip decompression with the compress registry.
lz4
Package lz4 registers LZ4 decompression with the compress registry.
Package lz4 registers LZ4 decompression with the compress registry.
xz
Package xz registers XZ decompression with the compress registry.
Package xz registers XZ decompression with the compress registry.
db
sqlite
Package sqlite provides shared SQLite database wrapper along with the default pure go driver.
Package sqlite provides shared SQLite database wrapper along with the default pure go driver.
Package digest provides core types for digest handling and content-addressable storage.
Package digest provides core types for digest handling and content-addressable storage.
Package fault provides a set of errors consistently used across all mycophonic projects.
Package fault provides a set of errors consistently used across all mycophonic projects.
Package filesystem provides low level primitives to ease FS manipulation.
Package filesystem provides low level primitives to ease FS manipulation.
dirs
Package dirs provides cross-platforms helpers to retrieve commonly used app locations.
Package dirs provides cross-platforms helpers to retrieve commonly used app locations.
flock
Package flock provides a platform-independent API for advisory file locking.
Package flock provides a platform-independent API for advisory file locking.
iox
Package iox provides buffered I/O wrappers that reduce syscall overhead for I/O-intensive workloads such as audio decoders and encoders.
Package iox provides buffered I/O wrappers that reduce syscall overhead for I/O-intensive workloads such as audio decoders and encoders.
pathcheck
Package pathcheck provides utilities to enforce platform specific path validation.
Package pathcheck provides utilities to enforce platform specific path validation.
umask
Package umask provides cross-platform umask management that gives the application explicit control over file permissions.
Package umask provides cross-platform umask management that gives the application explicit control over file permissions.
xos
Package xos provides the same filesystem features as golang os package, with a key difference on windows (FILE_SHARE_DELETE).
Package xos provides the same filesystem features as golang os package, with a key difference on windows (FILE_SHARE_DELETE).
Package format provides output formatters for mycophonic clis.
Package format provides output formatters for mycophonic clis.
Package mmap provides primitives to map / unmap and sync a file.
Package mmap provides primitives to map / unmap and sync a file.
Package network currently provides sane defaults http and ssh transport config to be used across all network operations.
Package network currently provides sane defaults http and ssh transport config to be used across all network operations.
transporter
Package transporter provides a retry-backoff transport client.
Package transporter provides a retry-backoff transport client.
Package r2 provides resumable upload and download access to Cloudflare R2.
Package r2 provides resumable upload and download access to Cloudflare R2.
Package simd provides SIMD-accelerated operations for float32 slices.
Package simd provides SIMD-accelerated operations for float32 slices.
Package store provides cache and volatile storage facilities.
Package store provides cache and volatile storage facilities.
cache
Package cache provides a content addressable storage system that is safe to use concurrently.
Package cache provides a content addressable storage system that is safe to use concurrently.
content
Package content provides identifier-based lookup over a content-addressed cache backed by an mmap'd flat-file index.
Package content provides identifier-based lookup over a content-addressed cache backed by an mmap'd flat-file index.
index
Package index implements a concurrent-safe flat-file hash index using memory-mapped I/O with shared-memory locking.
Package index implements a concurrent-safe flat-file hash index using memory-mapped I/O with shared-memory locking.
refcount
Package refcount provides primitives for a refcounted mechanism for shared folders that is safe to use across process.
Package refcount provides primitives for a refcounted mechanism for shared folders that is safe to use across process.
volatile
Package volatile provides a volatile filesystem store where stored data is automatically cleaned-up once all consumers are done with it.
Package volatile provides a volatile filesystem store where stored data is automatically cleaned-up once all consumers are done with it.
system
machine
Package machine provides base system stats to classify machine fitness.
Package machine provides base system stats to classify machine fitness.
process
Package process provides base system utilities related to process management.
Package process provides base system utilities related to process management.
rlimit
Package rlimit raises the RLIMIT_NOFILE soft limit and ensures exec'd subprocesses inherit the raised value.
Package rlimit raises the RLIMIT_NOFILE soft limit and ensures exec'd subprocesses inherit the raised value.
Package term provides thin, cross-platform helpers for interacting with terminals.
Package term provides thin, cross-platform helpers for interacting with terminals.

Jump to

Keyboard shortcuts

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