You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call multiple typed provider functions in order. Returns early on the first nil provider or the first error. All return values are populated on success.
Placeholder functions for code paths that are not yet implemented. The code compiles, but any execution panics (or returns an error) with a descriptive message that includes the expected type.
Function
Behaviour
Todo[T any]() T
Panics with an ErrTodo describing the type
Todoe[T any]() (T, error)
Returns zero value + ErrTodo
funcnewHandler() http.Handler {
returnarm.Todo[http.Handler]()
// panics: accessing not implemented value of type "http.Handler"
}
Uber Fx integration — armfx
import"github.com/mono83/arm/armfx"
Function
Description
ProvideStruct(x any, anno ...fx.Annotation) fx.Option
Builds an fx.Provide constructor for the given struct, injecting each field from the DI container in declaration order
A function type that reads from an io.Reader and produces a hash value. All built-in hash functions satisfy this type, enabling a uniform API across different algorithms and input forms.
Convenience wrappers
Function
Description
Bytes[T](hash Hasher[T], b []byte) (T, error)
Hash a byte slice
String[T](hash Hasher[T], s string) (T, error)
Hash a string
Built-in hashers
Function
Output
Notes
CRC32(r io.Reader) (uint32, error)
uint32
IEEE polynomial; compatible with MySQL, PHP, gzip, zip, PNG
SHA256(r io.Reader) ([]byte, error)
[]byte
Standard SHA-256
Both stream data through the hash without buffering the full input into memory.
Asserts exactly one row: propagates an incoming error, returns sql.ErrNoRows for an empty slice, and a descriptive error when more than one row is present
row, err:=armsql.One(repo.QueryByFilter(ctx, filter))
// err == sql.ErrNoRows → no match// err != nil → too many rows or query failed// row != nil → exactly one result
String utilities — armstr
import"github.com/mono83/arm/armstr"
Function
Description
Len(s string) int
UTF-8 rune count — more correct than len(s), but does not handle multi-codepoint grapheme clusters such as composite emoji
For full grapheme-cluster accuracy use rivo/uniseg.