Documentation
¶
Index ¶
- Constants
- func EncodeProjectManifest(manifest ProjectManifest) ([]byte, error)
- func GenerateHexagonalCRUD(projectPath string, database dbschema.Database) error
- func IsHexagonal(projectPath string) bool
- func PlanHexagonalCRUD(projectPath string, database dbschema.Database) ([]string, error)
- type APIGenerator
- type AuthGenerator
- type AuthOptions
- type CommandRunner
- type ExecRunner
- type MethodGenerator
- type MethodOptions
- type MigrationGenerator
- type ProjectGenerator
- type ProjectManifest
- type ProjectOptions
- type SwaggerGenerator
- type UploadGenerator
- type WorkspaceGenerator
- type WorkspaceOptions
Constants ¶
View Source
const ProjectManifestName = "got-project.json"
ProjectManifestName records how a service was generated so later GOT versions, such as "got upgrade", can recognize and evolve it.
Variables ¶
This section is empty.
Functions ¶
func EncodeProjectManifest ¶ added in v1.1.0
func EncodeProjectManifest(manifest ProjectManifest) ([]byte, error)
func GenerateHexagonalCRUD ¶ added in v1.1.0
GenerateHexagonalCRUD writes one entity per table through every hexagonal layer and registers it in the port registries and the HTTP routes.
func IsHexagonal ¶ added in v1.1.0
IsHexagonal reports whether got-project.json declares the hexagonal layout.
Types ¶
type APIGenerator ¶
type APIGenerator struct{}
func (APIGenerator) Generate ¶
func (APIGenerator) Generate(projectPath, apiName string) error
func (APIGenerator) GenerateCRUD ¶
func (APIGenerator) GenerateCRUD(projectPath string, database dbschema.Database) error
type AuthGenerator ¶
type AuthGenerator struct{ Runner CommandRunner }
func (AuthGenerator) Generate ¶
func (g AuthGenerator) Generate(ctx context.Context, projectPath string, options AuthOptions) error
type AuthOptions ¶
type AuthOptions struct{ JWT bool }
type CommandRunner ¶
type ExecRunner ¶
type ExecRunner struct{}
type MethodGenerator ¶
type MethodGenerator struct{}
func (MethodGenerator) Generate ¶
func (MethodGenerator) Generate(projectPath string, options MethodOptions) error
type MethodOptions ¶
type MigrationGenerator ¶ added in v1.1.0
type MigrationGenerator struct{}
MigrationGenerator adds an empty, numbered migration to a hexagonal project.
type ProjectGenerator ¶
type ProjectGenerator struct {
Runner CommandRunner
Output io.Writer
// Version is the GOT version recorded in the generated project manifest.
Version string
}
func (ProjectGenerator) Generate ¶
func (g ProjectGenerator) Generate(ctx context.Context, options ProjectOptions) (returnErr error)
type ProjectManifest ¶ added in v1.1.0
type ProjectManifest struct {
GOTVersion string `json:"gotVersion"`
Module string `json:"module"`
Architecture string `json:"architecture"`
Database string `json:"database"`
}
func ReadProjectManifest ¶ added in v1.1.0
func ReadProjectManifest(projectPath string) (ProjectManifest, error)
type ProjectOptions ¶
type SwaggerGenerator ¶
type SwaggerGenerator struct{}
func (SwaggerGenerator) Generate ¶
func (SwaggerGenerator) Generate(projectPath string) (returnErr error)
type UploadGenerator ¶
type UploadGenerator struct{}
func (UploadGenerator) Generate ¶
func (UploadGenerator) Generate(projectPath string) error
type WorkspaceGenerator ¶
type WorkspaceGenerator struct {
Runner CommandRunner
Output io.Writer
Version string
}
func (WorkspaceGenerator) AddService ¶
func (g WorkspaceGenerator) AddService(ctx context.Context, root, name string) error
func (WorkspaceGenerator) Generate ¶
func (g WorkspaceGenerator) Generate(ctx context.Context, options WorkspaceOptions) (returnErr error)
type WorkspaceOptions ¶
type WorkspaceOptions struct {
Name, Module, Database, ParentPath string
Click to show internal directories.
Click to hide internal directories.