Documentation
¶
Overview ¶
Package services provides the shared service base and a generic operation decorator/builder for CLI (operation) services. It is the operation-oriented counterpart to go/services/service (entity CRUD): Base carries the dependencies every CLI service shares, and Build assembles a decorated interfaces.OpService[A,R] from a single run function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base carries the dependencies common to every CLI service: a name (used as a label in logs, metrics, and decorator actions) and a structured logger that operations use to report progress. Idiosyncratic services embed *Base and read these via the accessors instead of threading them through every call.
type Builder ¶
Builder assembles a decorated interfaces.OpService[A,R] from a single RunFunc. Decorators are applied inside-out: base run -> logging -> recovery (recovery is ALWAYS outermost).
func Build ¶
Build starts a fluent builder that assembles a decorated OpService from the given operation function. Dependency injection happens before Build, by closing run over the service's repos; the builder only adds cross-cutting concerns (logging, recovery).
func (*Builder[A, R]) Service ¶
func (b *Builder[A, R]) Service() interfaces.OpService[A, R]
Service constructs the decorated OpService. Decorators are applied inside-out: base run -> logging -> recovery (recovery is ALWAYS outermost, so it catches panics from every inner decorator and from the operation itself).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package outbox is the transactional-outbox relay: it leases due rows from an interfaces.OutboxStore, delivers them through an interfaces.OutboxSink in bounded-concurrency chunks, and finalizes each row by its own outcome — sent, retried with capped exponential backoff and full jitter, or parked once its attempts are exhausted.
|
Package outbox is the transactional-outbox relay: it leases due rows from an interfaces.OutboxStore, delivers them through an interfaces.OutboxSink in bounded-concurrency chunks, and finalizes each row by its own outcome — sent, retried with capped exponential backoff and full jitter, or parked once its attempts are exhausted. |
|
Package service provides BaseService with decorator support for building domain service layers with cross-cutting concerns.
|
Package service provides BaseService with decorator support for building domain service layers with cross-cutting concerns. |
|
decorators
Package decorators provides fluent decorator composition for services.
|
Package decorators provides fluent decorator composition for services. |