Documentation
¶
Overview ¶
Package registry provides template registry management functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶ added in v0.3.1
type Metadata struct {
Templates map[string]TemplateEntry `json:"templates" toml:"templates"`
Updated time.Time `json:"updated" toml:"updated"`
}
Metadata stores registry information
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages local templates
func NewRegistry ¶
NewRegistry creates a new template registry
func (*Registry) List ¶
func (r *Registry) List() ([]TemplateEntry, error)
List returns all templates in the registry
type TemplateConfig ¶
type TemplateConfig struct {
Name string `toml:"name,omitempty"`
Description string `toml:"description,omitempty"`
Version string `toml:"version,omitempty"`
Author string `toml:"author,omitempty"`
Type string `toml:"type,omitempty"`
Variables []TemplateVariable `toml:"variables,omitempty"`
Ignore []string `toml:"ignore,omitempty"`
Tags []string `toml:"tags,omitempty"`
}
TemplateConfig represents the ason.toml configuration
type TemplateEntry ¶
type TemplateEntry struct {
Name string `json:"name" toml:"name"`
Path string `json:"path" toml:"path"`
Description string `json:"description" toml:"description"`
Source string `json:"source" toml:"source"`
Type string `json:"type" toml:"type"`
Size int64 `json:"size" toml:"size"`
Files int `json:"files" toml:"files"`
Added time.Time `json:"added" toml:"added"`
Variables []string `json:"variables,omitempty" toml:"variables,omitempty"`
}
TemplateEntry represents a template in the registry
type TemplateVariable ¶
type TemplateVariable struct {
Name string `toml:"name"`
Description string `toml:"description,omitempty"`
Required bool `toml:"required,omitempty"`
Default interface{} `toml:"default,omitempty"`
Type string `toml:"type,omitempty"`
Options []string `toml:"options,omitempty"`
Example string `toml:"example,omitempty"`
}
TemplateVariable represents a template variable definition
Click to show internal directories.
Click to hide internal directories.