2020-11-17 05:41:34 +00:00
|
|
|
package registry
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// Source is a quick way to specify a git source
|
|
|
|
// e.g. Gitea, GitHub, etc.
|
|
|
|
type Source struct {
|
2022-06-14 19:59:53 +00:00
|
|
|
Name string `yaml:"name"`
|
|
|
|
URL string `yaml:"url"`
|
2020-11-17 05:41:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// CloneURL constructs a URL suitable for cloning a repository
|
|
|
|
func (s *Source) CloneURL(namespace string) string {
|
2020-11-19 05:08:49 +00:00
|
|
|
return fmt.Sprintf("%s%s.git", s.URL, namespace)
|
2020-11-17 05:41:34 +00:00
|
|
|
}
|