Skip to content

Commit

Permalink
Use one struct for Logfmt and JSON Expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
btaani committed Feb 22, 2023
1 parent e9420ac commit 685021d
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 158 deletions.
13 changes: 0 additions & 13 deletions pkg/logql/log/json_expr.go

This file was deleted.

13 changes: 0 additions & 13 deletions pkg/logql/log/logfmt_expr.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/logql/log/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ type LogfmtExpressionParser struct {
keys internedStringSet
}

func NewLogfmtExpressionParser(expressions []LogfmtExpression) (*LogfmtExpressionParser, error) {
func NewLogfmtExpressionParser(expressions []XExpression) (*LogfmtExpressionParser, error) {
if len(expressions) == 0 {
return nil, fmt.Errorf("no logfmt expression provided")
}
Expand Down Expand Up @@ -447,7 +447,7 @@ type JSONExpressionParser struct {
keys internedStringSet
}

func NewJSONExpressionParser(expressions []JSONExpression) (*JSONExpressionParser, error) {
func NewJSONExpressionParser(expressions []XExpression) (*JSONExpressionParser, error) {
paths := make(map[string][]interface{})

for _, exp := range expressions {
Expand Down
Loading

0 comments on commit 685021d

Please sign in to comment.