Skip to content

Commit b7d9ca3

Browse files
authored
Merge pull request #6
Add project content for darvaza, kagal, and poupe
2 parents 0bb06da + 45a67c4 commit b7d9ca3

25 files changed

Lines changed: 647 additions & 9 deletions

content/projects/darvaza-cache.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: darvaza.org/cache
3+
description: Generic cache abstraction with TTL, stampede control, and pluggable backends.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/cache
8+
licence: MIT
9+
go: darvaza.org/cache
10+
---
11+
12+
Generic cache abstraction keyed by any `comparable` type. The
13+
:go-pkg{mod="darvaza.org/cache" sym="Cache" short} interface
14+
provides `Get`, `Set`, and `Remove` with per-entry expiration. Data
15+
flows through a `Sink` abstraction — `ByteSink` for raw bytes,
16+
`GobSink[T]` for Gob-encoded objects, or a custom `SinkFn[T]` built
17+
from user-supplied encode/decode functions.
18+
A :go-pkg{mod="darvaza.org/cache" sym="Store" short} manages named
19+
cache namespaces with size limits and pluggable data loaders
20+
(`Getter[K]`).
21+
22+
## Backends
23+
24+
| Backend | Module | Description |
25+
|---------|--------|-------------|
26+
| simplelru | :badge-version-go{mod="darvaza.org/cache/x/simplelru"} | Non-thread-safe LRU with TTL; evicts expired entries first |
27+
| memcache | :badge-version-go{mod="darvaza.org/cache/x/memcache"} | Thread-safe in-memory cache with `SingleFlight` stampede prevention |
28+
| groupcache | :badge-version-go{mod="darvaza.org/cache/x/groupcache"} | Distributed caching via :go-pkg{mod="github.com/mailgun/groupcache/v2" label="mailgun/groupcache"} with HTTP peer discovery |
29+
| protosink | :badge-version-go{mod="darvaza.org/cache/x/protosink"} | `TSink[T]` implementation using Protocol Buffers encoding |
30+
31+
## See also
32+
33+
- DNS resolver (uses simplelru) — :go-pkg{mod="darvaza.org/resolver"}
34+
- Structured logging — :go-pkg{mod="darvaza.org/slog"}

content/projects/darvaza-core.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: darvaza.org/core
3+
description: Fundamental helpers for Darvaza projects — type constraints, context utilities, error handling, and more.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/core
8+
licence: MIT
9+
go: darvaza.org/core
10+
---
11+
12+
Fundamental set of helpers used across Darvaza projects. Zero external
13+
dependencies — only Go's standard library is allowed.
14+
15+
Covers type constraints, context utilities, network helpers, generic
16+
slice/map operations, error handling with compound errors, stack
17+
tracing, synchronisation primitives, and testing assertions.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: darvaza.org/resolver
3+
description: Pluggable DNS resolver library with forwarding, iterative, and parallel lookup strategies built on miekg/dns.
4+
category:
5+
- darvaza
6+
- networking
7+
- go
8+
repo: github:darvaza-proxy/resolver
9+
licence: MIT
10+
go: darvaza.org/resolver
11+
---
12+
13+
Pluggable DNS resolver library built on :go-pkg{mod="github.com/miekg/dns" label="miekg/dns"}.
14+
Defines the :go-pkg{mod="darvaza.org/resolver" sym="Resolver" short},
15+
:go-pkg{mod="darvaza.org/resolver" sym="Lookuper" short},
16+
and :go-pkg{mod="darvaza.org/resolver" sym="Exchanger" short}
17+
interfaces that decouple DNS consumers from the transport and
18+
resolution strategy.
19+
20+
Three resolver constructors cover the common cases:
21+
`SystemResolver` wraps :go-pkg{mod="net" sym="Resolver"},
22+
`NewResolver` delegates to any `Lookuper`,
23+
and `NewRootResolver` performs iterative resolution from the
24+
root servers.
25+
26+
## Lookuper implementations
27+
28+
| Lookuper | Description |
29+
|----------|-------------|
30+
| :go-pkg{mod="darvaza.org/resolver" sym="SingleLookuper" short} | Forwards queries to a single :go-pkg{mod="darvaza.org/resolver" dir="pkg/client" sym="Client" short} |
31+
| :go-pkg{mod="darvaza.org/resolver" sym="MultiLookuper" short} | Fans out to multiple lookupers, returns the first response |
32+
| :go-pkg{mod="darvaza.org/resolver" sym="RootLookuper" short} | Iterative resolution from root nameservers |
33+
| :go-pkg{mod="darvaza.org/resolver" sym="SingleFlight" short} | Deduplicates identical concurrent queries |
34+
35+
Well-known recursive resolvers (Google, Cloudflare, Quad9) are
36+
available as one-liner constructors.
37+
38+
## Client middleware
39+
40+
| Middleware | Description |
41+
|------------|-------------|
42+
| :go-pkg{mod="darvaza.org/resolver" dir="pkg/client" sym="Auto" short} | Selects protocol by server prefix (`udp://`, `tcp://`, `tls://`), retries truncated UDP as TCP |
43+
| :go-pkg{mod="darvaza.org/resolver" dir="pkg/client" sym="SingleFlight" short} | Per-server deduplication with short-lived caching |
44+
| :go-pkg{mod="darvaza.org/resolver" dir="pkg/client" sym="WorkerPool" short} | Concurrency limiter for exchange calls |
45+
| :go-pkg{mod="darvaza.org/resolver" dir="pkg/client" sym="NoAAAA" short} | Strips `AAAA` records for IPv4-only environments |
46+
47+
## Additional packages
48+
49+
- The :go-pkg{dir="pkg/server" mod="darvaza.org/resolver"} package
50+
provides a DNS server handler on top of any `Lookuper`
51+
or `Exchanger`.
52+
- The :go-pkg{dir="pkg/reflect" mod="darvaza.org/resolver"} package
53+
provides optional logging middleware
54+
using :go-pkg{mod="darvaza.org/slog"}.
55+
- The :go-pkg{dir="pkg/errors" mod="darvaza.org/resolver"} package
56+
provides standard :go-pkg{mod="net" sym="DNSError"} wrappers
57+
with :go-pkg{mod="github.com/miekg/dns" sym="Msg"} conversion.
58+
59+
## See also
60+
61+
- Network helpers — :go-pkg{mod="darvaza.org/x/net"}
62+
- Structured logging — :go-pkg{mod="darvaza.org/slog"}
63+
- DNS library — :go-pkg{mod="github.com/miekg/dns" label="miekg/dns"}

content/projects/darvaza-slog.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: darvaza.org/slog
3+
description: Backend-agnostic structured logging interface with adapter handlers for popular Go loggers.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/slog
8+
licence: MIT
9+
go: darvaza.org/slog
10+
---
11+
12+
A backend-agnostic interface for structured logging. Libraries import
13+
`slog` to emit structured logs without forcing a specific backend on
14+
their users. Features method chaining (fluent API), six log levels,
15+
context integration, and immutable loggers safe for concurrent use.
16+
17+
## Adapters
18+
19+
Bidirectional adapters convert in both directions — use the external
20+
logger as an `slog` backend, or create an external logger backed by
21+
`slog`.
22+
23+
| Handler | Module | Description |
24+
|---------|--------|-------------|
25+
| logr | :badge-version-go{mod="darvaza.org/slog/handlers/logr"} | Bidirectional adapter for :go-pkg{mod="github.com/go-logr/logr" label="go-logr/logr"} |
26+
| logrus | :badge-version-go{mod="darvaza.org/slog/handlers/logrus"} | Bidirectional adapter for :go-pkg{mod="github.com/sirupsen/logrus" label="sirupsen/Logrus"} |
27+
| zap | :badge-version-go{mod="darvaza.org/slog/handlers/zap"} | Bidirectional adapter for :go-pkg{mod="go.uber.org/zap" label="Uber's zap"} |
28+
| zerolog | :badge-version-go{mod="darvaza.org/slog/handlers/zerolog"} | Wraps :go-pkg{mod="github.com/rs/zerolog" label="rs/zerolog"} as an slog backend |
29+
30+
## Utility handlers
31+
32+
| Handler | Module | Description |
33+
|---------|--------|-------------|
34+
| cblog | :badge-version-go{mod="darvaza.org/slog/handlers/cblog"} | Channel-based handler for custom log processing |
35+
| filter | :badge-version-go{mod="darvaza.org/slog/handlers/filter"} | Middleware to filter and transform log entries |
36+
| discard | :badge-version-go{mod="darvaza.org/slog/handlers/discard"} | No-op handler for optional logging |
37+
| mock | :badge-version-go{mod="darvaza.org/slog" dir="handlers/mock"} | Records log entries for testing assertions |

content/projects/darvaza-x-cmp.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: darvaza.org/x/cmp
3+
description: Generic helpers to compare and match values.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/x/cmp
8+
licence: MIT
9+
go: darvaza.org/x/cmp
10+
---
11+
12+
Generic `CompFunc[T]` (three-way) and `CondFunc[T]` (boolean)
13+
types with conversion functions between the two styles — `AsLess`,
14+
`AsCmp`, `AsEqual`, `Reverse`. Works with any type via custom
15+
comparators, or directly
16+
with `comparable`/:go-pkg{mod="darvaza.org/core" sym="Ordered"}
17+
types.
18+
19+
The composable `Matcher[T]` interface chains predicates with
20+
`And`, `Or`, and `Not`. Factory functions (`MatchEq`, `MatchLt`,
21+
`MatchGtEq`, …) produce matchers from values or comparators, and
22+
`Compose` transforms across types — e.g. match on a struct field
23+
without unwrapping manually.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: darvaza.org/x/config
3+
description: Helpers for handling config structs — decoding, defaults, and validation.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/x/config
8+
licence: MIT
9+
go: darvaza.org/x/config
10+
---
11+
12+
Format-agnostic configuration loader. A generic `Loader[T]`
13+
tries candidate filenames in order, decodes via a user-supplied
14+
`Decoder` (TOML, YAML, JSON — any format works), applies struct-tag
15+
defaults, expands shell-style `${VAR}` variables, and validates
16+
the result with :go-pkg{mod="github.com/go-playground/validator/v10" label="go-playground/validator"}.
17+
18+
Subpackage :go-pkg{mod="darvaza.org/x/config" dir="expand" label="config/expand"}
19+
provides :go-pkg{mod="mvdan.cc/sh/v3" label="mvdan.cc/sh"}-powered
20+
variable substitution from any source.
21+
Subpackage :go-pkg{mod="darvaza.org/x/config" dir="appdir" label="config/appdir"}
22+
handles XDG/FHS-aware directory discovery (`UserConfigDir`,
23+
`SysConfigDir`, `AllConfigDir`).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: darvaza.org/x/container
3+
description: Generic data structure implementations extending Go's standard containers.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/x/container
8+
licence: MIT
9+
go: darvaza.org/x/container
10+
---
11+
12+
Three generic collection types. `container/list` wraps
13+
:go-pkg{mod="container/list" sym="List"} as a type-safe `List[T]`
14+
with match, filter, and move operations. `container/set` provides a hash-bucketed,
15+
thread-safe `Set[K,H,T]` keyed by user-supplied hash and match
16+
functions.
17+
18+
`container/slices` implements sorted-slice-backed sets —
19+
`CustomSet[T]` for any type with a custom comparator, and
20+
`OrderedSet[T]` as a convenience for :go-pkg{mod="darvaza.org/core" sym="Ordered"}
21+
types. All
22+
sets support `Add`, `Remove`, `Contains`, `ForEach`, `Clone`,
23+
and capacity management (`Reserve`, `Grow`, `Trim`).

content/projects/darvaza-x-fs.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: darvaza.org/x/fs
3+
description: Helpers for working with fs.FS — globbing, extended interfaces, and file locking.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/x/fs
8+
licence: MIT
9+
go: darvaza.org/x/fs
10+
---
11+
12+
Shadow of Go's :go-pkg{mod="io/fs"} package that re-exports
13+
standard types and adds write-side interfaces mirroring
14+
:go-pkg{mod="os"}`ChmodFS`, `ChtimesFS`, `MkdirFS`,
15+
`MkdirAllFS`, `MkdirTempFS`, `ReadlinkFS`, `RemoveFS`,
16+
`RemoveAllFS`, `RenameFS`, `SymlinkFS`, and `WriteFileFS`.
17+
18+
File globbing compiles patterns
19+
via :go-pkg{mod="github.com/gobwas/glob" label="gobwas/glob"} with
20+
full `**` support for recursive matching. `Glob` walks
21+
an :go-pkg{mod="io/fs" sym="FS"} and returns all matches;
22+
`GlobCompile` and `Match` separate compilation from traversal
23+
for reuse. `Clean` and `Split` extend the standard path
24+
utilities with validity reporting.
25+
26+
The :go-pkg{mod="darvaza.org/x/fs" dir="fssyscall"} sub-package
27+
provides cross-platform advisory file locking —
28+
`LockEx`, `UnlockEx`, and non-blocking `TryLockEx` — backed
29+
by `flock(2)` on Linux and `LockFileEx` on Windows. Convenience
30+
wrappers (`FLockEx`, `FUnlockEx`, `FTryLockEx`) accept
31+
an `*os.File` directly.
32+
The :go-pkg{mod="darvaza.org/x/fs" dir="flock"} sub-package wraps
33+
these into a single `LockEx(filename)` call.

content/projects/darvaza-x-net.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: darvaza.org/x/net
3+
description: Generic network helpers — port binding with retry, reconnecting TCP clients.
4+
category:
5+
- darvaza
6+
- networking
7+
- go
8+
repo: github:darvaza-proxy/x/net
9+
licence: MIT
10+
go: darvaza.org/x/net
11+
---
12+
13+
Network helpers extending Go's standard :go-pkg{mod="net"} package.
14+
Top-level utilities validate and split host/port pairs, and define
15+
a :go-pkg{mod="darvaza.org/x/net" sym="Dialer" short} interface
16+
compatible with `*net.Dialer`.
17+
18+
The :go-pkg{mod="darvaza.org/x/net" dir="bind"} sub-package
19+
provides advanced port binding — multi-interface and multi-address
20+
listening, automatic port retry with configurable attempts,
21+
`SO_REUSEADDR`/`SO_REUSEPORT` control, and a context-aware
22+
`ListenConfig` that creates TCP listeners and UDP connections
23+
in bulk.
24+
25+
The :go-pkg{mod="darvaza.org/x/net" dir="reconnect"} sub-package
26+
implements a generic reconnecting client for TCP and Unix domain
27+
sockets. Lifecycle callbacks (`OnConnect`, `OnSession`,
28+
`OnDisconnect`, `OnError`) drive application logic, while
29+
configurable backoff and context-based cancellation manage retries.
30+
A generic `StreamSession[Input, Output]` adds message-oriented
31+
I/O with pluggable codecs and stampede-safe send/receive channels.
32+
33+
## See also
34+
35+
- TLS certificate management — :go-pkg{mod="darvaza.org/x/tls"}
36+
- HTTP handler utilities — :go-pkg{mod="darvaza.org/x/web"}
37+
- DNS resolver library — :go-pkg{mod="darvaza.org/resolver"}

content/projects/darvaza-x-sync.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: darvaza.org/x/sync
3+
description: Synchronisation primitive interfaces with panic-safe cleanup.
4+
category:
5+
- darvaza
6+
- go
7+
repo: github:darvaza-proxy/x/sync
8+
licence: MIT
9+
go: darvaza.org/x/sync
10+
---
11+
12+
Defines `Mutex`, `RWMutex`, and their context-aware variants as
13+
interfaces, with panic-safe wrappers (`SafeLock`, `SafeUnlock`, …)
14+
that recover panics
15+
via :go-pkg{mod="darvaza.org/core" func="Catch"} and aggregate
16+
errors. Multi-mutex operations acquire locks in order and
17+
reverse-unlock on failure.
18+
19+
Higher-level primitives: `SpinLock` (atomic CAS), channel-based
20+
`Semaphore` (concurrent readers, exclusive writers), `Barrier` and
21+
`Count` condition variables,
22+
and :go-pkg{mod="darvaza.org/x/sync" dir="workgroup" sym="Group"}
23+
a context-aware goroutine manager with cancellation propagation and
24+
panic recovery.

0 commit comments

Comments
 (0)