MCPcopy Index your code
hub / github.com/foxcpp/maddy / Buffer

Interface Buffer

framework/buffer/buffer.go:40–60  ·  view source on GitHub ↗

Buffer interface represents abstract temporary storage for blobs. The Buffer storage is assumed to be immutable. If any modifications are made - new storage location should be used for them. This is important to ensure goroutine-safety. Since Buffer objects require a careful management of lifetime

Source from the content-addressed store, hash-verified

38// and storing it somewhere or applying implementation-specific methods (for example,
39// the FileBuffer storage may be "re-buffered" by hard-linking the underlying file).
40type Buffer interface {
41 // Open creates new Reader reading from the underlying storage.
42 Open() (io.ReadCloser, error)
43
44 // Len reports the length of the stored blob.
45 //
46 // Notably, it indicates the amount of bytes that can be read from the
47 // newly created Reader without hiting io.EOF.
48 Len() int
49
50 // Remove discards buffered body and releases all associated resources.
51 //
52 // Multiple Buffer objects may refer to the same underlying storage.
53 // In this case, care should be taken to ensure that Remove is called
54 // only once since it will discard the shared storage and invalidate
55 // all Buffer objects using it.
56 //
57 // Readers previously created using Open can still be used, but
58 // new ones can't be created.
59 Remove() error
60}

Callers 22

ReadConfigFunction · 0.65
resolveImportMethod · 0.65
OpenMethod · 0.65
NewPQFunction · 0.65
ReadFunction · 0.65
ConfigureMethod · 0.65
BodyNonAtomicMethod · 0.65
BodyMethod · 0.65
msgsAddFunction · 0.95
BytesMethod · 0.65
UnquoteMboxFunction · 0.65
BodyMethod · 0.65

Implementers 3

FileBufferframework/buffer/file.go
MemoryBufferframework/buffer/memory.go
FailingBufferinternal/testutils/buffer.go

Calls

no outgoing calls

Tested by

no test coverage detected