MCPcopy Index your code
hub / github.com/perkeep/perkeep / Read

Method Read

pkg/fs/debug.go:120–133  ·  view source on GitHub ↗
(ctx context.Context, req *fuse.ReadRequest, res *fuse.ReadResponse)

Source from the content-addressed store, hash-verified

118}
119
120func (s *stat) Read(ctx context.Context, req *fuse.ReadRequest, res *fuse.ReadResponse) error {
121 c := s.content()
122 if req.Offset > int64(len(c)) {
123 return nil
124 }
125 c = c[req.Offset:]
126 size := req.Size
127 if size > len(c) {
128 size = len(c)
129 }
130 res.Data = make([]byte, size)
131 copy(res.Data, c)
132 return nil
133}
134
135// A statsDir FUSE directory node is returned by root.go, by opening
136// ".camli_fs_stats" in the root directory.

Callers 5

RandTokenFunction · 0.45
openArmoredPublicKeyFileFunction · 0.45
VerifySignatureMethod · 0.45
awaitQuitKeyFunction · 0.45
unmarshalBinaryMethod · 0.45

Calls 1

contentMethod · 0.95

Tested by

no test coverage detected