MCPcopy Create free account
hub / github.com/Azure/peerd / Size

Method Size

pkg/cache/filecache.go:124–132  ·  view source on GitHub ↗

Size gets the length of the file.

(name string)

Source from the content-addressed store, hash-verified

122
123// Size gets the length of the file.
124func (c *fileCache) Size(name string) (int64, bool) {
125 key := filepath.Join(name, "metainfo")
126 // c.metadataCache.Wait()
127 val, found := c.metadataCache.Get(key)
128 if !found {
129 return 0, false
130 }
131 return val.(int64), true
132}
133
134// PutSize puts the length of the file.
135func (c *fileCache) PutSize(name string, len int64) bool {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected