Documentation
¶
Overview ¶
Package generate implements Soro's deterministic application and component generators.
Index ¶
- Constants
- func NewApplication(options NewOptions) ([]string, error)
- func ReadModule(path string) (string, error)
- func ValidateModule(module string) error
- type EngineGenerator
- type EngineOptions
- type Field
- type FieldType
- type Generator
- func (generator *Generator) GenerateJob(rawName string) ([]string, error)
- func (generator *Generator) GenerateMailer(rawName string) ([]string, error)
- func (generator *Generator) GenerateMigration(rawName string) ([]string, error)
- func (generator *Generator) GenerateModel(rawName string, specifications []string) ([]string, error)
- func (generator *Generator) GenerateResource(rawName string, specifications []string) ([]string, error)
- func (generator *Generator) GenerateSerializer(rawName string, specifications []string) ([]string, error)
- func (generator *Generator) GenerateValidator(rawName string, specifications []string) ([]string, error)
- func (generator *Generator) UseTransformers(transformers ...Transformer) error
- type Name
- type NewOptions
- type Transformer
Constants ¶
View Source
const FrameworkModule = "github.com/ruby-dev/soro"
Variables ¶
This section is empty.
Functions ¶
func NewApplication ¶
func NewApplication(options NewOptions) ([]string, error)
func ReadModule ¶
func ValidateModule ¶
Types ¶
type EngineGenerator ¶
type EngineGenerator struct {
*Generator
Options EngineOptions
}
EngineGenerator writes CRUD building blocks into an external Go library module. It never creates an application, server, configuration, or process lifecycle files.
func OpenEngine ¶
func OpenEngine(root string, force bool, options EngineOptions) (*EngineGenerator, error)
OpenEngine creates a generator for a non-runnable external engine module. PackageRoot defaults to internal; the engine layout itself is fixed.
func (*EngineGenerator) GenerateResource ¶
func (generator *EngineGenerator) GenerateResource(rawName string, specifications []string) ([]string, error)
type EngineOptions ¶
type Field ¶
type Field struct {
Name string
GoName string
Type FieldType
Index bool
Unique bool
Nullable bool
Default string
HasDefault bool
}
func ParseField ¶
func ParseFields ¶
func (Field) CreateGoType ¶
func (Field) SQLDefault ¶
type Generator ¶
type Generator struct {
Root string
Module string
Force bool
Now func() time.Time
Version string
// contains filtered or unexported fields
}
func (*Generator) GenerateJob ¶
func (*Generator) GenerateMailer ¶
func (*Generator) GenerateMigration ¶
func (*Generator) GenerateModel ¶
func (*Generator) GenerateResource ¶
func (*Generator) GenerateSerializer ¶
func (*Generator) GenerateValidator ¶
func (*Generator) UseTransformers ¶
func (generator *Generator) UseTransformers(transformers ...Transformer) error
type NewOptions ¶
Click to show internal directories.
Click to hide internal directories.