Documentation ¶
Index ¶
- func IsErrSourceNotFound(err error) bool
- func IsErrTemplateNotFound(err error) bool
- type ErrSourceNotFound
- 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)
- 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 ErrTemplateNotFound ¶
type ErrTemplateNotFound struct {
Name string
}
func (ErrTemplateNotFound) Error ¶
func (e ErrTemplateNotFound) Error() string
type Registry ¶
type Registry struct { Sources []*Source `toml:"sources"` Templates []*Template `toml:"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
type Source ¶
Source is a quick way to specify a git source e.g. Gitea, GitHub, etc.
type Template ¶
type Template struct { Name string `toml:"name"` Path string `toml:"path"` Repository string `toml:"repository"` Branch string `toml:"branch"` Created time.Time `toml:"created"` // 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