From 43951824d00c8f1f0766145b338f1f972c4e1c90 Mon Sep 17 00:00:00 2001 From: jshlbrd Date: Thu, 24 Oct 2024 08:57:50 -0700 Subject: [PATCH] refactor(message): Update Types, Remove Flags Method --- message/message.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/message/message.go b/message/message.go index 79a7de39..8fdcf92e 100644 --- a/message/message.go +++ b/message/message.go @@ -13,12 +13,14 @@ import ( "github.com/tidwall/sjson" ) +type Flag int + const ( // metaKey is a prefix used to access the meta field in a Message. metaKey = "meta " // IsControl indicates that the message is a control message. - IsControl = iota + IsControl Flag = iota + 1 // SkipNullValues indicates that null values should be ignored when processing the message. SkipNullValues // SkipMissingValues indicates that missing values should be ignored when processing the message. @@ -54,7 +56,7 @@ type Message struct { // Control messages trigger special behavior in transforms and conditions. ctrl bool - flags []any + flags []Flag } // String returns the message data as a string. @@ -72,11 +74,6 @@ func New(opts ...func(*Message)) *Message { return msg } -// Flags returns all message flags. -func (m *Message) Flags() []any { - return m.flags -} - // HasFlag returns true if the message contains a flag. func (m *Message) HasFlag(i any) bool { for _, f := range m.flags {