Documentation
¶
Overview ¶
Package decorgen generates decorators: for each named interface, a Decorated<Name> type whose every operation — a method taking a context.Context first and returning an error last — runs through a decorate.Subject (the Exec every tier's Base embeds), named by the method, and whose other methods pass straight through. It is the Go counterpart of Python's runtime decorate(client, base): a component's custom operations get its tier's layers without a hand-written wrapper per method. The cmd/decorgen binary runs it from a go:generate directive.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Source is the package pattern holding the interfaces ("." or an import path),
// resolved from Dir.
Source string
// Dir is the directory patterns resolve from; empty is the working directory.
Dir string
// Package is the generated file's package name.
Package string
// PackagePath is the generated file's import path, so the types it declares are
// written unqualified; empty qualifies every named type.
PackagePath string
// Interfaces names the interfaces to decorate, in output order.
Interfaces []string
}
Config selects the interfaces to decorate and where the generated code lives.
Click to show internal directories.
Click to hide internal directories.