This commit is contained in:
number571 2024-12-29 20:56:02 +07:00
parent 855b6fcdff
commit ff613fca81
45 changed files with 455 additions and 454 deletions

View File

@ -6,6 +6,10 @@
*??? ??, ????*
### CHANGES
- `pkg/client/message,pkg/network/message`: move to pkg/message/layer2,pkg/message/layer1
<!-- ... -->
## v1.7.9

View File

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -3,7 +3,7 @@ package adapters
import (
"context"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
)
var (
@ -11,8 +11,8 @@ var (
)
type (
iProducerF func(context.Context, net_message.IMessage) error
iConsumerF func(context.Context) (net_message.IMessage, error)
iProducerF func(context.Context, layer1.IMessage) error
iConsumerF func(context.Context) (layer1.IMessage, error)
)
type sAdapter struct {
@ -27,10 +27,10 @@ func NewAdapterByFuncs(pProduce iProducerF, pConsume iConsumerF) IAdapter {
}
}
func (p *sAdapter) Produce(pCtx context.Context, pMsg net_message.IMessage) error {
func (p *sAdapter) Produce(pCtx context.Context, pMsg layer1.IMessage) error {
return p.fProduce(pCtx, pMsg)
}
func (p *sAdapter) Consume(pCtx context.Context) (net_message.IMessage, error) {
func (p *sAdapter) Consume(pCtx context.Context) (layer1.IMessage, error) {
return p.fConsume(pCtx)
}

View File

@ -5,7 +5,7 @@ import (
"context"
"testing"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/payload"
)
@ -14,22 +14,22 @@ const (
)
func TestAdapter(t *testing.T) {
msgChan := make(chan message.IMessage, 1)
msgChan := make(chan layer1.IMessage, 1)
adapter := NewAdapterByFuncs(
func(_ context.Context, msg message.IMessage) error {
func(_ context.Context, msg layer1.IMessage) error {
msgChan <- msg
return nil
},
func(_ context.Context) (message.IMessage, error) {
func(_ context.Context) (layer1.IMessage, error) {
return <-msgChan, nil
},
)
ctx := context.Background()
err := adapter.Produce(ctx, message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
FSettings: message.NewSettings(&message.SSettings{}),
err := adapter.Produce(ctx, layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
payload.NewPayload32(0x01, []byte(tcMessage)),
))

View File

@ -3,7 +3,7 @@ package adapters
import (
"context"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
)
type IAdapter interface {
@ -12,9 +12,9 @@ type IAdapter interface {
}
type IProducer interface {
Produce(context.Context, net_message.IMessage) error
Produce(context.Context, layer1.IMessage) error
}
type IConsumer interface {
Consume(context.Context) (net_message.IMessage, error)
Consume(context.Context) (layer1.IMessage, error)
}

View File

@ -9,17 +9,17 @@ import (
"github.com/number571/go-peer/pkg/anonymity/adapters"
"github.com/number571/go-peer/pkg/anonymity/queue"
"github.com/number571/go-peer/pkg/client/message"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/crypto/hashing"
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/logger"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/message/layer2"
"github.com/number571/go-peer/pkg/payload"
"github.com/number571/go-peer/pkg/state"
"github.com/number571/go-peer/pkg/storage/database"
anon_logger "github.com/number571/go-peer/pkg/anonymity/logger"
net_message "github.com/number571/go-peer/pkg/network/message"
)
var (
@ -225,7 +225,7 @@ func (p *sNode) recvResponse(pCtx context.Context, pActionKey string) ([]byte, e
}
}
func (p *sNode) consumeMessage(pCtx context.Context, pNetMsg net_message.IMessage) error {
func (p *sNode) consumeMessage(pCtx context.Context, pNetMsg layer1.IMessage) error {
logBuilder := anon_logger.NewLogBuilder(p.fSettings.GetServiceName())
// update logger state
@ -235,7 +235,7 @@ func (p *sNode) consumeMessage(pCtx context.Context, pNetMsg net_message.IMessag
encMsg := pNetMsg.GetPayload().GetBody()
// load encrypted message without decryption try
if _, err := message.LoadMessage(client.GetMessageSize(), encMsg); err != nil {
if _, err := layer2.LoadMessage(client.GetMessageSize(), encMsg); err != nil {
// problem from sender's side
p.fLogger.PushWarn(logBuilder.WithType(anon_logger.CLogWarnMessageNull))
return errors.Join(ErrLoadMessage, err)
@ -377,7 +377,7 @@ func (p *sNode) enqueuePayload(
return nil
}
func (p *sNode) enrichLogger(pLogBuilder anon_logger.ILogBuilder, pNetMsg net_message.IMessage) anon_logger.ILogBuilder {
func (p *sNode) enrichLogger(pLogBuilder anon_logger.ILogBuilder, pNetMsg layer1.IMessage) anon_logger.ILogBuilder {
var (
size = len(pNetMsg.ToBytes())
hash = pNetMsg.GetHash()
@ -391,7 +391,7 @@ func (p *sNode) enrichLogger(pLogBuilder anon_logger.ILogBuilder, pNetMsg net_me
func (p *sNode) produceMessage(
pCtx context.Context,
pNetMsg net_message.IMessage,
pNetMsg layer1.IMessage,
) (bool, error) {
serviceName := p.fSettings.GetServiceName()

View File

@ -19,6 +19,7 @@ import (
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/encoding"
"github.com/number571/go-peer/pkg/logger"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/payload"
"github.com/number571/go-peer/pkg/storage/cache"
@ -27,7 +28,6 @@ import (
anon_logger "github.com/number571/go-peer/pkg/anonymity/logger"
"github.com/number571/go-peer/pkg/network/conn"
net_message "github.com/number571/go-peer/pkg/network/message"
)
const (
@ -345,8 +345,8 @@ func TestHandleWrapper(t *testing.T) {
pubKey := privKey.GetPubKey()
node.GetMapPubKeys().SetPubKey(privKey.GetPubKey())
sett := net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
})
msg, err := client.EncryptMessage(
@ -483,8 +483,8 @@ func TestStoreHashWithBroadcastMessage(t *testing.T) {
return
}
sett := net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
})
netMsg := node.testNewNetworkMessage(sett, msg)
@ -675,7 +675,7 @@ func (p *stLogging) HasErro() bool {
*/
func testRunNodeWithDB(ctx context.Context, timeWait time.Duration, addr string, db database.IKVDatabase) (INode, network.INode) {
msgChan := make(chan net_message.IMessage)
msgChan := make(chan layer1.IMessage)
parallel := uint64(1)
networkMask := uint32(1)
limitVoidSize := uint64(10_000)
@ -686,7 +686,7 @@ func testRunNodeWithDB(ctx context.Context, timeWait time.Duration, addr string,
FReadTimeout: timeWait,
FWriteTimeout: timeWait,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: net_message.NewSettings(&net_message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize + limitVoidSize,
@ -697,7 +697,7 @@ func testRunNodeWithDB(ctx context.Context, timeWait time.Duration, addr string,
}),
}),
cache.NewLRUCache(1024),
).HandleFunc(networkMask, func(_ context.Context, _ network.INode, _ conn.IConn, msg net_message.IMessage) error {
).HandleFunc(networkMask, func(_ context.Context, _ network.INode, _ conn.IConn, msg layer1.IMessage) error {
msgChan <- msg
return nil
})
@ -712,10 +712,10 @@ func testRunNodeWithDB(ctx context.Context, timeWait time.Duration, addr string,
func(_ logger.ILogArg) string { return "" },
),
adapters.NewAdapterByFuncs(
func(ctx context.Context, msg net_message.IMessage) error {
func(ctx context.Context, msg layer1.IMessage) error {
return networkNode.BroadcastMessage(ctx, msg)
},
func(ctx context.Context) (net_message.IMessage, error) {
func(ctx context.Context) (layer1.IMessage, error) {
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -728,8 +728,8 @@ func testRunNodeWithDB(ctx context.Context, timeWait time.Duration, addr string,
db,
queue.NewQBProblemProcessor(
queue.NewSettings(&queue.SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FParallel: parallel,
@ -770,8 +770,8 @@ func testDeleteDB(typeDB int) {
}
}
func (p *sNode) testNewNetworkMessage(pSett net_message.IConstructSettings, pMsgBytes []byte) net_message.IMessage {
return net_message.NewMessage(
func (p *sNode) testNewNetworkMessage(pSett layer1.IConstructSettings, pMsgBytes []byte) layer1.IMessage {
return layer1.NewMessage(
pSett,
payload.NewPayload32(
p.fQBProcessor.GetSettings().GetNetworkMask(),

View File

@ -13,9 +13,9 @@ import (
"github.com/number571/go-peer/pkg/client"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/logger"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/storage/cache"
"github.com/number571/go-peer/pkg/storage/database"
)
@ -29,7 +29,7 @@ const (
)
func newNode(serviceName, address string) (network.INode, anonymity.INode) {
msgChan := make(chan net_message.IMessage)
msgChan := make(chan layer1.IMessage)
networkNode := network.NewNode(
network.NewSettings(&network.SSettings{
FAddress: address,
@ -37,7 +37,7 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
FReadTimeout: time.Minute,
FWriteTimeout: time.Minute,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: net_message.NewSettings(&net_message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: workSize,
}),
FLimitMessageSizeBytes: msgSize,
@ -50,7 +50,7 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
cache.NewLRUCache(1024),
).HandleFunc(
networkMask,
func(ctx context.Context, _ network.INode, _ conn.IConn, msg net_message.IMessage) error {
func(ctx context.Context, _ network.INode, _ conn.IConn, msg layer1.IMessage) error {
msgChan <- msg
return nil
},
@ -82,10 +82,10 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
},
),
adapters.NewAdapterByFuncs(
func(ctx context.Context, msg net_message.IMessage) error {
func(ctx context.Context, msg layer1.IMessage) error {
return networkNode.BroadcastMessage(ctx, msg)
},
func(ctx context.Context) (net_message.IMessage, error) {
func(ctx context.Context) (layer1.IMessage, error) {
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -104,8 +104,8 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
}(),
queue.NewQBProblemProcessor(
queue.NewSettings(&queue.SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: workSize,
}),
}),

View File

@ -13,9 +13,9 @@ import (
"github.com/number571/go-peer/pkg/client"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/logger"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/storage/cache"
"github.com/number571/go-peer/pkg/storage/database"
)
@ -29,7 +29,7 @@ const (
)
func newNode(serviceName, address string) (network.INode, anonymity.INode) {
msgChan := make(chan net_message.IMessage)
msgChan := make(chan layer1.IMessage)
networkNode := network.NewNode(
network.NewSettings(&network.SSettings{
FAddress: address,
@ -37,7 +37,7 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
FReadTimeout: time.Minute,
FWriteTimeout: time.Minute,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: net_message.NewSettings(&net_message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: workSize,
}),
FLimitMessageSizeBytes: msgSize,
@ -50,7 +50,7 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
cache.NewLRUCache(1024),
).HandleFunc(
networkMask,
func(ctx context.Context, _ network.INode, _ conn.IConn, msg net_message.IMessage) error {
func(ctx context.Context, _ network.INode, _ conn.IConn, msg layer1.IMessage) error {
msgChan <- msg
return nil
},
@ -82,10 +82,10 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
},
),
adapters.NewAdapterByFuncs(
func(ctx context.Context, msg net_message.IMessage) error {
func(ctx context.Context, msg layer1.IMessage) error {
return networkNode.BroadcastMessage(ctx, msg)
},
func(ctx context.Context) (net_message.IMessage, error) {
func(ctx context.Context) (layer1.IMessage, error) {
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -104,8 +104,8 @@ func newNode(serviceName, address string) (network.INode, anonymity.INode) {
}(),
queue.NewQBProblemProcessor(
queue.NewSettings(&queue.SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: workSize,
}),
}),

View File

@ -9,9 +9,9 @@ import (
"github.com/number571/go-peer/pkg/anonymity/queue"
"github.com/number571/go-peer/pkg/client"
"github.com/number571/go-peer/pkg/client/message"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/message/layer2"
"github.com/number571/go-peer/pkg/payload"
)
@ -23,8 +23,8 @@ const (
func main() {
q := queue.NewQBProblemProcessor(
queue.NewSettings(&queue.SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
FQueuePeriod: time.Second,
FQueuePoolCap: [2]uint64{1 << 5, 1 << 5},
@ -60,7 +60,7 @@ func main() {
if netMsg == nil {
panic("net message is nil")
}
msg, err := message.LoadMessage(q.GetClient().GetMessageSize(), netMsg.GetPayload().GetBody())
msg, err := layer2.LoadMessage(q.GetClient().GetMessageSize(), netMsg.GetPayload().GetBody())
if err != nil {
panic(err)
}

View File

@ -11,10 +11,9 @@ import (
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/encoding"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/payload"
"github.com/number571/go-peer/pkg/state"
net_message "github.com/number571/go-peer/pkg/network/message"
)
var (
@ -34,14 +33,14 @@ type sQBProblemProcessor struct {
type sMainPool struct {
fMutex sync.Mutex
fCount int64 // atomic variable
fQueue chan net_message.IMessage
fQueue chan layer1.IMessage
fRawQueue map[uint64]chan []byte
fConsumers map[string]uint64
}
type sRandPool struct {
fCount int64 // atomic variable
fQueue chan net_message.IMessage
fQueue chan layer1.IMessage
fReceiver asymmetric.IPubKey
}
@ -53,7 +52,7 @@ func NewQBProblemProcessor(pSettings ISettings, pClient client.IClient) IQBProbl
fSettings: pSettings,
fClient: pClient,
fMainPool: &sMainPool{
fQueue: make(chan net_message.IMessage, queuePoolCap[0]*consumersCap),
fQueue: make(chan layer1.IMessage, queuePoolCap[0]*consumersCap),
fConsumers: make(map[string]uint64, 128),
fRawQueue: func() map[uint64]chan []byte {
m := make(map[uint64]chan []byte, consumersCap)
@ -64,7 +63,7 @@ func NewQBProblemProcessor(pSettings ISettings, pClient client.IClient) IQBProbl
}(),
},
fRandPool: &sRandPool{
fQueue: make(chan net_message.IMessage, queuePoolCap[1]),
fQueue: make(chan layer1.IMessage, queuePoolCap[1]),
fReceiver: asymmetric.NewPrivKey().GetPubKey(),
},
}
@ -159,7 +158,7 @@ func (p *sQBProblemProcessor) EnqueueMessage(pPubKey asymmetric.IPubKey, pBytes
return nil
}
func (p *sQBProblemProcessor) DequeueMessage(pCtx context.Context) net_message.IMessage {
func (p *sQBProblemProcessor) DequeueMessage(pCtx context.Context) layer1.IMessage {
for {
select {
case <-pCtx.Done():
@ -208,10 +207,10 @@ func (p *sQBProblemProcessor) fillRandPool(pCtx context.Context) error {
return p.pushMessage(pCtx, p.fRandPool.fQueue, msg)
}
func (p *sQBProblemProcessor) pushMessage(pCtx context.Context, pQueue chan<- net_message.IMessage, pMsg []byte) error {
chNetMsg := make(chan net_message.IMessage)
func (p *sQBProblemProcessor) pushMessage(pCtx context.Context, pQueue chan<- layer1.IMessage, pMsg []byte) error {
chNetMsg := make(chan layer1.IMessage)
go func() {
chNetMsg <- net_message.NewMessage(
chNetMsg <- layer1.NewMessage(
p.fSettings.GetMessageConstructSettings(),
payload.NewPayload32(p.fSettings.GetNetworkMask(), pMsg),
)

View File

@ -11,7 +11,7 @@ import (
"github.com/number571/go-peer/pkg/client"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/payload"
testutils "github.com/number571/go-peer/test/utils"
)
@ -51,16 +51,16 @@ func testSettings(t *testing.T, n int) {
switch n {
case 0:
_ = NewSettings(&SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
FQueuePeriod: 500 * time.Millisecond,
FConsumersCap: 1,
})
case 1:
_ = NewSettings(&SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
FQueuePoolCap: [2]uint64{tcQueueCap, tcQueueCap},
FConsumersCap: 1,
@ -73,8 +73,8 @@ func testSettings(t *testing.T, n int) {
})
case 3:
_ = NewSettings(&SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
FQueuePoolCap: [2]uint64{tcQueueCap, tcQueueCap},
FQueuePeriod: 500 * time.Millisecond,
@ -91,8 +91,8 @@ func TestRunStopQueue(t *testing.T) {
)
queue := NewQBProblemProcessor(
NewSettings(&SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{}),
}),
FQueuePoolCap: [2]uint64{tcQueueCap, tcQueueCap},
FQueuePeriod: 100 * time.Millisecond,
@ -158,8 +158,8 @@ func TestQueue(t *testing.T) {
queue := NewQBProblemProcessor(
NewSettings(&SSettings{
FMessageConstructSettings: net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{
FMessageConstructSettings: layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: 10,
}),
}),
@ -210,7 +210,7 @@ func testQueue(queue IQBProblemProcessor) error {
time.Sleep(300 * time.Millisecond)
// auto fill queue enabled only if QB=true
msgs := make([]net_message.IMessage, 0, 3)
msgs := make([]layer1.IMessage, 0, 3)
for i := 0; i < 3; i++ {
msgs = append(msgs, queue.DequeueMessage(ctx))
}

View File

@ -3,7 +3,7 @@ package queue
import (
"time"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
)
var (
@ -12,7 +12,7 @@ var (
type SSettings sSettings
type sSettings struct {
FMessageConstructSettings net_message.IConstructSettings
FMessageConstructSettings layer1.IConstructSettings
FNetworkMask uint32
FConsumersCap uint64
FQueuePoolCap [2]uint64
@ -46,7 +46,7 @@ func (p *sSettings) mustNotNull() ISettings {
return p
}
func (p *sSettings) GetMessageConstructSettings() net_message.IConstructSettings {
func (p *sSettings) GetMessageConstructSettings() layer1.IConstructSettings {
return p.FMessageConstructSettings
}

View File

@ -6,9 +6,8 @@ import (
"github.com/number571/go-peer/pkg/client"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/types"
net_message "github.com/number571/go-peer/pkg/network/message"
)
type IQBProblemProcessor interface {
@ -18,11 +17,11 @@ type IQBProblemProcessor interface {
GetClient() client.IClient
EnqueueMessage(asymmetric.IPubKey, []byte) error
DequeueMessage(context.Context) net_message.IMessage
DequeueMessage(context.Context) layer1.IMessage
}
type ISettings interface {
GetMessageConstructSettings() net_message.IConstructSettings
GetMessageConstructSettings() layer1.IConstructSettings
GetNetworkMask() uint32
GetConsumersCap() uint64
GetQueuePeriod() time.Duration

View File

@ -3,11 +3,11 @@ package client
import (
"bytes"
"github.com/number571/go-peer/pkg/client/message"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/crypto/hashing"
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/crypto/symmetric"
"github.com/number571/go-peer/pkg/message/layer2"
"github.com/number571/go-peer/pkg/payload/joiner"
)
@ -104,7 +104,7 @@ func (p *sClient) encryptWithParams(
}
cipher := symmetric.NewCipher(sk)
return message.NewMessage(
return layer2.NewMessage(
ct,
cipher.EncryptBytes(joiner.NewBytesJoiner32([][]byte{
pkey.GetHasher().ToBytes(),
@ -119,7 +119,7 @@ func (p *sClient) encryptWithParams(
// Decrypt message with private key of receiver.
// No one else except the sender will be able to decrypt the message.
func (p *sClient) DecryptMessage(pMapPubKeys asymmetric.IMapPubKeys, pMsg []byte) (asymmetric.IPubKey, []byte, error) {
msg, err := message.LoadMessage(p.fMessageSize, pMsg)
msg, err := layer2.LoadMessage(p.fMessageSize, pMsg)
if err != nil {
return nil, nil, ErrInitCheckMessage
}

View File

@ -6,12 +6,12 @@ import (
"errors"
"testing"
"github.com/number571/go-peer/pkg/client/message"
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/crypto/hashing"
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/crypto/symmetric"
"github.com/number571/go-peer/pkg/encoding"
"github.com/number571/go-peer/pkg/message/layer2"
"github.com/number571/go-peer/pkg/payload/joiner"
)
@ -268,7 +268,7 @@ func tcEncryptWithParamsInvalidPKID(
}
cipher := symmetric.NewCipher(sk)
return message.NewMessage(
return layer2.NewMessage(
ct,
cipher.EncryptBytes(joiner.NewBytesJoiner32([][]byte{
[]byte("123"),

View File

@ -42,6 +42,6 @@
IF , than protocol is interrupted.
More information in article: https://github.com/number571/go-peer/blob/master/docs/monolithic_cryptographic_protocol.pdf
Scheme: https://github.com/number571/go-peer/blob/master/images/go-peer_layer2_message.jpg
Scheme: https://github.com/number571/go-peer/blob/master/images/go-peer_layer1_message.jpg
*/
package client

View File

@ -1,5 +0,0 @@
// Package message used as a storage and loading of encrypted messages.
//
// The package allows initializing verification of the correctness of
// the message by the hash length and proof of work.
package message

View File

@ -14,6 +14,6 @@
P - proof of work
E - encrypt
Scheme: https://github.com/number571/go-peer/blob/master/images/go-peer_layer1_net_message.jpg
Scheme: https://github.com/number571/go-peer/blob/master/images/go-peer_layer1_message.jpg
*/
package message
package layer1

View File

@ -1,7 +1,7 @@
package message
package layer1
const (
errPrefix = "pkg/network/message = "
errPrefix = "pkg/message/layer1 = "
)
type SMessageError struct {

View File

@ -1,4 +1,4 @@
package message
package layer1
import (
"bytes"

View File

@ -1,4 +1,4 @@
package message
package layer1
import (
"runtime"

View File

@ -1,4 +1,4 @@
package message
package layer1
import (
"bytes"

View File

@ -1,4 +1,4 @@
package message
package layer1
var (
_ IConstructSettings = &sConstructSettings{}

View File

@ -1,4 +1,4 @@
package message
package layer1
import (
"github.com/number571/go-peer/pkg/payload"

20
pkg/message/layer2/doc.go Normal file
View File

@ -0,0 +1,20 @@
// Package message used as a storage and loading of encrypted messages.
//
// The package allows initializing verification of the correctness of
// the message by the hash length and proof of work.
/*
NETWORK MESSAGE FORMAT
E( K, P(HM) || HM || M )
where
HM = H( K, M )
where
H - HMAC
K - network key
M - message bytes
P - proof of work
E - encrypt
Scheme: https://github.com/number571/go-peer/blob/master/images/go-peer_layer2_message.jpg
*/
package layer2

View File

@ -1,7 +1,7 @@
package message
package layer2
const (
errPrefix = "pkg/client/message = "
errPrefix = "pkg/message/layer2 = "
)
type SMessageError struct {

View File

@ -1,4 +1,4 @@
package message
package layer2
import (
"bytes"

View File

@ -1,4 +1,4 @@
package message
package layer2
import (
"bytes"

View File

@ -1,4 +1,4 @@
package message
package layer2
import (
"github.com/number571/go-peer/pkg/types"

View File

@ -9,9 +9,8 @@ import (
"time"
"github.com/number571/go-peer/pkg/encoding"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/payload/joiner"
net_message "github.com/number571/go-peer/pkg/network/message"
)
var (
@ -52,7 +51,7 @@ func (p *sConn) Close() error {
return p.fSocket.Close()
}
func (p *sConn) WriteMessage(pCtx context.Context, pMsg net_message.IMessage) error {
func (p *sConn) WriteMessage(pCtx context.Context, pMsg layer1.IMessage) error {
p.fMutex.Lock()
defer p.fMutex.Unlock()
@ -64,7 +63,7 @@ func (p *sConn) WriteMessage(pCtx context.Context, pMsg net_message.IMessage) er
return nil
}
func (p *sConn) ReadMessage(pCtx context.Context, pChRead chan<- struct{}) (net_message.IMessage, error) {
func (p *sConn) ReadMessage(pCtx context.Context, pChRead chan<- struct{}) (layer1.IMessage, error) {
// large wait read deadline => the connection has not sent anything yet
msgSize, err := p.recvHeadBytes(pCtx, pChRead, p.fSettings.GetWaitReadTimeout())
if err != nil {
@ -77,7 +76,7 @@ func (p *sConn) ReadMessage(pCtx context.Context, pChRead chan<- struct{}) (net_
}
// try unpack message from bytes
msg, err := net_message.LoadMessage(p.fSettings.GetMessageSettings(), dataBytes)
msg, err := layer1.LoadMessage(p.fSettings.GetMessageSettings(), dataBytes)
if err != nil {
return nil, errors.Join(ErrInvalidMessageBytes, err)
}
@ -143,10 +142,10 @@ func (p *sConn) recvHeadBytes(
copy(msgSizeBytes[:], headBytes)
gotMsgSize := encoding.BytesToUint32(msgSizeBytes)
fullMsgSize := p.fSettings.GetLimitMessageSizeBytes() + net_message.CMessageHeadSize
fullMsgSize := p.fSettings.GetLimitMessageSizeBytes() + layer1.CMessageHeadSize
switch {
case gotMsgSize < net_message.CMessageHeadSize:
case gotMsgSize < layer1.CMessageHeadSize:
fallthrough
case uint64(gotMsgSize) > fullMsgSize:
return 0, ErrInvalidMsgSize

View File

@ -13,7 +13,7 @@ import (
"github.com/number571/go-peer/pkg/crypto/random"
"github.com/number571/go-peer/pkg/encoding"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/payload"
testutils "github.com/number571/go-peer/test/utils"
)
@ -91,7 +91,7 @@ func testSettings(t *testing.T, n int) {
switch n {
case 0:
_ = NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
FReadTimeout: time.Minute,
@ -99,7 +99,7 @@ func testSettings(t *testing.T, n int) {
})
case 1:
_ = NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: tcMsgSize,
FDialTimeout: time.Minute,
FReadTimeout: time.Minute,
@ -107,7 +107,7 @@ func testSettings(t *testing.T, n int) {
})
case 2:
_ = NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: tcMsgSize,
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
@ -115,7 +115,7 @@ func testSettings(t *testing.T, n int) {
})
case 3:
_ = NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: tcMsgSize,
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
@ -123,7 +123,7 @@ func testSettings(t *testing.T, n int) {
})
case 4:
_ = NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: tcMsgSize,
FWaitReadTimeout: time.Hour,
FReadTimeout: time.Minute,
@ -149,7 +149,7 @@ func TestClosedConn(t *testing.T) {
conn, err := Connect(
context.Background(),
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -170,12 +170,12 @@ func TestClosedConn(t *testing.T) {
return
}
sett := message.NewConstructSettings(&message.SConstructSettings{
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: conn.GetSettings().GetMessageSettings(),
})
pld := payload.NewPayload32(1, []byte("aaa"))
msg := message.NewMessage(sett, pld)
msg := layer1.NewMessage(sett, pld)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@ -211,7 +211,7 @@ func TestInvalidConn(t *testing.T) {
_, err := Connect(
context.Background(),
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -234,7 +234,7 @@ func TestReadMessage(t *testing.T) {
rawConn := &tsConn{}
conn := LoadConn(
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -251,8 +251,8 @@ func TestReadMessage(t *testing.T) {
ch := make(chan struct{})
rawConn.bodyPart = false
rawConn.headSize = message.CMessageHeadSize + 10
rawConn.bodySize = message.CMessageHeadSize + 10
rawConn.headSize = layer1.CMessageHeadSize + 10
rawConn.bodySize = layer1.CMessageHeadSize + 10
go func() {
defer wg.Done()
ctx := context.Background()
@ -267,8 +267,8 @@ func TestReadMessage(t *testing.T) {
wg.Add(1)
rawConn.cancelBody = true
rawConn.bodyPart = false
rawConn.headSize = message.CMessageHeadSize + 10
rawConn.bodySize = message.CMessageHeadSize + 10
rawConn.headSize = layer1.CMessageHeadSize + 10
rawConn.bodySize = layer1.CMessageHeadSize + 10
go func() {
defer wg.Done()
ctx := context.Background()
@ -287,7 +287,7 @@ func TestRecvDataBytes(t *testing.T) {
rawConn := &tsConn{}
conn := LoadConn(
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -310,8 +310,8 @@ func TestRecvDataBytes(t *testing.T) {
}
rawConn.bodyPart = false
rawConn.headSize = message.CMessageHeadSize + 10
rawConn.bodySize = message.CMessageHeadSize + 10
rawConn.headSize = layer1.CMessageHeadSize + 10
rawConn.bodySize = layer1.CMessageHeadSize + 10
rawConn.readDlError = true
go func() {
ctx := context.Background()
@ -329,7 +329,7 @@ func TestSendBytes(t *testing.T) {
rawConn := &tsConn{}
conn := LoadConn(
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -361,7 +361,7 @@ func TestRecvHeadBytes(t *testing.T) {
rawConn := &tsConn{}
conn := LoadConn(
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -412,7 +412,7 @@ func testConn(t *testing.T, pAddr, pNetworkKey string) {
conn, err := Connect(
context.Background(),
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
}),
FLimitMessageSizeBytes: tcMsgSize,
@ -435,12 +435,12 @@ func testConn(t *testing.T, pAddr, pNetworkKey string) {
return
}
msgSett := message.NewConstructSettings(&message.SConstructSettings{
msgSett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: conn.GetSettings().GetMessageSettings(),
})
pld := payload.NewPayload32(tcHead, []byte(tcBody))
msg := message.NewMessage(msgSett, pld)
msg := layer1.NewMessage(msgSett, pld)
ctx := context.Background()
if err := conn.WriteMessage(ctx, msg); err != nil {
t.Error(err)
@ -478,7 +478,7 @@ func testNewService(t *testing.T, pAddr, pNetworkKey string) net.Listener {
conn := LoadConn(
NewSettings(&SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: tcWorkSize,
FNetworkKey: pNetworkKey,
}),

View File

@ -3,7 +3,7 @@ package conn
import (
"time"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
)
var (
@ -17,7 +17,7 @@ type sSettings struct {
FDialTimeout time.Duration
FReadTimeout time.Duration
FWriteTimeout time.Duration
FMessageSettings net_message.ISettings
FMessageSettings layer1.ISettings
}
func NewSettings(pSett *SSettings) ISettings {
@ -53,7 +53,7 @@ func (p *sSettings) mustNotNull() ISettings {
return p
}
func (p *sSettings) GetMessageSettings() net_message.ISettings {
func (p *sSettings) GetMessageSettings() layer1.ISettings {
return p.FMessageSettings
}

View File

@ -6,7 +6,7 @@ import (
"net"
"time"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/message/layer1"
)
type IConn interface {
@ -15,12 +15,12 @@ type IConn interface {
GetSettings() ISettings
GetSocket() net.Conn
WriteMessage(context.Context, net_message.IMessage) error
ReadMessage(context.Context, chan<- struct{}) (net_message.IMessage, error)
WriteMessage(context.Context, layer1.IMessage) error
ReadMessage(context.Context, chan<- struct{}) (layer1.IMessage, error)
}
type ISettings interface {
GetMessageSettings() net_message.ISettings
GetMessageSettings() layer1.ISettings
GetLimitMessageSizeBytes() uint64
GetDialTimeout() time.Duration
GetReadTimeout() time.Duration

View File

@ -8,9 +8,9 @@ import (
"testing"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/storage/cache"
testutils "github.com/number571/go-peer/test/utils"
)
@ -132,7 +132,7 @@ func newTestConnKeeper(pDuration time.Duration) IConnKeeper {
FReadTimeout: time.Minute,
FWriteTimeout: time.Minute,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: 10,
}),
FLimitMessageSizeBytes: (8 << 10),

View File

@ -5,9 +5,9 @@ import (
"fmt"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/payload"
)
@ -20,7 +20,7 @@ const (
)
var handler = func(serviceName string) network.IHandlerF {
return func(ctx context.Context, node network.INode, _ conn.IConn, msg message.IMessage) error {
return func(ctx context.Context, node network.INode, _ conn.IConn, msg layer1.IMessage) error {
defer node.BroadcastMessage(ctx, msg) // send this message to other connections
fmt.Printf("'%s' got '%s'\n", serviceName, string(msg.GetPayload().GetBody()))
return nil
@ -40,8 +40,8 @@ func main() {
node4.BroadcastMessage(
context.Background(),
message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: node4.GetSettings().GetConnSettings().GetMessageSettings(),
}),
payload.NewPayload32(

View File

@ -5,9 +5,9 @@ import (
"fmt"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/payload"
)
@ -18,12 +18,12 @@ const (
serviceAddress = "127.0.0.1:8080"
)
var handler = func(ctx context.Context, node network.INode, c conn.IConn, msg message.IMessage) error {
var handler = func(ctx context.Context, node network.INode, c conn.IConn, msg layer1.IMessage) error {
resp := fmt.Sprintf("echo: [%s]", string(msg.GetPayload().GetBody()))
_ = c.WriteMessage(
ctx,
message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: node.GetSettings().GetConnSettings().GetMessageSettings(),
}),
payload.NewPayload32(serviceHeader, []byte(resp)),
@ -43,8 +43,8 @@ func main() {
_ = conn.WriteMessage(
ctx,
message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: conn.GetSettings().GetMessageSettings(),
}),
payload.NewPayload32(serviceHeader, []byte("hello, world!")),

View File

@ -6,9 +6,9 @@ import (
"strconv"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/payload"
)
@ -18,7 +18,7 @@ const (
)
var handler = func(id string) network.IHandlerF {
return func(ctx context.Context, n network.INode, _ conn.IConn, msg message.IMessage) error {
return func(ctx context.Context, n network.INode, _ conn.IConn, msg layer1.IMessage) error {
time.Sleep(time.Second) // delay for view "ping-pong" game
num, err := strconv.Atoi(string(msg.GetPayload().GetBody()))
@ -34,8 +34,8 @@ var handler = func(id string) network.IHandlerF {
fmt.Printf("'%s' got '%s#%d'\n", id, val, num)
n.BroadcastMessage(
ctx,
message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: n.GetSettings().GetConnSettings().GetMessageSettings(),
}),
payload.NewPayload32(serviceHeader, []byte(fmt.Sprintf("%d", num+1))),
@ -55,8 +55,8 @@ func main() {
node1 = runClientNode("node2")
)
msg := message.NewMessage(
message.NewConstructSettings(&message.SConstructSettings{
msg := layer1.NewMessage(
layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: node1.GetSettings().GetConnSettings().GetMessageSettings(),
}),
payload.NewPayload32(serviceHeader, []byte("0")),

View File

@ -7,10 +7,9 @@ import (
"sync"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/storage/cache"
net_message "github.com/number571/go-peer/pkg/network/message"
)
var (
@ -51,7 +50,7 @@ func (p *sNode) GetCacheSetter() cache.ICacheSetter {
}
// Puts the hash of the message in the buffer and sends the message to all connections of the node.
func (p *sNode) BroadcastMessage(pCtx context.Context, pMsg net_message.IMessage) error {
func (p *sNode) BroadcastMessage(pCtx context.Context, pMsg layer1.IMessage) error {
connections := p.GetConnections()
lenConnections := len(connections)
@ -220,7 +219,7 @@ func (p *sNode) handleConn(pCtx context.Context, pAddress string, pConn conn.ICo
var (
readHeadCh = make(chan struct{})
readFullCh = make(chan net_message.IMessage)
readFullCh = make(chan layer1.IMessage)
)
go p.messageReader(
@ -257,7 +256,7 @@ func (p *sNode) messageReader(
pCtx context.Context,
pConn conn.IConn,
readHeadCh chan<- struct{},
readFullCh chan<- net_message.IMessage,
readFullCh chan<- layer1.IMessage,
) {
for {
select {
@ -277,7 +276,7 @@ func (p *sNode) messageReader(
// Processes the message for correctness and redirects it to the handler function.
// Returns true if the message was successfully redirected to the handler function
// > or if the message already existed in the hash value store.
func (p *sNode) handleMessage(pCtx context.Context, pConn conn.IConn, pMsg net_message.IMessage) bool {
func (p *sNode) handleMessage(pCtx context.Context, pConn conn.IConn, pMsg layer1.IMessage) bool {
if !p.fCacheSetter.Set(pMsg.GetHash(), []byte{}) {
return true // hash of message already in queue
}

View File

@ -10,8 +10,8 @@ import (
"testing"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/payload"
"github.com/number571/go-peer/pkg/storage/cache"
testutils "github.com/number571/go-peer/test/utils"
@ -56,7 +56,7 @@ func testSettings(t *testing.T, n int) {
FReadTimeout: tcTimeWait,
FWriteTimeout: tcTimeWait,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: (8 << 10),
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
@ -70,7 +70,7 @@ func testSettings(t *testing.T, n int) {
FMaxConnects: 16,
FWriteTimeout: tcTimeWait,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: (8 << 10),
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
@ -84,7 +84,7 @@ func testSettings(t *testing.T, n int) {
FMaxConnects: 16,
FReadTimeout: tcTimeWait,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{}),
FMessageSettings: layer1.NewSettings(&layer1.SSettings{}),
FLimitMessageSizeBytes: (8 << 10),
FWaitReadTimeout: time.Hour,
FDialTimeout: time.Minute,
@ -120,7 +120,7 @@ func TestBroadcast(t *testing.T) {
wg.Add(4 * tcIter)
headHandle := uint32(123)
handleF := func(pCtx context.Context, node INode, _ conn.IConn, pMsg message.IMessage) error {
handleF := func(pCtx context.Context, node INode, _ conn.IConn, pMsg layer1.IMessage) error {
defer func() {
_ = node.BroadcastMessage(pCtx, pMsg)
wg.Done()
@ -158,10 +158,10 @@ func TestBroadcast(t *testing.T) {
headHandle,
[]byte(fmt.Sprintf(tcBodyTemplate, i)),
)
sett := message.NewConstructSettings(&message.SConstructSettings{
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: nodes[0].GetSettings().GetConnSettings().GetMessageSettings(),
})
_ = nodes[0].BroadcastMessage(ctx, message.NewMessage(sett, pld))
_ = nodes[0].BroadcastMessage(ctx, layer1.NewMessage(sett, pld))
}(i)
}
@ -286,30 +286,30 @@ func TestHandleMessage(t *testing.T) {
node := newTestNode("", 16).(*sNode)
ctx := context.Background()
sett := message.NewConstructSettings(&message.SConstructSettings{
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: node.GetSettings().GetConnSettings().GetMessageSettings(),
})
node.HandleFunc(1, nil)
msg1 := message.NewMessage(sett, payload.NewPayload32(1, []byte{1}))
msg1 := layer1.NewMessage(sett, payload.NewPayload32(1, []byte{1}))
if ok := node.handleMessage(ctx, nil, msg1); ok {
t.Error("success handle message with nil function")
return
}
node.HandleFunc(1, func(_ context.Context, _ INode, _ conn.IConn, _ message.IMessage) error {
node.HandleFunc(1, func(_ context.Context, _ INode, _ conn.IConn, _ layer1.IMessage) error {
return errors.New("some error")
})
msg2 := message.NewMessage(sett, payload.NewPayload32(1, []byte{2}))
msg2 := layer1.NewMessage(sett, payload.NewPayload32(1, []byte{2}))
if ok := node.handleMessage(ctx, nil, msg2); ok {
t.Error("success handle message with got error from function")
return
}
node.HandleFunc(1, func(_ context.Context, _ INode, _ conn.IConn, _ message.IMessage) error {
node.HandleFunc(1, func(_ context.Context, _ INode, _ conn.IConn, _ layer1.IMessage) error {
return nil
})
msg3 := message.NewMessage(sett, payload.NewPayload32(1, []byte{3}))
msg3 := layer1.NewMessage(sett, payload.NewPayload32(1, []byte{3}))
if ok := node.handleMessage(ctx, nil, msg3); !ok {
t.Error("failed handle message with correct function")
return
@ -345,7 +345,7 @@ func TestContextCancel(t *testing.T) {
}
headHandle := uint32(123)
sett := message.NewConstructSettings(&message.SConstructSettings{
sett := layer1.NewConstructSettings(&layer1.SConstructSettings{
FSettings: node2.GetSettings().GetConnSettings().GetMessageSettings(),
})
@ -355,7 +355,7 @@ func TestContextCancel(t *testing.T) {
headHandle,
[]byte(fmt.Sprintf(tcBodyTemplate, i)),
)
if err := node2.BroadcastMessage(ctx, message.NewMessage(sett, pld)); err != nil {
if err := node2.BroadcastMessage(ctx, layer1.NewMessage(sett, pld)); err != nil {
return
}
}
@ -416,7 +416,7 @@ func newTestNode(pAddr string, pMaxConns uint64) INode {
FReadTimeout: timeout,
FWriteTimeout: timeout,
FConnSettings: conn.NewSettings(&conn.SSettings{
FMessageSettings: message.NewSettings(&message.SSettings{
FMessageSettings: layer1.NewSettings(&layer1.SSettings{
FWorkSizeBits: 10,
}),
FLimitMessageSizeBytes: (8 << 10),

View File

@ -4,18 +4,17 @@ import (
"context"
"time"
"github.com/number571/go-peer/pkg/message/layer1"
"github.com/number571/go-peer/pkg/network/conn"
"github.com/number571/go-peer/pkg/storage/cache"
"github.com/number571/go-peer/pkg/types"
net_message "github.com/number571/go-peer/pkg/network/message"
)
type IHandlerF func(
context.Context,
INode,
conn.IConn,
net_message.IMessage,
layer1.IMessage,
) error
type INode interface {
@ -29,7 +28,7 @@ type INode interface {
AddConnection(context.Context, string) error
DelConnection(string) error
BroadcastMessage(context.Context, net_message.IMessage) error
BroadcastMessage(context.Context, layer1.IMessage) error
}
type ISettings interface {

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="code lines: 12551"><title>code lines: 12551</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="57" height="20" fill="#555"/><rect x="57" width="40" height="20" fill="#4682b4"/><rect width="96" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">code lines</text><text x="295" y="140" transform="scale(.1)" fill="#fff" textLength="510">code lines</text><text aria-hidden="true" x="770" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="320">12551</text><text x="770" y="140" transform="scale(.1)" fill="#fff" textLength="320">12551</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="code lines: 12561"><title>code lines: 12561</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="96" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="57" height="20" fill="#555"/><rect x="57" width="40" height="20" fill="#4682b4"/><rect width="96" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">code lines</text><text x="295" y="140" transform="scale(.1)" fill="#fff" textLength="510">code lines</text><text aria-hidden="true" x="770" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="320">12561</text><text x="770" y="140" transform="scale(.1)" fill="#fff" textLength="320">12561</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -7,7 +7,7 @@
>
<g>
<rect x="20.000000" y="20.000000" width="988.000000" height="600.000000" style="fill: rgb(4, 115, 60);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="20.000000" y="20.000000" width="988.000000" height="600.000000" style="fill: rgb(4, 115, 61);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
@ -39,12 +39,12 @@
<g>
<rect x="315.844658" y="63.200000" width="265.081041" height="540.800000" style="fill: rgb(4, 114, 60);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="36.000000" y="63.200000" width="503.498544" height="284.995702" style="fill: rgb(4, 114, 60);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(323.844658,78.800000) scale(1.000000)"
transform="translate(44.000000,78.800000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">anonymity</text>
@ -52,12 +52,12 @@
<g>
<rect x="588.925699" y="316.135307" width="202.142931" height="146.556183" style="fill: rgb(5, 117, 62);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="739.126947" y="292.392337" width="133.495315" height="159.236568" style="fill: rgb(8, 122, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(596.925699,331.735307) scale(1.000000)"
transform="translate(747.126947,307.992337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">client</text>
@ -65,12 +65,12 @@
<g>
<rect x="588.925699" y="63.200000" width="391.898862" height="244.935307" style="fill: rgb(2, 110, 58);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="547.498544" y="63.200000" width="433.326017" height="221.192337" style="fill: rgb(2, 110, 58);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(596.925699,78.800000) scale(1.000000)"
transform="translate(555.498544,78.800000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">crypto</text>
@ -78,12 +78,12 @@
<g>
<rect x="903.128335" y="411.496654" width="77.696227" height="143.600091" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="842.660104" y="459.628905" width="138.164457" height="80.883139" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(911.128335,427.096654) scale(0.803336)"
transform="translate(850.660104,475.228905) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">encoding</text>
@ -91,12 +91,12 @@
<g>
<rect x="799.068631" y="411.496654" width="96.059704" height="143.600091" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="739.126947" y="459.628905" width="95.533157" height="144.371095" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(807.068631,427.096654) scale(1.000000)"
transform="translate(747.126947,475.228905) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">logger</text>
@ -104,12 +104,25 @@
<g>
<rect x="36.000000" y="63.200000" width="271.844658" height="540.800000" style="fill: rgb(7, 121, 64);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="547.498544" y="292.392337" width="183.628402" height="156.646372" style="fill: rgb(2, 111, 58);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(44.000000,78.800000) scale(1.000000)"
transform="translate(555.498544,307.992337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message</text>
</g>
<g>
<rect x="36.000000" y="356.195702" width="503.498544" height="247.804298" style="fill: rgb(9, 124, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(44.000000,371.795702) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">network</text>
@ -117,12 +130,12 @@
<g>
<rect x="799.068631" y="316.135307" width="181.755931" height="87.361347" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="880.622262" y="292.392337" width="100.202300" height="159.236568" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(807.068631,331.735307) scale(1.000000)"
transform="translate(888.622262,307.992337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">payload</text>
@ -130,12 +143,12 @@
<g>
<rect x="799.068631" y="563.096745" width="181.755931" height="40.903255" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="842.660104" y="548.512044" width="138.164457" height="55.487956" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(807.068631,578.696745) scale(1.000000)"
transform="translate(850.660104,564.112044) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">state</text>
@ -143,12 +156,12 @@
<g>
<rect x="588.925699" y="470.691490" width="202.142931" height="133.308510" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="547.498544" y="457.038709" width="183.628402" height="146.961291" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(596.925699,486.291490) scale(1.000000)"
transform="translate(555.498544,472.638709) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">storage</text>
@ -156,12 +169,12 @@
<g>
<rect x="503.621610" y="491.741551" width="30.652045" height="56.147685" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="432.364688" y="268.992799" width="53.219346" height="31.601452" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(511.621610,507.341551) scale(0.169584)"
transform="translate(440.364688,284.592799) scale(0.430779)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">action.go</text>
@ -169,18 +182,18 @@
<g>
<rect x="546.568326" y="555.889236" width="26.357373" height="28.083073" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="493.584035" y="312.994412" width="26.435882" height="27.201290" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="323.844658" y="84.800000" width="249.081041" height="281.337461" style="fill: rgb(2, 112, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="44.000000" y="84.800000" width="268.129220" height="255.395702" style="fill: rgb(2, 112, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(331.844658,100.400000) scale(1.000000)"
transform="translate(52.000000,100.400000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">anonymity.go</text>
@ -188,18 +201,18 @@
<g>
<rect x="546.568326" y="591.972309" width="26.357373" height="4.027691" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="528.019917" y="312.994412" width="3.478627" height="27.201290" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="503.621610" y="555.889236" width="34.946716" height="40.110764" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="493.584035" y="268.992799" width="37.914510" height="36.001613" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(511.621610,571.489236) scale(0.281945)"
transform="translate(501.584035,284.592799) scale(0.326109)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">head.go</text>
@ -207,12 +220,12 @@
<g>
<rect x="503.621610" y="374.137461" width="69.304089" height="109.604090" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="320.129220" y="268.992799" width="104.235468" height="71.202904" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(511.621610,389.737461) scale(0.264405)"
transform="translate(328.129220,284.592799) scale(0.437676)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">logger/log_builder.go</text>
@ -220,12 +233,12 @@
<g>
<rect x="323.844658" y="374.137461" width="171.776952" height="221.862539" style="fill: rgb(8, 123, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="320.129220" y="84.800000" width="211.369325" height="176.192799" style="fill: rgb(8, 123, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(331.844658,389.737461) scale(1.000000)"
transform="translate(328.129220,100.400000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">queue</text>
@ -233,12 +246,12 @@
<g>
<rect x="542.273655" y="491.741551" width="30.652045" height="56.147685" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="432.364688" y="308.594251" width="53.219346" height="31.601452" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(550.273655,507.341551) scale(0.138750)"
transform="translate(440.364688,324.194251) scale(0.352456)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
@ -246,12 +259,12 @@
<g>
<rect x="596.925699" y="337.735307" width="130.673522" height="116.956183" style="fill: rgb(8, 123, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="747.126947" y="313.992337" width="117.495315" height="126.937812" style="fill: rgb(8, 123, 65);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(604.925699,353.335307) scale(1.000000)"
transform="translate(755.126947,329.592337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">client.go</text>
@ -259,25 +272,12 @@
<g>
<rect x="735.599222" y="337.735307" width="47.469409" height="110.708374" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="555.498544" y="84.800000" width="249.536854" height="191.592337" style="fill: rgb(2, 111, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(743.599222,353.335307) scale(0.468295)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message</text>
</g>
<g>
<rect x="596.925699" y="84.800000" width="224.452522" height="215.335307" style="fill: rgb(2, 111, 59);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(604.925699,100.400000) scale(1.000000)"
transform="translate(563.498544,100.400000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">asymmetric</text>
@ -285,12 +285,12 @@
<g>
<rect x="931.372695" y="180.886120" width="41.451866" height="103.343038" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="874.672234" y="225.697516" width="84.883286" height="50.694821" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(939.372695,196.486120) scale(0.378748)"
transform="translate(882.672234,241.297516) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">hashing</text>
@ -298,18 +298,18 @@
<g>
<rect x="931.372695" y="292.229158" width="41.451866" height="7.906148" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="967.555520" y="225.697516" width="5.269041" height="50.694821" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="829.378221" y="84.800000" width="143.446340" height="88.086120" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="813.035399" y="84.800000" width="159.789163" height="77.871122" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(837.378221,100.400000) scale(0.829729)"
transform="translate(821.035399,100.400000) scale(0.936127)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">puzzle/puzzle.go</text>
@ -317,12 +317,12 @@
<g>
<rect x="829.378221" y="250.294767" width="93.994474" height="49.840539" style="fill: rgb(16, 136, 71);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="874.672234" y="170.671122" width="98.152327" height="47.026395" style="fill: rgb(16, 136, 71);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(837.378221,265.894767) scale(0.507777)"
transform="translate(882.672234,186.271122) scale(0.534846)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">random/random.go</text>
@ -330,12 +330,12 @@
<g>
<rect x="829.378221" y="180.886120" width="93.994474" height="61.408647" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="813.035399" y="170.671122" width="53.636835" height="105.721215" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(837.378221,196.486120) scale(0.369292)"
transform="translate(821.035399,186.271122) scale(0.178205)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">symmetric/symmetric.go</text>
@ -343,12 +343,12 @@
<g>
<rect x="911.128335" y="433.096654" width="61.696227" height="44.285753" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="850.660104" y="481.228905" width="47.784767" height="51.283139" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(919.128335,448.696654) scale(0.595003)"
transform="translate(858.660104,496.828905) scale(0.413864)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">bytes.go</text>
@ -356,50 +356,43 @@
<g>
<rect x="969.208524" y="528.953868" width="3.616038" height="18.142877" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="952.932178" y="530.631521" width="19.892384" height="1.880523" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="911.128335" y="485.382407" width="26.848113" height="35.571461" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="906.444871" y="481.228905" width="38.487306" height="21.641569" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="906.444871" y="510.870474" width="38.487306" height="21.641569" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="952.932178" y="481.228905" width="19.892384" height="41.402616" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(919.128335,500.982407) scale(0.188335)"
transform="translate(960.932178,496.828905) scale(0.023850)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">hex.go</text>
data-math="N">serialize_yaml.go</text>
</g>
<g>
<rect x="945.976448" y="485.382407" width="26.848113" height="35.571461" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="747.126947" y="481.228905" width="79.533157" height="96.716522" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(953.976448,500.982407) scale(0.066471)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">serialize_json.go</text>
</g>
<g>
<rect x="911.128335" y="528.953868" width="50.080189" height="18.142877" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="807.068631" y="433.096654" width="80.059704" height="96.058901" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(815.068631,448.696654) scale(0.741432)"
transform="translate(755.126947,496.828905) scale(0.735337)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">logger.go</text>
@ -407,18 +400,44 @@
<g>
<rect x="807.068631" y="537.155555" width="80.059704" height="9.941190" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="747.126947" y="585.945427" width="79.533157" height="10.054573" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="44.000000" y="296.558308" width="255.844658" height="142.583686" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="555.498544" y="313.992337" width="118.555760" height="127.046372" style="fill: rgb(3, 113, 60);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(52.000000,312.158308) scale(1.000000)"
transform="translate(563.498544,329.592337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">layer1</text>
</g>
<g>
<rect x="682.054305" y="313.992337" width="41.072642" height="127.046372" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(690.054305,329.592337) scale(0.435289)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">layer2</text>
</g>
<g>
<rect x="281.206750" y="377.795702" width="160.680356" height="218.204298" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(289.206750,393.395702) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">conn</text>
@ -426,12 +445,12 @@
<g>
<rect x="173.283883" y="447.141994" width="126.560776" height="99.647651" style="fill: rgb(5, 117, 62);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="449.887106" y="377.795702" width="81.611439" height="147.238243" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(181.283883,462.741994) scale(1.000000)"
transform="translate(457.887106,393.395702) scale(0.683452)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">connkeeper</text>
@ -439,31 +458,12 @@
<g>
<rect x="299.434610" y="554.789645" width="0.410048" height="41.210355" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="44.000000" y="447.141994" width="121.283883" height="148.858006" style="fill: rgb(3, 113, 60);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="44.000000" y="377.795702" width="229.206750" height="218.204298" style="fill: rgb(22, 147, 77);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(52.000000,462.741994) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message</text>
</g>
<g>
<rect x="44.000000" y="84.800000" width="255.844658" height="203.758308" style="fill: rgb(18, 139, 73);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(52.000000,100.400000) scale(1.000000)"
transform="translate(52.000000,393.395702) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(0, 0, 0); fill-opacity: 1.00; white-space: pre;"
data-math="N">network.go</text>
@ -471,12 +471,12 @@
<g>
<rect x="173.283883" y="554.789645" width="118.150727" height="41.210355" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="449.887106" y="533.033946" width="76.010724" height="62.966054" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(181.283883,570.389645) scale(0.967336)"
transform="translate(457.887106,548.633946) scale(0.568283)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
@ -484,12 +484,12 @@
<g>
<rect x="807.068631" y="337.735307" width="76.650325" height="57.761347" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="888.622262" y="313.992337" width="84.202300" height="59.053712" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(815.068631,353.335307) scale(1.000000)"
transform="translate(896.622262,329.592337) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">joiner</text>
@ -497,12 +497,12 @@
<g>
<rect x="891.718956" y="337.735307" width="36.552803" height="57.761347" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="888.622262" y="381.046050" width="38.101150" height="62.582855" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(899.718956,353.335307) scale(0.178410)"
transform="translate(896.622262,396.646050) scale(0.191850)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">payload32.go</text>
@ -510,12 +510,12 @@
<g>
<rect x="936.271759" y="337.735307" width="36.552803" height="57.761347" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="934.723412" y="381.046050" width="38.101150" height="62.582855" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(944.271759,353.335307) scale(0.178410)"
transform="translate(942.723412,396.646050) scale(0.191850)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">payload64.go</text>
@ -523,24 +523,18 @@
<g>
<rect x="972.136765" y="584.696745" width="0.687797" height="11.303255" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="850.660104" y="570.112044" width="115.656235" height="25.887956" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="807.068631" y="584.696745" width="157.068134" height="11.303255" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="718.265031" y="492.291490" width="64.803599" height="103.708510" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="665.266296" y="478.638709" width="57.860651" height="117.361291" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(726.265031,507.891490) scale(0.423642)"
transform="translate(673.266296,494.238709) scale(0.363374)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">cache/lru.go</text>
@ -548,12 +542,12 @@
<g>
<rect x="596.925699" y="492.291490" width="113.339332" height="103.708510" style="fill: rgb(11, 128, 67);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="555.498544" y="478.638709" width="101.767751" height="117.361291" style="fill: rgb(11, 128, 67);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(604.925699,507.891490) scale(1.000000)"
transform="translate(563.498544,494.238709) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">database</text>
@ -561,18 +555,18 @@
<g>
<rect x="485.385551" y="563.957994" width="2.236059" height="24.042006" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="498.959453" y="251.330749" width="24.539092" height="1.662050" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="331.844658" y="395.737461" width="155.776952" height="160.220533" style="fill: rgb(10, 126, 67);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="328.129220" y="106.400000" width="162.830233" height="146.592799" style="fill: rgb(10, 126, 67);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(339.844658,411.337461) scale(1.000000)"
transform="translate(336.129220,122.000000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">queue.go</text>
@ -580,31 +574,25 @@
<g>
<rect x="331.844658" y="563.957994" width="145.540892" height="24.042006" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="743.599222" y="359.335307" width="31.469409" height="76.418460" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="498.959453" y="106.400000" width="24.539092" height="136.930749" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(751.599222,374.935307) scale(0.161140)"
transform="translate(506.959453,122.000000) scale(0.080863)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message.go</text>
data-math="N">settings.go</text>
</g>
<g>
<rect x="604.925699" y="227.199662" width="131.382306" height="64.935645" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="660.479251" y="106.400000" width="65.425345" height="127.563509" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(612.925699,242.799662) scale(1.000000)"
transform="translate(668.479251,122.000000) scale(0.858079)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">dsa.go</text>
@ -612,12 +600,12 @@
<g>
<rect x="744.308005" y="106.400000" width="69.070216" height="119.782862" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="733.904596" y="106.400000" width="63.130803" height="127.563509" style="fill: rgb(6, 119, 63);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(752.308005,122.000000) scale(0.921358)"
transform="translate(741.904596,122.000000) scale(0.818243)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">kem.go</text>
@ -625,12 +613,12 @@
<g>
<rect x="604.925699" y="106.400000" width="131.382306" height="112.799662" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="563.498544" y="106.400000" width="88.980707" height="161.992337" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(612.925699,122.000000) scale(1.000000)"
transform="translate(571.498544,122.000000) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">key.go</text>
@ -638,108 +626,36 @@
<g>
<rect x="744.308005" y="234.182862" width="69.070216" height="57.952445" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="660.479251" y="241.963509" width="136.556148" height="26.428828" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="926.605541" y="247.297516" width="24.949980" height="21.094821" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="882.672234" y="247.297516" width="35.933307" height="21.094821" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="649.235665" y="431.452675" width="16.818640" height="1.586034" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="563.498544" y="335.592337" width="77.737120" height="97.446372" style="fill: rgb(5, 116, 61);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(752.308005,249.782862) scale(0.394868)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">map_pubkeys.go</text>
</g>
<g>
<rect x="939.372695" y="249.196428" width="25.451866" height="27.032731" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="939.372695" y="202.486120" width="25.451866" height="38.710307" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(947.372695,218.086120) scale(0.140653)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">hmac.go</text>
</g>
<g>
<rect x="52.000000" y="318.158308" width="185.628639" height="112.983686" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(60.000000,333.758308) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">conn.go</text>
</g>
<g>
<rect x="245.628639" y="318.158308" width="46.216019" height="107.222558" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(253.628639,333.758308) scale(0.286137)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
</g>
<g>
<rect x="181.283883" y="468.741994" width="80.073719" height="70.047651" style="fill: rgb(8, 122, 64);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(189.283883,484.341994) scale(0.513411)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">connkeeper.go</text>
</g>
<g>
<rect x="269.357602" y="538.117684" width="22.487057" height="0.671961" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="269.357602" y="468.741994" width="22.487057" height="61.375690" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(277.357602,484.341994) scale(0.061430)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
</g>
<g>
<rect x="154.985348" y="567.431876" width="2.298535" height="20.568124" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="52.000000" y="468.741994" width="105.283883" height="90.689882" style="fill: rgb(5, 116, 61);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(60.000000,484.341994) scale(0.930040)"
transform="translate(571.498544,351.192337) scale(0.643095)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message.go</text>
@ -747,24 +663,95 @@
<g>
<rect x="52.000000" y="567.431876" width="94.985348" height="20.568124" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="815.068631" y="359.335307" width="57.037150" height="28.161347" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="604.925699" y="513.891490" width="94.705849" height="74.108510" style="fill: rgb(12, 128, 68);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<rect x="649.235665" y="335.592337" width="16.818640" height="87.860338" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(612.925699,529.491490) scale(0.745321)"
transform="translate(657.235665,351.192337) scale(0.007752)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
</g>
<g>
<rect x="690.054305" y="335.592337" width="25.072642" height="91.896563" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(698.054305,351.192337) scale(0.094507)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">message.go</text>
</g>
<g>
<rect x="289.206750" y="399.395702" width="144.680356" height="145.597107" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(297.206750,414.995702) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">conn.go</text>
</g>
<g>
<rect x="289.206750" y="552.992810" width="137.409862" height="35.007190" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(297.206750,568.592810) scale(1.000000)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">settings.go</text>
</g>
<g>
<rect x="457.887106" y="399.395702" width="65.611439" height="85.331267" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(465.887106,414.995702) scale(0.397528)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">connkeeper.go</text>
</g>
<g>
<rect x="523.319496" y="492.726969" width="0.179049" height="24.306977" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="457.887106" y="492.726969" width="57.432390" height="24.306977" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="896.622262" y="335.592337" width="64.191652" height="29.453712" style="fill: rgb(0, 104, 55);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
</g>
<g>
<rect x="563.498544" y="500.238709" width="85.767751" height="85.367259" style="fill: rgb(12, 128, 68);opacity:1;fill-opacity:1.00;stroke:rgb(128,128,128);stroke-width:1px;stroke-opacity:1.00;" />
<text
data-notex="1"
text-anchor="start"
transform="translate(571.498544,515.838709) scale(0.660679)"
style="font-family: Open Sans, verdana, arial, sans-serif !important; font-size: 12px; fill: rgb(255, 255, 255); fill-opacity: 1.00; white-space: pre;"
data-math="N">database.go</text>

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB