From 8380e1713ea5d3fc21c2f1256ab703f2af30b0de Mon Sep 17 00:00:00 2001 From: ahrav Date: Thu, 18 Jan 2024 13:20:06 -0800 Subject: [PATCH] save 8 bytes per chunk (#2310) --- pkg/sources/sources.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/sources/sources.go b/pkg/sources/sources.go index aa1c29341d5e..dca8ed939485 100644 --- a/pkg/sources/sources.go +++ b/pkg/sources/sources.go @@ -18,6 +18,9 @@ type ( // Chunk contains data to be decoded and scanned along with context on where it came from. type Chunk struct { + // Data is the data to decode and scan. + Data []byte + // SourceName is the name of the Source that produced the chunk. SourceName string // SourceID is the ID of the source that the Chunk originated from. @@ -27,13 +30,12 @@ type Chunk struct { // SecretID is the ID of the secret, if it exists. // Only secrets that are being reverified will have a SecretID. SecretID int64 - // SourceType is the type of Source that produced the chunk. - SourceType sourcespb.SourceType + // SourceMetadata holds the context of where the Chunk was found. SourceMetadata *source_metadatapb.MetaData + // SourceType is the type of Source that produced the chunk. + SourceType sourcespb.SourceType - // Data is the data to decode and scan. - Data []byte // Verify specifies whether any secrets in the Chunk should be verified. Verify bool }