-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrated from `universal_io` to `http` * Refactored project into discrete testable modules * Added unit tests for each piece * Added MockAwsRequest to mock requests for easier testing * Added AUTHORS file * Added static version of primary method * Updated documentation to illustrate new static call method * Added coverage * Fixed bug with allowing non String values in queryString
- Loading branch information
=Zachary Merritt
committed
Jan 9, 2022
1 parent
8fd1108
commit cf522cb
Showing
21 changed files
with
1,450 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ jobs: | |
run: dart pub get | ||
|
||
# Uncomment this step to verify the use of 'dart format' on each commit. | ||
# - name: Verify formatting | ||
# run: dart format --output=none --set-exit-if-changed . | ||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
# Consider passing '--fatal-infos' for slightly stricter analysis. | ||
- name: Analyze project source | ||
|
@@ -36,3 +36,12 @@ jobs: | |
# want to change this to 'flutter test'. | ||
- name: Run tests | ||
run: dart test | ||
|
||
- name: Generate coverage test | ||
run: source scripts/coverage_helper.sh aws_request | ||
|
||
- name: Collect coverage | ||
run: dart test --coverage . | ||
- uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Zachary Merritt <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
import 'package:aws_request/aws_request.dart'; | ||
import 'package:http/http.dart'; | ||
|
||
void sendCloudWatchLog(String logString) async { | ||
void awsRequestFunction(String logString) async { | ||
AwsRequest request = new AwsRequest('awsAccessKey', 'awsSecretKey', 'region'); | ||
String body = """ | ||
{"logEvents": | ||
[{ | ||
"timestamp":${DateTime.now().toUtc().millisecondsSinceEpoch}, | ||
"message":"$logString" | ||
}], | ||
"logGroupName":"ExampleLogGroupName", | ||
"logStreamName":"ExampleLogStreamName" | ||
}"""; | ||
await request.send( | ||
Response result = await request.send( | ||
AwsRequestType.POST, | ||
jsonBody: body, | ||
target: 'Logs_XXXXXXXX.PutLogEvents', | ||
jsonBody: "{'jsonKey': 'jsonValue'}", | ||
target: 'Logs_20140328.PutLogEvents', | ||
service: 'logs', | ||
queryString: {'X-Amz-Expires': '10'}, | ||
headers: {'X-Amz-Security-Token': 'XXXXXXXXXXXX'}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.