Documentation
¶
Index ¶
- type AppendFileStep
- type Bundle
- type CommandStep
- type CopyDirAction
- type CopyFileAction
- type CreateFileAction
- type DeleteFileActionStep
- type Deployment
- type Development
- type ModifyPackageJsonStep
- type ModifyTsConfigStep
- type NewAgentSteps
- type NewProjectSteps
- type Requirement
- type Resources
- type Step
- type Template
- type TemplateContext
- type TemplateRules
- type Templates
- type Watch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendFileStep ¶
func (*AppendFileStep) Run ¶
func (s *AppendFileStep) Run(ctx TemplateContext) error
type CommandStep ¶
func (*CommandStep) Run ¶
func (s *CommandStep) Run(ctx TemplateContext) error
type CopyDirAction ¶
func (*CopyDirAction) Run ¶
func (s *CopyDirAction) Run(ctx TemplateContext) error
type CopyFileAction ¶
func (*CopyFileAction) Run ¶
func (s *CopyFileAction) Run(ctx TemplateContext) error
type CreateFileAction ¶
func (*CreateFileAction) Run ¶
func (s *CreateFileAction) Run(ctx TemplateContext) error
type DeleteFileActionStep ¶
type DeleteFileActionStep struct {
Files []string `yaml:"files"`
}
func (*DeleteFileActionStep) Run ¶
func (s *DeleteFileActionStep) Run(ctx TemplateContext) error
type Deployment ¶
type Development ¶ added in v0.0.32
type ModifyPackageJsonStep ¶
type ModifyPackageJsonStep struct {
Script []nameValue
Main string
Type string
Name string
Version string
Description string
Keywords []string
}
func (*ModifyPackageJsonStep) Run ¶
func (s *ModifyPackageJsonStep) Run(ctx TemplateContext) error
type ModifyTsConfigStep ¶
type ModifyTsConfigStep struct {
Types []string
CompilerOptions []nameValue
}
func (*ModifyTsConfigStep) Run ¶
func (s *ModifyTsConfigStep) Run(ctx TemplateContext) error
type NewAgentSteps ¶
type NewAgentSteps struct {
Steps []any `yaml:"steps"`
}
type NewProjectSteps ¶
type NewProjectSteps struct {
Steps []any `yaml:"steps"`
}
type Requirement ¶
type Requirement struct {
Command string `yaml:"command"`
Args []string `yaml:"args"`
Version string `yaml:"version"`
Brew string `yaml:"brew"`
URL string `yaml:"url"`
Selfupdate *struct {
Command string `yaml:"command"`
Args []string `yaml:"args"`
} `yaml:"selfupdate"`
}
func (*Requirement) Matches ¶
func (r *Requirement) Matches(ctx TemplateContext) bool
func (*Requirement) TryInstall ¶
func (r *Requirement) TryInstall(ctx TemplateContext) error
type Step ¶
type Step interface {
Run(ctx TemplateContext) error
}
type Template ¶
type Template struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Identifier string `yaml:"identifier"`
Requirements []Requirement `yaml:"requirements"`
}
func (*Template) Install ¶
func (t *Template) Install(ctx TemplateContext) error
Install installs the requirements for the template
func (*Template) Matches ¶
func (t *Template) Matches(ctx TemplateContext) bool
Matches returns true if the template matches the requirements
func (*Template) NewProject ¶
func (t *Template) NewProject(ctx TemplateContext) (*TemplateRules, error)
type TemplateContext ¶
type TemplateContext struct {
Context context.Context
Logger logger.Logger
Name string
Description string
AgentName string
AgentDescription string
ProjectDir string
Template *Template
}
func (*TemplateContext) Interpolate ¶
func (t *TemplateContext) Interpolate(val any) any
type TemplateRules ¶
type TemplateRules struct {
Identifier string `yaml:"identifier"`
Runtime string `yaml:"runtime"`
Language string `yaml:"language"`
Framework string `yaml:"framework"`
SrcDir string `yaml:"src_dir"`
Filename string `yaml:"filename"`
Bundle Bundle `yaml:"bundle"`
Development Development `yaml:"development"`
Deployment Deployment `yaml:"deployment"`
NewProjectSteps NewProjectSteps `yaml:"new_project"`
NewAgentSteps NewAgentSteps `yaml:"new_agent"`
}
func LoadTemplateRuleForIdentifier ¶
func LoadTemplateRuleForIdentifier(identifier string) (*TemplateRules, error)
func (*TemplateRules) NewAgent ¶
func (t *TemplateRules) NewAgent(ctx TemplateContext) error
func (*TemplateRules) NewProject ¶
func (t *TemplateRules) NewProject(ctx TemplateContext) error
type Templates ¶
type Templates []Template
func LoadTemplates ¶
LoadTemplates returns all the templates available
Click to show internal directories.
Click to hide internal directories.