diff --git a/CHANGELOG.md b/CHANGELOG.md index f2565253..0059ac9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ## v1.7.9~ *??? ??, ????* +### CHANGES + +- `pkg/anonymity/logger`: add WithConn(string) diff --git a/pkg/anonymity/logger/log_builder.go b/pkg/anonymity/logger/log_builder.go index 386cf8f3..a8f6676e 100644 --- a/pkg/anonymity/logger/log_builder.go +++ b/pkg/anonymity/logger/log_builder.go @@ -16,6 +16,7 @@ type sLogger struct { fHash []byte fProof uint64 fSize uint64 + fConn string fPubKey asymmetric.IPubKey } @@ -51,6 +52,10 @@ func (p *sLogger) GetProof() uint64 { return p.fProof } +func (p *sLogger) GetConn() string { + return p.fConn +} + func (p *sLogger) Build() ILogGetter { return p } @@ -79,3 +84,8 @@ func (p *sLogger) WithSize(pSize int) ILogBuilder { p.fSize = uint64(pSize) return p } + +func (p *sLogger) WithConn(pConn string) ILogBuilder { + p.fConn = pConn + return p +} diff --git a/pkg/anonymity/logger/logger_test.go b/pkg/anonymity/logger/logger_test.go index b53d7441..4d45c604 100644 --- a/pkg/anonymity/logger/logger_test.go +++ b/pkg/anonymity/logger/logger_test.go @@ -12,6 +12,7 @@ const ( tcHash = "hash-example" tcProof = 3 tcSize = 8192 + tcConn = "connection" ) func TestLogger(t *testing.T) { @@ -23,7 +24,8 @@ func TestLogger(t *testing.T) { WithProof(tcProof). WithPubKey(pubKey). WithSize(tcSize). - WithType(CLogInfoExist) + WithType(CLogInfoExist). + WithConn(tcConn) getter := builder.Build() if getter.GetService() != tcService { @@ -55,4 +57,9 @@ func TestLogger(t *testing.T) { t.Error("getter.GetType() != CLogInfoExist") return } + + if getter.GetConn() != tcConn { + t.Error("getter.GetConn() != tcConn") + return + } } diff --git a/pkg/anonymity/logger/types.go b/pkg/anonymity/logger/types.go index b05d3ecd..36a03cd1 100644 --- a/pkg/anonymity/logger/types.go +++ b/pkg/anonymity/logger/types.go @@ -45,6 +45,7 @@ type ILogBuilder interface { WithSize(int) ILogBuilder WithProof(uint64) ILogBuilder WithHash([]byte) ILogBuilder + WithConn(string) ILogBuilder WithPubKey(asymmetric.IPubKey) ILogBuilder } @@ -54,5 +55,6 @@ type ILogGetter interface { GetSize() uint64 GetProof() uint64 GetHash() []byte + GetConn() string GetPubKey() asymmetric.IPubKey } diff --git a/test/result/badge_codelines.svg b/test/result/badge_codelines.svg index 8235c976..f2b62ddd 100644 --- a/test/result/badge_codelines.svg +++ b/test/result/badge_codelines.svg @@ -1 +1 @@ -code lines: 12535code lines12535 \ No newline at end of file +code lines: 12554code lines12554 \ No newline at end of file diff --git a/test/result/coverage.svg b/test/result/coverage.svg index f4a78553..77e12146 100644 --- a/test/result/coverage.svg +++ b/test/result/coverage.svg @@ -20,7 +20,7 @@ - + - + - + anonymity @@ -52,12 +52,12 @@ - + client @@ -65,12 +65,12 @@ - + crypto @@ -78,12 +78,12 @@ - + encoding @@ -91,12 +91,12 @@ - + logger @@ -104,7 +104,7 @@ - + - + payload @@ -130,12 +130,12 @@ - + state @@ -143,12 +143,12 @@ - + storage @@ -156,12 +156,12 @@ - + action.go @@ -169,25 +169,18 @@ - + -adapters/adapter.go - - + anonymity.go @@ -195,18 +188,18 @@ - + - + head.go @@ -214,12 +207,12 @@ - + logger/log_builder.go @@ -227,12 +220,12 @@ - + queue @@ -240,12 +233,12 @@ - + settings.go @@ -253,12 +246,12 @@ - + client.go @@ -266,12 +259,12 @@ - + message @@ -279,12 +272,12 @@ - + asymmetric @@ -292,12 +285,12 @@ - + hashing @@ -305,18 +298,18 @@ - + - + puzzle/puzzle.go @@ -324,12 +317,12 @@ - + random/random.go @@ -337,12 +330,12 @@ - + symmetric/symmetric.go @@ -350,12 +343,12 @@ - + bytes.go @@ -363,43 +356,50 @@ - - - - - - - + - + +hex.go + - + serialize_yaml.go + data-math="N">serialize_json.go - + + + + + + + logger.go @@ -407,13 +407,13 @@ - + - + - + connkeeper @@ -439,13 +439,13 @@ - + - + - + - + settings.go @@ -484,12 +484,12 @@ - + joiner @@ -497,12 +497,12 @@ - + payload32.go @@ -510,12 +510,12 @@ - + payload64.go @@ -523,24 +523,24 @@ - + - + - + cache/lru.go @@ -548,12 +548,12 @@ - + database @@ -561,18 +561,18 @@ - + - + queue.go @@ -580,18 +580,18 @@ - + - + message.go @@ -599,12 +599,12 @@ - + dsa.go @@ -612,12 +612,12 @@ - + kem.go @@ -625,12 +625,12 @@ - + key.go @@ -638,12 +638,12 @@ - + map_pubkeys.go @@ -651,18 +651,18 @@ - + - + hmac.go @@ -670,7 +670,7 @@ - + - + settings.go @@ -696,12 +696,12 @@ - + connkeeper.go @@ -709,18 +709,18 @@ - + - + settings.go @@ -728,18 +728,18 @@ - + - + message.go @@ -747,24 +747,24 @@ - + - + - + database.go