Home

tmpl @dc19c1b9938cc12fa1bec5fef4b1a1b30b8b2561 - refs - log -
-
https://git.jolheiser.com/tmpl.git
Template automation
tmpl / registry / source.go
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
package registry

import "fmt"

// Source is a quick way to specify a git source
// e.g. Gitea, GitHub, etc.
type Source struct {
	Name string `toml:"name"`
	URL  string `toml:"url"`
}

// CloneURL constructs a URL suitable for cloning a repository
func (s *Source) CloneURL(namespace string) string {
	return fmt.Sprintf("%s%s", s.URL, namespace)
}