Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
#1 add mapper for filter expression
Browse files Browse the repository at this point in the history
  • Loading branch information
gessnerfl committed Apr 14, 2019
1 parent 76b7e55 commit 3ddfb82
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions instana/utils/filter-expression-mapper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package utils

import (
"fmt"

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
)

func NewFilterExpressionMapper() FilterExpressionMapper {
return new(filterExpressionMapperImpl)
}

type FilterExpressionMapper interface {
FromApiModel(input restapi.MatchExpression) (*FilterExpression, error)
ToApiModel(input *FilterExpression) (*restapi.MatchExpression, error)
}

type filterExpressionMapperImpl struct{}

func (i *filterExpressionMapperImpl) FromApiModel(input restapi.MatchExpression) (*FilterExpression, error) {
if input.GetType() == restapi.BinaryOperatorExpressionType {

} else if input.GetType() == restapi.LeafExpressionType {

}
return nil, fmt.Errorf("Unsupported match expression of type %s", input.GetType())
}

func (i *filterExpressionMapperImpl) ToApiModel(input *FilterExpression) (*restapi.MatchExpression, error) {
return nil, nil
}

0 comments on commit 3ddfb82

Please sign in to comment.