Skip to content

Commit

Permalink
refactor(message): Update Types, Remove Flags Method
Browse files Browse the repository at this point in the history
  • Loading branch information
jshlbrd committed Oct 24, 2024
1 parent d7e0fc3 commit 4395182
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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 {
Expand Down

0 comments on commit 4395182

Please sign in to comment.