Documentation
¶
Index ¶
- func CloneGitRepo(ctx context.Context, link, dir string) (*git.Repository, error)
- func GetGitRepoVersions(r *git.Repository) ([]*version.Version, error)
- func GetGitSource(link string) (string, error)
- func GetRepoRef(r *git.Repository, name string) (*plumbing.Reference, error)
- func HardResetGitRepo(r *git.Repository, ref string) error
- func NewClient(conn *model.Connector) (*scm.Client, error)
- func NewClientFromURL(driver, url, token string) (*scm.Client, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneGitRepo ¶
CloneGitRepo clones a git repository to a specific directory.
func GetGitRepoVersions ¶
func GetGitRepoVersions(r *git.Repository) ([]*version.Version, error)
GetGitRepoVersions returns all versions of a git repository in descending order.
func GetGitSource ¶
GetGitSource get git source for template. When source's protocol is http or https, the prefix git:: will be added for template to use.
func GetRepoRef ¶
GetRepoRef returns a reference from a git repository.
func HardResetGitRepo ¶
func HardResetGitRepo(r *git.Repository, ref string) error
HardResetGitRepo hard resets a git repository to a specific hash.
Types ¶
type Repository ¶
type Repository struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
Description string `json:"description"`
Link string `json:"link"`
Reference string `json:"reference"`
}
func ParseURLToRepo ¶
func ParseURLToRepo(rawURL string) (*Repository, error)
ParseURLToGit parses a raw URL to a git repository. Since the return repository only contains the namespace and name, It only used for create template from catalog.
Click to show internal directories.
Click to hide internal directories.