github.com/bilus/oya@v0.0.3-0.20190301162104-da4acbd394c6/pkg/repo/open.go (about) 1 package repo 2 3 import "github.com/bilus/oya/pkg/types" 4 5 // Open opens a library containing all versions of a single Oya pack. 6 func Open(importPath types.ImportPath) (*GithubRepo, error) { 7 if importPath.Host() != types.HostGithub { 8 return nil, ErrNotGithub{ImportPath: importPath} 9 } 10 repoUris, basePath, packPath, err := parseImportPath(importPath) 11 if err != nil { 12 return nil, err 13 } 14 return &GithubRepo{ 15 repoUris: repoUris, 16 packPath: packPath, 17 basePath: basePath, 18 importPath: importPath, 19 }, nil 20 }