Documentation
¶
Index ¶
- type Client
- func (c *Client) Extract(ctx context.Context, opts ExtractOptions) (*TemplateSchema, error)
- func (c *Client) ExtractAndGenerate(ctx context.Context, ...) error
- func (c *Client) ExtractAndGenerateFromType(templateType, sourceDir, projectName, githubRepo, outputDir string) error
- func (c *Client) ExtractSchema(templateType, sourceDir string) (*TemplateSchema, error)
- func (c *Client) Generate(ctx context.Context, opts GenerateOptions) error
- func (c *Client) GenerateFromFile(ctx context.Context, templateFile string, variables Variables) error
- func (c *Client) GenerateFromSchema(ctx context.Context, schemaName string, variables Variables) error
- func (c *Client) GenerateFromTemplate(ctx context.Context, schema *TemplateSchema, variables Variables) error
- func (c *Client) GetSchemaEnvConfig(schemaName string) ([]EnvVariable, error)
- func (c *Client) GetSchemaInfo(schemaName string) (*TemplateSchemaInfo, error)
- func (c *Client) GetTemplateTypeInfo(templateType string) (*TemplateTypeInfo, error)
- func (c *Client) ListSchemas() []string
- func (c *Client) ListTemplateTypes() []string
- func (c *Client) RegisterSchema(schemaFile string) error
- func (c *Client) RegisterTemplate(templatePath string) error
- func (c *Client) Validate(schema *TemplateSchema) error
- func (c *Client) ValidateExtractOptions(opts ExtractOptions) error
- func (c *Client) ValidateGenerateOptions(opts GenerateOptions) error
- func (c *Client) ValidateVariables(variables Variables) error
- type EnvVariable
- type ErrorType
- type ExtractOptions
- type GenerateOptions
- type SDKError
- type TemplateInfo
- type TemplateSchema
- type TemplateSchemaInfo
- type TemplateTypeInfo
- type Variable
- type Variables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides programmatic access to the template engine
func (*Client) Extract ¶
func (c *Client) Extract(ctx context.Context, opts ExtractOptions) (*TemplateSchema, error)
Extract creates a template schema from a source directory using the global registry
func (*Client) ExtractAndGenerate ¶
func (c *Client) ExtractAndGenerate(ctx context.Context, sourceDir, templateType, projectName, githubRepo, outputDir string, ) error
ExtractAndGenerate extracts a template from a source directory and immediately generates a project This is the main workflow method that combines extraction and generation in one step
func (*Client) ExtractAndGenerateFromType ¶ added in v0.0.6
func (c *Client) ExtractAndGenerateFromType(templateType, sourceDir, projectName, githubRepo, outputDir string) error
ExtractAndGenerateFromType is a convenience method that extracts and generates in one step
func (*Client) ExtractSchema ¶ added in v0.0.6
func (c *Client) ExtractSchema(templateType, sourceDir string) (*TemplateSchema, error)
ExtractSchema extracts a template schema from a source directory using a template type
func (*Client) Generate ¶
func (c *Client) Generate(ctx context.Context, opts GenerateOptions) error
Generate creates a new project from a registered template schema Note: This method works with pre-registered template schemas, not template types. For template types, use ExtractAndGenerate() workflow instead.
func (*Client) GenerateFromFile ¶
func (c *Client) GenerateFromFile(ctx context.Context, templateFile string, variables Variables) error
GenerateFromFile loads a template schema from a file and generates a project This is a convenience method for when you already have a template.json file
func (*Client) GenerateFromSchema ¶ added in v0.0.6
func (c *Client) GenerateFromSchema(ctx context.Context, schemaName string, variables Variables) error
GenerateFromSchema generates a project from a registered template schema
func (*Client) GenerateFromTemplate ¶
func (c *Client) GenerateFromTemplate(ctx context.Context, schema *TemplateSchema, variables Variables) error
GenerateFromTemplate creates a project from a template schema
func (*Client) GetSchemaEnvConfig ¶ added in v0.0.6
func (c *Client) GetSchemaEnvConfig(schemaName string) ([]EnvVariable, error)
GetSchemaEnvConfig returns environment configuration for a registered template schema
func (*Client) GetSchemaInfo ¶ added in v0.0.6
func (c *Client) GetSchemaInfo(schemaName string) (*TemplateSchemaInfo, error)
GetSchemaInfo returns detailed information about a registered template schema
func (*Client) GetTemplateTypeInfo ¶ added in v0.0.6
func (c *Client) GetTemplateTypeInfo(templateType string) (*TemplateTypeInfo, error)
GetTemplateTypeInfo returns metadata for a built-in template type
func (*Client) ListSchemas ¶ added in v0.0.6
ListSchemas returns registered template schema names
func (*Client) ListTemplateTypes ¶ added in v0.0.6
ListTemplateTypes returns available built-in template types for extraction
func (*Client) RegisterSchema ¶ added in v0.0.6
RegisterSchema registers a template schema from a JSON file
func (*Client) RegisterTemplate ¶ added in v0.0.3
RegisterTemplate registers a template schema from a JSON file for use with Generate() This is for working with pre-extracted template schema files, not template types. Template types are automatically registered via the global registry.
func (*Client) Validate ¶
func (c *Client) Validate(schema *TemplateSchema) error
Validate checks if a template schema is valid
func (*Client) ValidateExtractOptions ¶
func (c *Client) ValidateExtractOptions(opts ExtractOptions) error
ValidateExtractOptions validates ExtractOptions
func (*Client) ValidateGenerateOptions ¶
func (c *Client) ValidateGenerateOptions(opts GenerateOptions) error
ValidateGenerateOptions validates GenerateOptions
func (*Client) ValidateVariables ¶
ValidateVariables validates Variables
type EnvVariable ¶ added in v0.0.6
type EnvVariable = core.EnvVariable
Type aliases to avoid repetitive conversions
type ExtractOptions ¶
type ExtractOptions struct {
SourceDir string // Source directory to extract from
Type string // Template type
OutputDir string // Optional: directory to save template file
}
ExtractOptions contains options for extracting a template
type GenerateOptions ¶
type GenerateOptions struct {
Template string // Template name (e.g., "frontend", "go-api")
ProjectName string // Name of the project
GitHubRepo string // GitHub repository (e.g., "user/repo")
OutputDir string // Output directory
Variables map[string]string // Additional template variables
}
GenerateOptions contains options for generating a project
type SDKError ¶
type SDKError struct {
Type ErrorType `json:"type"`
Message string `json:"message"`
Operation string `json:"operation"`
Details string `json:"details,omitempty"`
Underlying error `json:"-"`
}
SDKError provides structured error information for SDK operations
type TemplateInfo ¶ added in v0.0.2
type TemplateInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Variables map[string]Variable `json:"variables"`
}
TemplateInfo represents template metadata and structure
type TemplateSchema ¶ added in v0.0.6
type TemplateSchema = core.TemplateSchema
Type aliases to avoid repetitive conversions
type TemplateSchemaInfo ¶ added in v0.0.6
type TemplateSchemaInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Version string `json:"version"`
Description string `json:"description"`
Variables map[string]Variable `json:"variables"`
FileCount int `json:"file_count"`
EnvVarCount int `json:"env_var_count"`
}
TemplateSchemaInfo represents detailed information about a registered template schema
type TemplateTypeInfo ¶ added in v0.0.6
type TemplateTypeInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Variables map[string]Variable `json:"variables"`
}
TemplateTypeInfo represents metadata for a built-in template type (extractor)