convertPathAST converts an omni PathAST to a bytebase base.PathAST.
(p *es.PathAST)
| 50 | |
| 51 | // convertPathAST converts an omni PathAST to a bytebase base.PathAST. |
| 52 | func convertPathAST(p *es.PathAST) *base.PathAST { |
| 53 | if p == nil || p.Root == nil { |
| 54 | return nil |
| 55 | } |
| 56 | root := base.NewItemSelector(p.Root.Name) |
| 57 | current := base.SelectorNode(root) |
| 58 | omniCurrent := p.Root.Next |
| 59 | for omniCurrent != nil { |
| 60 | next := base.NewItemSelector(omniCurrent.Name) |
| 61 | current.SetNext(next) |
| 62 | current = next |
| 63 | omniCurrent = omniCurrent.Next |
| 64 | } |
| 65 | return base.NewPathAST(root) |
| 66 | } |
| 67 | |
| 68 | // convertAnalysis converts an omni analysis.RequestAnalysis to a bytebase base.ElasticsearchAnalysis. |
| 69 | func convertAnalysis(a *analysis.RequestAnalysis) *base.ElasticsearchAnalysis { |
no test coverage detected