Documentation ¶
Index ¶
- func CheckRulesJson(file string, bytes []byte) error
- func CompareContentWithFile(sourceBytes []byte, target string) (bool, error)
- func New(o GeneratorOptions) (*generator, error)
- func ReadRulesDoc(filename string) (*spec.RulesDoc, error)
- type FileOutput
- type GeneratorOptions
- type GeneratorStats
- type MockOutput
- type OutputWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRulesJson ¶ added in v0.8.0
func CompareContentWithFile ¶
func New ¶
func New(o GeneratorOptions) (*generator, error)
Types ¶
type FileOutput ¶ added in v0.20.0
type FileOutput struct { }
func (*FileOutput) Compare ¶ added in v0.20.0
func (f *FileOutput) Compare(input []byte, target string) (bool, error)
type GeneratorOptions ¶ added in v0.20.0
type GeneratorOptions struct { // OutputDir is the directory where files are written OutputDir string // TemplatesDir is the directory where templates are located TemplatesDir string // System is the root system model System *model.System // UserFeatures is a list of features defined by user UserFeatures []string // UserForce forces overwrite of existing files UserForce bool // Output is the output writer Output OutputWriter // DryRun does not write files DryRun bool // Meta is a map of metadata Meta map[string]any }
type GeneratorStats ¶ added in v0.8.0
type GeneratorStats struct { FilesWritten int `json:"files_written"` FilesSkipped int `json:"files_skipped"` FilesCopied int `json:"files_copied"` FilesTouched []string `json:"files_touched"` RunStart time.Time `json:"run_start"` RunEnd time.Time `json:"run_end"` Duration time.Duration `json:"duration"` }
func (*GeneratorStats) Start ¶ added in v0.8.0
func (g *GeneratorStats) Start()
func (*GeneratorStats) Stop ¶ added in v0.8.0
func (g *GeneratorStats) Stop()
func (*GeneratorStats) TotalFiles ¶ added in v0.8.0
func (s *GeneratorStats) TotalFiles() int
type MockOutput ¶ added in v0.20.0
type MockOutput struct { Writes map[string]string Copies map[string]string Compares map[string]bool }
func NewMockOutput ¶ added in v0.20.0
func NewMockOutput() *MockOutput
func (*MockOutput) Compare ¶ added in v0.20.0
func (m *MockOutput) Compare(input []byte, target string) (bool, error)
Click to show internal directories.
Click to hide internal directories.