From ed7bc7cc4d31b430ff8b1f201162a968885c2235 Mon Sep 17 00:00:00 2001 From: Elim Tsiagbey Date: Thu, 13 Jul 2023 15:48:27 -0400 Subject: [PATCH] chore: Add missing for summary interfaces (#3438) Add missing `Errors` Getter & Setter for Session & Connection Summary interfaces --- internal/bsr/types.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/internal/bsr/types.go b/internal/bsr/types.go index 655e36d2e3..5368723270 100644 --- a/internal/bsr/types.go +++ b/internal/bsr/types.go @@ -56,6 +56,10 @@ type SessionSummary interface { Summary // GetConnectionCount returns the connection count. GetConnectionCount() uint64 + // GetErrors returns errors. + GetErrors() error + // SetErrors sets errors. + SetErrors(e error) } func AllocSessionSummary(_ context.Context) Summary { @@ -82,6 +86,16 @@ func (b *BaseSessionSummary) GetConnectionCount() uint64 { return b.ConnectionCount } +// GetErrors returns errors. +func (b *BaseSessionSummary) GetErrors() error { + return b.Errors +} + +// SetErrors sets errors. +func (b *BaseSessionSummary) SetErrors(e error) { + b.Errors = e +} + // BaseChannelSummary encapsulates data for a channel, including its id, channel type, // start/end time using a monotonic clock, and the bytes up/ down seen on this channel type BaseChannelSummary struct { @@ -167,6 +181,10 @@ type ConnectionSummary interface { GetBytesUp() uint64 // BytesDown returns download bytes. GetBytesDown() uint64 + // GetErrors returns errors. + GetErrors() error + // SetErrors sets errors. + SetErrors(e error) } func AllocConnectionSummary(_ context.Context) Summary { @@ -202,3 +220,13 @@ func (b *BaseConnectionSummary) GetBytesUp() uint64 { func (b *BaseConnectionSummary) GetBytesDown() uint64 { return b.BytesDown } + +// GetErrors returns errors. +func (b *BaseConnectionSummary) GetErrors() error { + return b.Errors +} + +// SetErrors sets errors. +func (b *BaseConnectionSummary) SetErrors(e error) { + b.Errors = e +}