MCPcopy
hub / github.com/perkeep/perkeep / HasPrefix

Method HasPrefix

pkg/blob/ref.go:107–107  ·  view source on GitHub ↗

HasPrefix reports whether s is a prefix of r.String(). It returns false if s does not contain at least the digest name prefix (e.g. "sha224-") and one byte of digest. It does not allocate.

(s string)

Source from the content-addressed store, hash-verified

105// digest.
106// It does not allocate.
107func (r Ref) HasPrefix(s string) bool { return r.digest.hasPrefix(s) }
108
109func (r Ref) appendString(buf []byte) []byte {
110 dname := r.digest.digestName()

Callers 15

verifyGoVersionFunction · 0.80
isURLOrHostPortFunction · 0.80
cleanServerFunction · 0.80
useTLSMethod · 0.80
newIgnoreCheckerFunction · 0.80
hasDirPrefixFunction · 0.80
discoRootMethod · 0.80
GetJSONMethod · 0.80
postMethod · 0.80
IsTextMethod · 0.80
IsImageMethod · 0.80
IsVideoMethod · 0.80

Calls 1

hasPrefixMethod · 0.65

Tested by 15

TestHasPrefixFunction · 0.64
BenchmarkHasPrefixFunction · 0.64
TestIntegrationRunFunction · 0.64
TestImportAlbumsFunction · 0.64
TestQueryBlobRefPrefixFunction · 0.64
TestAzureStorageFunction · 0.64
testStorageFunction · 0.64
TestStorage_ManualFunction · 0.64
TestPackLargeFunction · 0.64
TestReindexFunction · 0.64
TestRemoveBlobsFunction · 0.64
TestWebsocketQueryFunction · 0.64