Documentation ¶
Index ¶
- func IsErrSourceNotFound(err error) bool
- func IsErrTemplateExists(err error) bool
- type ErrSourceNotFound
- type ErrTemplateExists
- type ErrTemplateNotFound
- type Registry
- func (r *Registry) AddSource(url, name string) (*Source, error)
- func (r *Registry) DownloadTemplate(name, repo, branch string) (*Template, error)
- func (r *Registry) GetSource(name string) (*Source, error)
- func (r *Registry) GetTemplate(name string) (*Template, error)
- func (r *Registry) MetaFilePath() string
- func (r *Registry) RemoveSource(name string) error
- func (r *Registry) RemoveTemplate(name string) error
- func (r *Registry) SaveTemplate(name, path string) (*Template, error)
- func (r *Registry) UpdateTemplate(name string) error
- type Source
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrSourceNotFound ¶
type ErrSourceNotFound struct {
Name string
}
func (ErrSourceNotFound) Error ¶
func (e ErrSourceNotFound) Error() string
type ErrTemplateExists ¶ added in v0.0.8
type ErrTemplateExists struct {
Name string
}
func (ErrTemplateExists) Error ¶ added in v0.0.8
func (e ErrTemplateExists) Error() string
type ErrTemplateNotFound ¶
type ErrTemplateNotFound struct {
Name string
}
func (ErrTemplateNotFound) Error ¶
func (e ErrTemplateNotFound) Error() string
type Registry ¶
type Registry struct { Sources []*Source `yaml:"sources"` Templates []*Template `yaml:"templates"` // contains filtered or unexported fields }
Registry is a collection of Template
func Open ¶
Open opens a Registry, creating one if none exists at dir
func (*Registry) AddSource ¶
AddSource adds a new Source to the Registry
func (*Registry) DownloadTemplate ¶ added in v0.0.2
DownloadTemplate downloads and adds a new Template to the Registry
func (*Registry) GetSource ¶
GetSource retrieves a Source from the Registry
func (*Registry) GetTemplate ¶
GetTemplate retrieves a Template from the Registry
func (*Registry) MetaFilePath ¶
MetaFilePath is the path to the Registry meta-file
func (*Registry) RemoveSource ¶
RemoveSource removes the Source from the registry meta
func (*Registry) RemoveTemplate ¶
RemoveTemplate removes the Template from disk and meta
func (*Registry) SaveTemplate ¶ added in v0.0.2
SaveTemplate saves a local Template to the Registry
type Source ¶
Source is a quick way to specify a git source e.g. Gitea, GitHub, etc.
type Template ¶
type Template struct { Name string `yaml:"name"` Path string `yaml:"path"` Repository string `yaml:"repository"` Branch string `yaml:"branch"` LastUpdate time.Time `yaml:"last_update"` // contains filtered or unexported fields }
Template is a tmpl project
func (*Template) ArchiveName ¶
ArchiveName is the name given to the archive for this Template
func (*Template) ArchivePath ¶
ArchivePath is the full path to the archive for this Template within the Registry