WIP: Some refactoring

This commit is contained in:
Nikolai Rodionov
2023-10-12 13:23:50 +02:00
parent 6a7e541b82
commit c67a9c84e4
7 changed files with 127 additions and 79 deletions

View File

@ -42,6 +42,10 @@ func (r *Repository) ValidateURL() error {
func (r *Repository) KindFromUrl() error {
// It panics if URL is not valid,
// but invalid url should not pass the ValidateURL function
if err := r.ValidateURL(); err != nil {
return err
}
prefix := r.URL[:strings.IndexByte(r.URL, ':')]
switch prefix {
case "oci":