-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add User-Agent information Send a user-agent http header when talking to Lambda's http server. This is important for collecting usage metrics.
- Loading branch information
1 parent
8b44c7d
commit 3461d6a
Showing
7 changed files
with
143 additions
and
14 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
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,41 @@ | ||
#pragma once | ||
/* | ||
* Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
namespace aws { | ||
namespace lambda_runtime { | ||
|
||
/** | ||
* Returns the major component of the library version. | ||
*/ | ||
unsigned get_version_major(); | ||
|
||
/** | ||
* Returns the minor component of the library version. | ||
*/ | ||
unsigned get_version_minor(); | ||
|
||
/** | ||
* Returns the patch component of the library version. | ||
*/ | ||
unsigned get_version_patch(); | ||
|
||
/** | ||
* Returns the semantic version of the library in the form Major.Minor.Patch | ||
*/ | ||
char const* get_version(); | ||
|
||
} // namespace lambda_runtime | ||
} // namespace aws |
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,48 @@ | ||
/* | ||
* Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
#define AWS_LAMBDA_RUNTIME_API __attribute__((visibility("default"))) | ||
|
||
namespace aws { | ||
namespace lambda_runtime { | ||
|
||
/* clang-format off */ | ||
AWS_LAMBDA_RUNTIME_API | ||
unsigned get_version_major() | ||
{ | ||
return @PROJECT_VERSION_MAJOR@; | ||
} | ||
|
||
AWS_LAMBDA_RUNTIME_API | ||
unsigned get_version_minor() | ||
{ | ||
return @PROJECT_VERSION_MINOR@; | ||
} | ||
|
||
AWS_LAMBDA_RUNTIME_API | ||
unsigned get_version_patch() | ||
{ | ||
return @PROJECT_VERSION_PATCH@; | ||
} | ||
/* clang-format on */ | ||
|
||
AWS_LAMBDA_RUNTIME_API | ||
char const* get_version() | ||
{ | ||
return "@PROJECT_VERSION@"; | ||
} | ||
|
||
} // namespace lambda_runtime | ||
} // namespace aws |
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,22 @@ | ||
#include <gtest/gtest.h> | ||
#include <aws/lambda-runtime/version.h> | ||
|
||
using namespace aws::lambda_runtime; | ||
|
||
TEST(VersionTests, get_version_major) | ||
{ | ||
auto version = get_version_major(); | ||
ASSERT_EQ(0, version); | ||
} | ||
|
||
TEST(VersionTests, get_version_minor) | ||
{ | ||
auto version = get_version_minor(); | ||
ASSERT_GE(version, 1); | ||
} | ||
|
||
TEST(VersionTests, get_version_patch) | ||
{ | ||
auto version = get_version_patch(); | ||
ASSERT_GE(version, 0); | ||
} |