MCPcopy
hub / github.com/OpenNHP/opennhp / Write

Method Write

nhp/log/logger.go:60–70  ·  view source on GitHub ↗

async writer must be initiated first, implements atomic write

(buf []byte)

Source from the content-addressed store, hash-verified

58// async writer
59// must be initiated first, implements atomic write
60func (lw *AsyncLogWriter) Write(buf []byte) (n int, err error) {
61 lw.Lock()
62 defer lw.Unlock()
63
64 len := len(buf)
65 msg := make([]byte, len)
66 copy(msg, buf)
67 lw.msg <- msg
68
69 return len, nil
70}
71
72func (lw *AsyncLogWriter) writeRoutine() {
73 defer lw.wg.Done()

Callers 15

HMACSha256Function · 0.45
CompressionFunction · 0.45
validatePeerMethod · 0.45
checkHMACMethod · 0.45
setPeerPublicKeyMethod · 0.45
encryptBodyMethod · 0.45
addHMACMethod · 0.45
HMAC1Method · 0.45

Calls

no outgoing calls

Tested by 5

TestECCSharedKeyFunction · 0.36
TestGMSharedKeyFunction · 0.36
TestUdpConnectionFunction · 0.36
TestHMACFunction · 0.36