Skip to content

Commit f1da107

Browse files
committed
chore: add badges via .gomarkdoc.yml, fix doc link warnings
- Add .gomarkdoc.yml with header containing CI, Go Report Card, GoDoc, and License badges - Fix gomarkdoc warnings by replacing WorkerContext.Add/Remove/Children doc links with plain text (gomarkdoc can't resolve interface methods)
1 parent b209754 commit f1da107

3 files changed

Lines changed: 38 additions & 4 deletions

File tree

.gomarkdoc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
output: "{{.Dir}}/README.md"
2+
header: |+
3+
# Workers
4+
5+
[![Go](https://github.com/go-coldbrew/workers/actions/workflows/go.yml/badge.svg)](https://github.com/go-coldbrew/workers/actions/workflows/go.yml)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/go-coldbrew/workers)](https://goreportcard.com/report/github.com/go-coldbrew/workers)
7+
[![GoDoc](https://pkg.go.dev/badge/github.com/go-coldbrew/workers.svg)](https://pkg.go.dev/github.com/go-coldbrew/workers)
8+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
9+
10+
**A worker lifecycle library for Go — manage background goroutines with panic recovery, configurable restart, tracing, and structured shutdown.**
11+
12+
Built on [suture](https://github.com/thejerf/suture) for Erlang-style supervisor trees. Part of the [ColdBrew](https://docs.coldbrew.cloud) framework.
13+
14+
---
15+
16+
## API Reference
17+

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
22

3+
# Workers
4+
5+
[![Go](https://github.com/go-coldbrew/workers/actions/workflows/go.yml/badge.svg)](https://github.com/go-coldbrew/workers/actions/workflows/go.yml)
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/go-coldbrew/workers)](https://goreportcard.com/report/github.com/go-coldbrew/workers)
7+
[![GoDoc](https://pkg.go.dev/badge/github.com/go-coldbrew/workers.svg)](https://pkg.go.dev/github.com/go-coldbrew/workers)
8+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
9+
10+
**A worker lifecycle library for Go — manage background goroutines with panic recovery, configurable restart, tracing, and structured shutdown.**
11+
12+
Built on [suture](https://github.com/thejerf/suture) for Erlang-style supervisor trees. Part of the [ColdBrew](https://docs.coldbrew.cloud) framework.
13+
14+
---
15+
16+
## API Reference
17+
18+
19+
320
# workers
421

522
```go
@@ -13,7 +30,7 @@ Package workers provides a worker lifecycle library for Go, built on [thejerf/su
1330
Every worker runs inside its own supervisor subtree. This means:
1431

1532
- Each worker gets panic recovery and restart independently
16-
- Workers can dynamically spawn child workers via WorkerContext.Add
33+
- Workers can dynamically spawn child workers via [WorkerContext](<#WorkerContext>)
1734
- When a parent worker stops, all its children stop \(scoped lifecycle\)
1835
- The supervisor tree prevents cascading failures and CPU\-burn restart storms
1936

@@ -38,7 +55,7 @@ Common patterns are provided as helpers:
3855

3956
### Dynamic Workers
4057

41-
Manager workers can spawn and remove child workers at runtime using WorkerContext.Add, WorkerContext.Remove, and WorkerContext.Children. Children join the parent's supervisor subtree and get full framework guarantees \(tracing, panic recovery, restart\). See \[Example\_dynamicWorkerPool\].
58+
Manager workers can spawn and remove child workers at runtime using the Add, Remove, and Children methods on [WorkerContext](<#WorkerContext>). Children join the parent's supervisor subtree and get full framework guarantees \(tracing, panic recovery, restart\). See \[Example\_dynamicWorkerPool\].
4259

4360
<details><summary>Example (Dynamic Worker Pool)</summary>
4461
<p>

worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// Every worker runs inside its own supervisor subtree. This means:
88
// - Each worker gets panic recovery and restart independently
9-
// - Workers can dynamically spawn child workers via [WorkerContext.Add]
9+
// - Workers can dynamically spawn child workers via [WorkerContext]
1010
// - When a parent worker stops, all its children stop (scoped lifecycle)
1111
// - The supervisor tree prevents cascading failures and CPU-burn restart storms
1212
//
@@ -29,7 +29,7 @@
2929
// # Dynamic Workers
3030
//
3131
// Manager workers can spawn and remove child workers at runtime using
32-
// [WorkerContext.Add], [WorkerContext.Remove], and [WorkerContext.Children].
32+
// the Add, Remove, and Children methods on [WorkerContext].
3333
// Children join the parent's supervisor subtree and get full framework
3434
// guarantees (tracing, panic recovery, restart). See [Example_dynamicWorkerPool].
3535
//

0 commit comments

Comments
 (0)