Documentation ¶
Index ¶
- func DownloadGithubRepo(userID int, branch, url string) (string, string, string, error)
- func GenerateRandomString(size int) string
- func GetLastCommitHash(url, branch string)
- func GetUserAndNameFromRepoUrl(url string) (string, string, error)
- func HasLastCommitChanged(commit, url, branch string) (bool, error)
- func ValidGithubUrl(url string) error
- type GithubCommit
- type GithubCommitInternal
- type Util
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadGithubRepo ¶
DownloadGithubRepo clones the repository from GitHub given the url and save it in the tmp folder, if the download successfully complete the name of the path, name and last commit hash will be returned
func GenerateRandomString ¶
GenerateRandomString will generate a random alphanumerical string of the given length
func GetLastCommitHash ¶
func GetLastCommitHash(url, branch string)
func GetUserAndNameFromRepoUrl ¶
GetUserAndNameFromRepoUrl get the username of the creator and the repository's name given a GitHub repository url
func HasLastCommitChanged ¶
HasLastCommitChanged will check if the last commit of a GitHub url is different from the given to the function TODO: should read just the last one not all the commits in the json
func ValidGithubUrl ¶
ValidGithubUrl check if an url is a valid and existing GitHub repo url !should allow other git remotes (I.E. gitlab)
Types ¶
type GithubCommit ¶
type GithubCommit struct { SHA string `json:"sha"` Commit GithubCommitInternal `json:"commit"` }
type GithubCommitInternal ¶
type GithubCommitInternal struct {
Message string `json:"message"`
}