MCPcopy
hub / github.com/golang/groupcache / Sink

Interface Sink

sinks.go:29–43  ·  view source on GitHub ↗

A Sink receives data from a Get call. Implementation of Getter must call exactly one of the Set methods on success.

Source from the content-addressed store, hash-verified

27// Implementation of Getter must call exactly one of the Set methods
28// on success.
29type Sink interface {
30 // SetString sets the value to s.
31 SetString(s string) error
32
33 // SetBytes sets the value to the contents of v.
34 // The caller retains ownership of v.
35 SetBytes(v []byte) error
36
37 // SetProto sets the value to the encoded version of m.
38 // The caller retains ownership of m.
39 SetProto(m proto.Message) error
40
41 // view returns a frozen view of the bytes for caching.
42 view() (ByteView, error)
43}
44
45func cloneBytes(b []byte) []byte {
46 c := make([]byte, len(b))

Callers 10

testSetupFunction · 0.65
TestPeersFunction · 0.65
TestNoDedupFunction · 0.65
setSinkViewFunction · 0.65
beChildForTestHTTPPoolFunction · 0.65
setSinkViewFunction · 0.65
testSetupFunction · 0.65
getLocallyMethod · 0.65

Implementers 5

stringSinksinks.go
byteViewSinksinks.go
protoSinksinks.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…