Documentation
¶
Overview ¶
Package scaffold writes the files for a new module, app or service.
Generated code here is a starting point that already does the things people forget: the repository is tenant-scoped, the list endpoint is paginated with an allow-listed sort, the create route carries a guard, the update DTO uses pointers so a PATCH can set a field to false, and the service returns typed errors rather than strings. Deleting a line you do not need is cheaper than remembering a line you did.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct {
// GoModule is the importing module path, e.g. "github.com/acme/billing".
GoModule string
// AppsDir is where domains live, e.g. "apps".
AppsDir string
// App is the domain, e.g. "catalog".
App string
// Module is the resource, e.g. "products".
Module string
// Package is Module as a Go identifier, e.g. "products".
Package string
// Entity is the singular Go type, e.g. "Product".
Entity string
// Receiver is a short receiver name, e.g. "s".
Receiver string
// Service is the service name for a scaffolded service.
Service string
// contains filtered or unexported fields
}
Data drives the templates.
func (Data) ImportBase ¶
ImportBase is the import path of the module directory.
func (Data) ModuleFile ¶
ModuleFile is the module declaration file name.
Click to show internal directories.
Click to hide internal directories.