Documentation
¶
Index ¶
- Constants
- func ErrorCode(err error) string
- func ReplaceManagedBlock(body, name, replacement string) (string, error)
- type Context
- type Engine
- type Error
- type Example
- type Issue
- type ManagedBlock
- type Metadata
- type QueryResult
- type RenderResult
- type TemplateActionMetadata
- type TemplateDocument
- type TemplateOutputMetadata
- type TemplateOutputPolicy
- type TemplatePackMetadata
- type TemplateProofGate
- type TemplateQueryDeclaration
- type VariableMetadata
Constants ¶
View Source
const ( EngineGoTemplate = "go-template" EngineSimple = "simple" )
View Source
const SchemaVersionV2 = "pinax.template.v2"
Variables ¶
This section is empty.
Functions ¶
func ReplaceManagedBlock ¶
Types ¶
type Engine ¶
type Engine struct{}
func (*Engine) Render ¶
func (e *Engine) Render(doc TemplateDocument, ctx Context) (RenderResult, error)
type ManagedBlock ¶
type ManagedBlock struct {
Name string `json:"name"`
Start int `json:"start"`
End int `json:"end"`
ContentStart int `json:"-"`
ContentEnd int `json:"-"`
}
func InspectManagedBlocks ¶
func InspectManagedBlocks(body string) ([]ManagedBlock, error)
type Metadata ¶
type Metadata struct {
SchemaVersion string `yaml:"schema_version" json:"schema_version"`
Name string `yaml:"name" json:"name,omitempty"`
Title string `yaml:"title" json:"title,omitempty"`
TemplateKind string `yaml:"template_kind" json:"template_kind,omitempty"`
ScenarioID string `yaml:"scenario_id" json:"scenario_id,omitempty"`
Intents []string `yaml:"intents" json:"intents,omitempty"`
UseCases []string `yaml:"use_cases" json:"use_cases,omitempty"`
Aliases []string `yaml:"aliases" json:"aliases,omitempty"`
Difficulty string `yaml:"difficulty" json:"difficulty,omitempty"`
Starter *bool `yaml:"starter" json:"starter,omitempty"`
Engine string `yaml:"engine" json:"engine,omitempty"`
Kind string `yaml:"kind" json:"kind,omitempty"`
Output TemplateOutputMetadata `yaml:"output" json:"output,omitempty"`
OutputPolicy TemplateOutputPolicy `yaml:"output_policy" json:"output_policy,omitempty"`
Variables map[string]VariableMetadata `yaml:"variables" json:"variables,omitempty"`
VariableSchema map[string]VariableMetadata `yaml:"variable_schema" json:"variable_schema,omitempty"`
Defaults map[string]string `yaml:"defaults" json:"defaults,omitempty"`
Example Example `yaml:"example" json:"example,omitempty"`
Queries map[string]TemplateQueryDeclaration `yaml:"queries" json:"queries,omitempty"`
AfterCreateActions []TemplateActionMetadata `yaml:"after_create_actions" json:"after_create_actions,omitempty"`
Maturity string `yaml:"maturity" json:"maturity,omitempty"`
ProofGate TemplateProofGate `yaml:"proof_gate" json:"proof_gate,omitempty"`
Pack TemplatePackMetadata `yaml:"pack" json:"pack,omitempty"`
Lifecycle string `yaml:"lifecycle" json:"lifecycle,omitempty"`
Replacement string `yaml:"replacement" json:"replacement,omitempty"`
Metrics map[string]string `yaml:"metrics" json:"metrics,omitempty"`
}
type QueryResult ¶
type RenderResult ¶
type TemplateActionMetadata ¶ added in v0.1.3
type TemplateDocument ¶
type TemplateDocument struct {
Name string
Engine string
Body string
Metadata Metadata
Issues []Issue
}
func ParseDocument ¶
func ParseDocument(name, content string) (TemplateDocument, error)
type TemplateOutputMetadata ¶
type TemplateOutputMetadata struct {
PathPattern string `yaml:"path_pattern" json:"path_pattern,omitempty"`
}
type TemplateOutputPolicy ¶ added in v0.1.3
type TemplateOutputPolicy struct {
PathPattern string `yaml:"path_pattern" json:"path_pattern,omitempty"`
AllowOverride bool `yaml:"allow_override" json:"allow_override,omitempty"`
WriteBoundary string `yaml:"write_boundary" json:"write_boundary,omitempty"`
LegacyCompatible bool `yaml:"legacy_compatible" json:"legacy_compatible,omitempty"`
}
type TemplatePackMetadata ¶ added in v0.1.3
type TemplateProofGate ¶ added in v0.1.3
type TemplateProofGate struct {
Status string `yaml:"status" json:"status,omitempty"`
ManualReview bool `yaml:"manual_review" json:"manual_review,omitempty"`
SnapshotRequired bool `yaml:"snapshot_required" json:"snapshot_required,omitempty"`
ReceiptRequired bool `yaml:"receipt_required" json:"receipt_required,omitempty"`
RestoreHint string `yaml:"restore_hint" json:"restore_hint,omitempty"`
}
type TemplateQueryDeclaration ¶
type TemplateQueryDeclaration struct {
Language string `yaml:"language" json:"language,omitempty"`
SQL string `yaml:"sql" json:"sql,omitempty"`
Kind string `yaml:"kind" json:"kind,omitempty"`
MaxRows int `yaml:"max_rows" json:"max_rows,omitempty"`
Required bool `yaml:"required" json:"required,omitempty"`
}
type VariableMetadata ¶
Click to show internal directories.
Click to hide internal directories.