Documentation ¶
Index ¶
- Variables
- func CommitAndPushGithubRepo(directory, branch, path, accessToken string, auth *http.BasicAuth) error
- func CopyDir(srcPath string, destPath string) error
- func CreateGithubRepo(organization, name, description, token string, private bool) (*github.Repository, error)
- func FileCopy(src, dst string) (int64, error)
- func FileCreate(content bytes.Buffer, name string, mode os.FileMode) error
- func Generate(c *TemplateConfig) (err error)
- func GetAppPath() string
- func GetGithubRepoAllBranches(ctx context.Context, organization, name, token string) ([]*github.Branch, error)
- func GetInstallPath() string
- func GetLatestVersion() string
- func GetParseFromTemplate(dir, subPath string) (map[string]string, error)
- func GetSubPath(directory string) ([]string, error)
- func GetTmpPath() string
- func GitClone(url, branch, directory string, noCheckout bool, accessToken string) (*git.Repository, error)
- func GitCloneSSH(url, directory, reference, privateKeyFile, password string) error
- func GitRemote(url, directory string) error
- func IsWindows() bool
- func PathCreate(dir string) error
- func PathExist(addr string) bool
- type Generator
- type GithubConfig
- type TemplateConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateIgnore = ".templateignore"
View Source
var TemplateParseIgnore = ".templateparseignore"
Functions ¶
func CommitAndPushGithubRepo ¶
func CommitAndPushGithubRepo(directory, branch, path, accessToken string, auth *http.BasicAuth) error
CommitAndPushGithubRepo commit and push github repo
func CreateGithubRepo ¶
func CreateGithubRepo(organization, name, description, token string, private bool) (*github.Repository, error)
CreateGithubRepo create github repo
func FileCreate ¶
FileCreate create file
func Generate ¶
func Generate(c *TemplateConfig) (err error)
Generate example
func Generate(url, destinationPath string, cfg interface{}, githubConfig *GithubConfig, accessToken string) error { templatePath := filepath.Base(url)
func GetAppPath ¶
func GetAppPath() string
GetAppPath Get the absolute path to the running directory
func GetGithubRepoAllBranches ¶
func GetGithubRepoAllBranches(ctx context.Context, organization, name, token string) ([]*github.Branch, error)
GetGithubRepoAllBranches get all branches of github repo
func GetInstallPath ¶
func GetInstallPath() string
GetInstallPath Different systems get different installation paths
func GetParseFromTemplate ¶
GetParseFromTemplate get parse keys from template
func GetSubPath ¶
GetSubPath get directory's subject path
func GitClone ¶
func GitClone(url, branch, directory string, noCheckout bool, accessToken string) (*git.Repository, error)
GitClone clone git repo
func GitCloneSSH ¶
GitCloneSSH clone git repo from ssh
Types ¶
type Generator ¶
type Generator struct { SubPath string TemplatePath string DestinationPath string Cfg interface{} TemplateIgnoreDirs []string TemplateIgnoreFiles []string TemplateParseIgnoreDirs []string TemplateParseIgnoreFiles []string }
Generator generate operator
type GithubConfig ¶
type TemplateConfig ¶
type TemplateConfig struct { Service string `yaml:"service"` TemplateUrl string `yaml:"templateUrl"` TemplateLocal string `yaml:"templateLocal"` TemplateLocalSubPath string `yaml:"templateLocalSubPath"` CreateRepo bool `yaml:"createRepo"` Destination string `yaml:"destination"` Github *GithubConfig `yaml:"github"` Params interface{} `yaml:"params"` Ignore []string `yaml:"ignore"` }
func (*TemplateConfig) OnChange ¶
func (e *TemplateConfig) OnChange()
Click to show internal directories.
Click to hide internal directories.