MCPcopy Create free account
hub / github.com/dagger/dagger / parseScheme

Function parseScheme

core/modulerefs.go:239–254  ·  view source on GitHub ↗
(refString string)

Source from the content-addressed store, hash-verified

237}
238
239func parseScheme(refString string) (SchemeType, string) {
240 schemes := []SchemeType{
241 SchemeHTTP,
242 SchemeHTTPS,
243 SchemeSSH,
244 }
245
246 for _, scheme := range schemes {
247 prefix := scheme.Prefix()
248 if strings.HasPrefix(refString, prefix) {
249 return scheme, strings.TrimPrefix(refString, prefix)
250 }
251 }
252
253 return NoScheme, refString
254}
255
256func (p *ParsedGitRefString) GitRef(
257 ctx context.Context,

Callers 1

ParseGitRefStringFunction · 0.85

Calls 1

PrefixMethod · 0.80

Tested by

no test coverage detected