Commit 4f18179
authored
Refactor logsapi package (#129)
* Refactor logsapi
* Add test for subscribing to logs API
* Further abstract sending logs api subscription request
* Make sure to close logsapi server at test end and unset env vars
* Test with different port
* Improve and consolidate tests
* Allow logsapi listenerhost to be set for testing
* Minor improvements
* Respond with status code 500 if json cannot be unmarshalled
* No reason to close the body, the server does
* Fix variable names and other updates from code review
* Don't use a variable for the error in the method signature
* Add code review suggestion that was overwritten by a push with --force
* Don't initialize logsAPIListener in function, it's already defined
* No need to send request in go routine if a buffered channel is used
* Cancel the background context when a shutdown event is received
* Define UnmarshalJSON function for a LogEvent
* Handle case when json doesn't unmarshal correctly
* Use anon struct in UnmarshalJSON function
* Simplify UnmarshalJSON function
* Check first byte of record to determine if it's an object or string
* Use json.Decoder in test1 parent 50c1105 commit 4f18179
File tree
9 files changed
+480
-339
lines changed- apm-lambda-extension
- logsapi
9 files changed
+480
-339
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
156 | | - | |
157 | 165 | | |
158 | 166 | | |
159 | 167 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments