github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/internal/msg/imsg.go (about) 1 package msg 2 3 import ( 4 "github.com/ronaksoft/rony" 5 ) 6 7 /* 8 Creation Time: 2021 - Jul - 01 9 Created by: (ehsan) 10 Maintainers: 11 1. Ehsan N. Moosa (E2) 12 Auditor: Ehsan N. Moosa (E2) 13 Copyright Ronak Software Group 2020 14 */ 15 16 //go:generate protoc -I=. -I=../.. --go_out=paths=source_relative:. imsg.proto 17 //go:generate protoc -I=. -I=../.. --gorony_out=paths=source_relative,rony_opt=no_edge_dep:. imsg.proto 18 func init() {} 19 20 /* 21 Extra methods for TunnelMessage 22 */ 23 24 func (x *TunnelMessage) Fill(senderID []byte, senderReplicaSet uint64, e *rony.MessageEnvelope, kvs ...*rony.KeyValue) { 25 x.SenderID = append(x.SenderID[:0], senderID...) 26 x.SenderReplicaSet = senderReplicaSet 27 x.Store = append(x.Store[:0], kvs...) 28 if x.Envelope == nil { 29 x.Envelope = rony.PoolMessageEnvelope.Get() 30 } 31 e.DeepCopy(x.Envelope) 32 }