Skip to content

Commit ecd8b20

Browse files
authored
decoder v2: remove unused modeldecoder code (#4363)
* remove unused code * add targetType validation rule and apply for `context.request.url.port` * add decoder tests for outcome and metadata client * add decoder tests for metadata system * add decoder tests for transaction marks * move transform tests out of decoder package and to model
1 parent 4f8a8d5 commit ecd8b20

File tree

79 files changed

+380
-5394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+380
-5394
lines changed

NOTICE.txt

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,40 +3404,6 @@ Contents of "LICENSE":
34043404
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34053405
SOFTWARE.
34063406

3407-
--------------------------------------------------------------------
3408-
Dependency: github.com/santhosh-tekuri/jsonschema
3409-
Version: v1.2.4
3410-
License type (autodetected): BSD-3-Clause
3411-
Contents of "LICENSE":
3412-
3413-
Copyright (c) 2017 Santhosh Kumar Tekuri. All rights reserved.
3414-
3415-
Redistribution and use in source and binary forms, with or without
3416-
modification, are permitted provided that the following conditions are
3417-
met:
3418-
3419-
* Redistributions of source code must retain the above copyright
3420-
notice, this list of conditions and the following disclaimer.
3421-
* Redistributions in binary form must reproduce the above
3422-
copyright notice, this list of conditions and the following disclaimer
3423-
in the documentation and/or other materials provided with the
3424-
distribution.
3425-
* Neither the name of Google Inc. nor the names of its
3426-
contributors may be used to endorse or promote products derived from
3427-
this software without specific prior written permission.
3428-
3429-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3430-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3431-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3432-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3433-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3434-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3435-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3436-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3437-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3438-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3439-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3440-
34413407
--------------------------------------------------------------------
34423408
Dependency: github.com/Shopify/sarama
34433409
Replacement: github.com/elastic/sarama

beater/middleware/request_metadata_middleware.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import (
2727
func UserMetadataMiddleware() Middleware {
2828
return func(h request.Handler) (request.Handler, error) {
2929
return func(c *request.Context) {
30-
dec := utility.ManualDecoder{}
31-
c.RequestMetadata.UserAgent = dec.UserAgentHeader(c.Request.Header)
30+
c.RequestMetadata.UserAgent = utility.UserAgentHeader(c.Request.Header)
3231
c.RequestMetadata.ClientIP = utility.ExtractIP(c.Request)
3332
h(c)
3433
}, nil

model/context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ func (h *Http) UserAgent() string {
188188
if h == nil || h.Request == nil {
189189
return ""
190190
}
191-
dec := utility.ManualDecoder{}
192-
return dec.UserAgentHeader(h.Request.Headers)
191+
return utility.UserAgentHeader(h.Request.Headers)
193192
}
194193

195194
// Fields returns common.MapStr holding transformed data for attribute page.

model/modeldecoder/cloud.go

Lines changed: 0 additions & 46 deletions
This file was deleted.

model/modeldecoder/container.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

model/modeldecoder/container_test.go

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)