MCPcopy Create free account
hub / github.com/bufbuild/buf / parseCompressionType

Function parseCompressionType

private/buf/buffetch/internal/ref_parser.go:379–390  ·  view source on GitHub ↗

empty value is an error

(value string)

Source from the content-addressed store, hash-verified

377
378// empty value is an error
379func parseCompressionType(value string) (CompressionType, error) {
380 switch value {
381 case "none":
382 return CompressionTypeNone, nil
383 case "gzip":
384 return CompressionTypeGzip, nil
385 case "zstd":
386 return CompressionTypeZstd, nil
387 default:
388 return 0, NewCompressionUnknownError(value)
389 }
390}
391
392func parseGitDepth(value string) (uint32, error) {
393 depth, err := strconv.ParseUint(value, 10, 32)

Callers 2

getRawRefMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…