Documentation
¶
Index ¶
- func CheckIfCoreRemote(remote string) bool
- func CheckIfGithubRemote(remote string) bool
- func GetCachePath() string
- func GetLocalPath() string
- func GetLocalPathByRemote(remote string) string
- func GetSafeRemote(remote string) string
- func IsTemplateAvailableLocally(name string) bool
- func IsTemplateAvailableRemotely(remote string) bool
- func LoadRemoteTemplateIntoMemory(remote string) (*git.Repository, error)
- type Template
- type TemplateManifest
- type TemplateSurvey
- type TemplateSurveyPrompt
- type TemplateSurveyValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfCoreRemote ¶
CheckIfCoreRemote checks if the remote provided is a Lavra repository remote.
func CheckIfGithubRemote ¶
CheckIfGithubRemote checks if the remoote provided is a Github repository remote.
func GetCachePath ¶
func GetCachePath() string
GetCachePath returns the path of the local cache of fetched remote templates.
func GetLocalPathByRemote ¶
GetLocalPathByRemote returns the local path of the remote provided.
func GetSafeRemote ¶
GetSafeRemote returns a string with the full Git URL for Lavra-owned projects as well Github-hosted projects, and finally the given remote string.
func IsTemplateAvailableLocally ¶
IsTemplateAvailableLocally checks whether or not a local template exists by the specific name.
func IsTemplateAvailableRemotely ¶
IsTemplateAvailableRemotely returns a boolean stating whether the the remote template is available.
func LoadRemoteTemplateIntoMemory ¶
func LoadRemoteTemplateIntoMemory(remote string) (*git.Repository, error)
LoadRemoteTemplateIntoMemory loads the remote template into memory for
Types ¶
type Template ¶
type Template struct {
From string
Directory dir.Directory
TemplateDirectory dir.Directory
Manifest TemplateManifest
}
Template holds information related to the template being rendered.
func (Template) EnsureTemplateIsFetched ¶
EnsureTemplateIsFetched fetches the remote template, ensuring that the fetched version is the latest.
type TemplateManifest ¶
type TemplateManifest struct {
Name string `yaml:"name"`
Author string `yaml:"author"`
Description string `yaml:"description"`
Survey []TemplateSurvey `yaml:"survey"`
}
TemplateManifest is an instance of the template configuration file.
type TemplateSurvey ¶
type TemplateSurvey struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Prompt TemplateSurveyPrompt `yaml:"prompt"`
Validate TemplateSurveyValidator `yaml:"validate"`
}
TemplateSurvey holds the template survey input.
type TemplateSurveyPrompt ¶
type TemplateSurveyPrompt struct {
Message string `yaml:"message"`
}
TemplateSurveyPrompt holds options available for various input prompt configs.
type TemplateSurveyValidator ¶
type TemplateSurveyValidator struct {
Required bool `yaml:"required"`
}
TemplateSurveyValidator holds options available for validating survey prompts.