github.com/bilus/oya@v0.0.3-0.20190301162104-da4acbd394c6/pkg/types/types.go (about) 1 package types 2 3 import ( 4 "strings" 5 ) 6 7 type Alias string 8 9 func (a Alias) String() string { 10 return string(a) 11 } 12 13 type ImportPath string 14 15 func (p ImportPath) Host() Host { 16 if strings.HasPrefix(string(p), "github.com/") { 17 return HostGithub 18 } 19 return HostUnknown 20 } 21 22 type Host int 23 24 const ( 25 HostUnknown = iota 26 HostGithub 27 )