MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / NewObject

Method NewObject

mount/mount.go:191–198  ·  view source on GitHub ↗

NewObject returns a new drive object and caches the api object

(object *drive.APIObject)

Source from the content-addressed store, hash-verified

189
190// NewObject returns a new drive object and caches the api object
191func (f *FS) NewObject(object *drive.APIObject) Object {
192 o := Object{f, object.ObjectID}
193 f.lock.Lock()
194 f.objectCache[o.objectID] = object
195 f.lock.Unlock()
196 runtime.SetFinalizer(&o, f.removeCache)
197 return o
198}
199
200// removeCache removes an unreferenced api object from the cache
201func (f *FS) removeCache(o *Object) {

Callers 3

RootMethod · 0.95
LookupMethod · 0.80
MkdirMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected