mostly

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 0 Imported by: 0

README

mostly

stackerr

Use stackerr.Errorf("%w", err) everywhere, and then log.Printf("%+v", err) for helpful error stack trace.

When using slog package, the trace is simplified to a single-line.

err := stackerr.Errorf("%w", io.EOF)
slog.Error("reading file", "err", err)

superchan

Cancellable Channel Context superchan

 import "github.com/aerth/mostly/superchan"
 var mainctx = superchan.NewMain(newmainctx, syscall.SIGINT, syscall.SIGHUP, syscall.SIGTERM).(*superchan.Superchan[os.Signal])
 var _ context.CancelCauseFunc = mainctx.Cancel

ncode

encoding, twist arrays ([]string -> []MyString -> []string)

	// example, turn strings to *url.URL
	var urls []*url.URL
	var err error
	urls, err = ncode.TwistParsePtr([]string{"https://google.com", "https://myspace.com"}, url.Parse)

	var envs []string
	envs, err = ncode.TwistParse([]string{"XDG_CONFIG_HOME", "HOME"}, os.Getenv)
	

mllm

tiny ai client for llm and embeddings

 import "github.com/aerth/mostlymllm"
_, err := mllm.Default().Generate(ctx, "", "Write a short story about dragons.", false)

httpserver

a cancellable, signal handling, httpserver+context combo for all kinds of web server programs

flagpkg

InverseBoolVar (eg: --no-foo to set foo to false)

	import "github.com/aerth/mostly/flagpkg"
	// example:
	cfg.ComplatePage = true
	flagpkg.InverseBoolVar(&cfg.CompletePage, "no-complete", cfg.CompletePage, "dont make whole html page")

filters

for FilterCopy and FilterInPlace

unixtimestamp

json marshaller for using unix timestamp instead of json string

Documentation

Overview

Package mostly might be renamed

Directories

Path Synopsis
Package cancellable combines Context, CancelCauseFunc with Wait
Package cancellable combines Context, CancelCauseFunc with Wait
cmd
explainfile command
joker command
flagpkg package provides some additional flag functions.
flagpkg package provides some additional flag functions.
Package godotenv is a go port of the ruby dotenv library (https://github.com/bkeepers/dotenv)
Package godotenv is a go port of the ruby dotenv library (https://github.com/bkeepers/dotenv)
httpctx
httpctx package provides context keys for http server handlers.
httpctx package provides context keys for http server handlers.
Package mllm is simple llm client, part of aerth/mostly project
Package mllm is simple llm client, part of aerth/mostly project
Package ncode for twist
Package ncode for twist
constraints
Package constraints defines a set of useful constraints to be used with type parameters.
Package constraints defines a set of useful constraints to be used with type parameters.
unixtimestamp package provides a time.Time wrapper that marshals to/from Unix timestamp (integer, seconds)
unixtimestamp package provides a time.Time wrapper that marshals to/from Unix timestamp (integer, seconds)
Package vector256 represents a 256-dimensional float32 vector for pgvector part of aerth/mostly project
Package vector256 represents a 256-dimensional float32 vector for pgvector part of aerth/mostly project

Jump to

Keyboard shortcuts

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