Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFile ¶ added in v1.0.4
func ParseFile(source string) (details *FileProtoDetails, mods *URLMods)
ParseFile will see if the input string is a valid file location, where file names have a great deal of flexibility and can even match expect git clone spec syntax; it also provides details if the file:// proto was explicitly specified, if we should use OS copy vs. the git binary, and if a frag/ref has a bad format
Types ¶
type Clone ¶
type Clone struct { Git util.FileSystem }
type FileProtoDetails ¶ added in v1.0.4
type FileProtoDetails struct { // Using the clone spec as a literal file path, does it actually exis FileExists bool // Use OS level file copy commands instead of the git binary UseCopy bool // Did the clone spec have the prefix of file:// ProtoSpecified bool // Was the text for a fragment/ref that follows the last # incorrect BadRef bool }
FileProtoDetails encapsulates certain determinations from examining a given clone spec under the assumption that it is a local file protocol clone spec
type Git ¶
type Git interface { ValidCloneSpec(source string) bool ValidCloneSpecRemoteOnly(source string) bool MungeNoProtocolURL(source string, url *url.URL) error Clone(source, target string, opts api.CloneConfig) error Checkout(repo, ref string) error SubmoduleUpdate(repo string, init, recursive bool) error GetInfo(string) *api.SourceInfo }
Git is an interface used by main STI code to extract/checkout git repositories
type URLMods ¶ added in v1.0.4
type URLMods struct { Scheme string User string Host string Path string // Corresponds to Fragment in the URL struct, but we use Ref since URL Fragments are used and git commit refs Ref string }
URLMods encapsulates potential changes to similarly named fields in the URL struct defined in golang when a protocol is not explicitly specified in a clone spec (which is possible for certain file:// and ssh:// permutations)