{"id":15221626,"url":"https://github.com/googlecloudplatform/functions-framework-cpp","last_synced_at":"2025-04-09T13:04:00.623Z","repository":{"id":43008667,"uuid":"302478799","full_name":"GoogleCloudPlatform/functions-framework-cpp","owner":"GoogleCloudPlatform","description":"Functions Framework for C++","archived":false,"fork":false,"pushed_at":"2024-11-04T22:12:23.000Z","size":1293,"stargazers_count":50,"open_issues_count":24,"forks_count":25,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-03-30T15:42:44.259Z","etag":null,"topics":["cplusplus","cplusplus-17","cpp","cpp17","faas-framework","functions-as-a-service"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-08T22:49:39.000Z","updated_at":"2024-12-27T03:18:48.000Z","dependencies_parsed_at":"2024-05-01T20:47:35.998Z","dependency_job_id":"0ecc0591-8c95-4128-bf60-862a73520d2e","html_url":"https://github.com/GoogleCloudPlatform/functions-framework-cpp","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Ffunctions-framework-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Ffunctions-framework-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Ffunctions-framework-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Ffunctions-framework-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/functions-framework-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cplusplus-17","cpp","cpp17","faas-framework","functions-as-a-service"],"created_at":"2024-09-28T15:06:30.533Z","updated_at":"2025-04-09T13:04:00.597Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"C++","readme":"# Functions Framework for C++\n\n\u003c!-- Repo links --\u003e\n[github-discussions]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/discussions\n[github-issue]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/issues/new\n[github-releases]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/releases\n[github-repo]: https://github.com/GoogleCloudPlatform/functions-framework-cpp\n\n\u003c!-- Build Status links --\u003e\n[ff_cpp_unit_img]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/workflows/C++%20Unit%20CI/badge.svg\n[ff_cpp_unit_link]:  https://github.com/GoogleCloudPlatform/functions-framework-cpp/actions?query=workflow%3A%22C%2B%2B+Unit+CI%22\n[ff_cpp_lint_img]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/workflows/C%2B%2B%20Lint%20CI/badge.svg\n[ff_cpp_lint_link]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/actions?query=workflow%3A%22C%2B%2B+Lint+CI%22\n[ff_cpp_conformance_img]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/workflows/C++%20Conformance%20CI/badge.svg\n[ff_cpp_conformance_link]: https://github.com/GoogleCloudPlatform/functions-framework-cpp/actions?query=workflow%3A%22C%2B%2B+Conformance+CI%22\n\n\u003c!-- Reference links --\u003e\n[abseil-gh]: https://github.com/abseil/abseil-cpp\n[boost-org]: https://boost.org/\n[nlohmann-json-gh]: https://github.com/nlohmann/json\n[google-cloud-cpp-gh]: https://github.com/googleapis/google-cloud-cpp\n[fmt-gh]: https://github.com/fmtlib/fmt\n[buildpacks]: https://github.com/GoogleCloudPlatform/buildpacks\n[CloudEvents]: https://cloudevents.io/\n[docs]: docs\n[examples]: examples\n[Google Cloud Run]:\nhttps://cloud.google.com/run/docs/quickstarts/build-and-deploy\n[Google App Engine]: https://cloud.google.com/appengine/docs/go/\n[Google Cloud Functions]: https://cloud.google.com/functions/\n[Knative]: https://github.com/knative/\n[quickstart-local]: /examples/site/howto_local_development/README.md\n[quickstart-container]: /examples/site/howto_create_container/README.md\n[quickstart-cloud-run]: /examples/site/howto_deploy_to_cloud_run/README.md\n[quickstart-pubsub]: /examples/site/howto_deploy_cloud_event/README.md\n\n|Functions Framework|Unit Tests|Lint Test|Conformance Tests|\n|---|---|---|---|\n| [C++][github-repo] | [![][ff_cpp_unit_img]][ff_cpp_unit_link] | [![][ff_cpp_lint_img]][ff_cpp_lint_link] | [![][ff_cpp_conformance_img]][ff_cpp_conformance_link] |\n\nAn open source FaaS (Functions as a Service) framework for writing portable C++\nfunctions -- brought to you by Google.\n\nThe Functions Framework lets you write lightweight functions that run in many\ndifferent environments, including:\n\n- Your local development machine - see how to build and run a function in\n  [local container][quickstart-container]\n- [Google Cloud Run] - see how to [deploy functions][quickstart-cloud-run]\n  to Cloud Run\n- [Knative]-based environments\n\n[Google Cloud Functions] does not currently provide an officially supported C++\nlanguage runtime, but we're working to make running on [Google Cloud Run] as\nseamless and symmetric an experience as possible for your C++ Functions\nFramework projects.\n\nThe framework allows you to go [from][snippet source]:\n\n\u003c!-- inject-snippet-start --\u003e\n[snippet source]: /examples/hello_world/hello_world.cc\n```cc\n#include \u003cgoogle/cloud/functions/function.h\u003e\n\nnamespace gcf = ::google::cloud::functions;\n\ngcf::Function HelloWorld() {\n  return gcf::MakeFunction([](gcf::HttpRequest const\u0026 /*request*/) {\n    return gcf::HttpResponse{}\n        .set_header(\"Content-Type\", \"text/plain\")\n        .set_payload(\"Hello World\\n\");\n  });\n}\n```\n\u003c!-- inject-snippet-end --\u003e\n\nTo:\n\n```shell\ncurl https://\u003cyour-app-url\u003e\n# Output: Hello, World!\n```\n\nAll without needing to worry about writing an HTTP server or request\nhandling logic.\n\nSee more demos under the [examples] directory.\n\n## Features\n\n- Build your Function in the same container environment used by Cloud Functions\n  using [buildpacks]\n- Invoke a function in response to a request\n- Automatically unmarshal events conforming to the [CloudEvents] spec\n- Portable between serverless platforms\n\n## Versions and Status\n\nThis library is considered generally available. We do not expect breaking\nchanges to its public APIs. See [below](#public-api-and-api-breaking-changes)\nfor a description of what is included in the public API, and what parts of the\nlibrary may change without notice.\n\nThis library does **not** follow the [Semantic Versioning](https://semver.org)\nconventions.\n\n## Requirements\n\nThis is a C++17-based framework. It requires a compiler supporting C++17, we\nroutinely test with GCC (\u003e= 8), and with Clang (\u003e= 10), let us know if you\nhave problems with other compilers. The framework also depends on a number\nof other libraries, note that these libraries may have their own dependencies:\n\n| Library | Minimum version | Description |\n| ------- | --------------: | ----------- |\n| [Abseil][abseil-gh] | 20200923 | C++ components to augment the standard library |\n| [Boost][boost-org] | 1.73 | Peer-reviewed portable C++ libraries |\n| [nlohmann/json][nlohmann-json-gh] | 3.9.1 | JSON for Modern C++ |\n\nThe examples use additional libraries, note that these libraries may have their\nown dependencies:\n\n| Library | Minimum version | Description |\n| ------- | --------------: | ----------- |\n| [google-cloud-cpp][google-cloud-cpp-gh] | 1.23.0 | Google Cloud C++ Client Libraries |\n| [{fmt}][fmt-gh] | 7.1.3 | A formatting library |\n\n## Public API and API Breaking Changes\n\nIn general, we avoid making backwards incompatible changes to our C++ APIs (see\nbelow for the definition of \"API\"). Sometimes such changes yield benefits to\nour customers, in the form of better performance, easier-to-understand APIs,\nand/or more consistent APIs across services. When these benefits warrant it, we\nwill announce these changes prominently in our `CHANGELOG.md` file and in the\naffected release's notes. Nevertheless, though we take commercially reasonable\nefforts to prevent this, it is possible that backwards incompatible changes go\nundetected and, therefore, undocumented. We apologize if this is the case and\nwelcome feedback (or bug reports) to rectify the problem.\n\nBy \"API\" we mean the C++ API exposed by public header files in this repo. We\nare not talking about the gRPC or REST APIs exposed by Google Cloud servers. We\nare also talking only about A**P**I stability -- the ABI is subject to change\nwithout notice. You should not assume that binary artifacts (e.g. static\nlibraries, shared objects, dynamically loaded libraries, object files) created\nwith one version of the library are usable with newer/older versions of the\nlibrary. The ABI may, and does, change on \"minor revisions\", and even patch\nreleases.\n\nWe request that our customers adhere to the following guidelines to avoid\naccidentally depending on parts of the library we do not consider to be part of\nthe public API and therefore may change (including removal) without notice:\n\n* You should only include headers matching the `google/cloud/functions/*.h`,\n  or `google/cloud/functions/mock/*.h` patterns.\n* You should **NOT** directly include headers in any subdirectories, such as\n  `google/cloud/functions/internal`.\n* The files *included from* our public headers are **not part of our public\n  API**. Depending on indirect includes may break your build in the future, as\n  we may change a header \"foo.h\" to stop including \"bar.h\" if \"foo.h\" no longer\n  needs the symbols in \"bar.h\". To avoid having your code broken, you should\n  directly include the public headers that define all the symbols you use (this\n  is sometimes known as\n  [include-what-you-use](https://include-what-you-use.org/)).\n* Any file or symbol that lives within a directory or namespace containing\n  \"internal\", \"impl\", \"test\", \"detail\", \"benchmark\", \"sample\", or \"example\", is\n  explicitly **not part of our public API**.\n* Any file or symbol with \"Impl\" or \"impl\" in its name is **not part of our\n  public API**.\n\nPrevious versions of the library will remain available on the\n[GitHub Releases page][github-releases].\n\n## Beyond the C++ API\n\nApplications developers interact with a C++ library through more than just\nthe C++ symbols and headers. They also need to reference the name of the\nlibrary in their build scripts. Depending of the build system they use\nthis may be a CMake target, a Bazel rule, a pkg-config module, or just the\nname of some object in the file system.\n\nAs with the C++ API, we try to avoid breaking changes to these interface\npoints. Sometimes such changes yield benefits to our customers, in the form of\neasier-to-understand what names go with services, or more consistency\nacross services. When these benefits warrant it, we will announce these changes\nprominently in our `CHANGELOG.md` file and in the affected release's notes.\nNevertheless, though we take commercially reasonable efforts to prevent this,\nit is possible that backwards incompatible changes go undetected and,\ntherefore, undocumented. We apologize if this is the case and welcome feedback\n(or bug reports) to rectify the problem.\n\n### Experimental Libraries\n\nFrom time to time we add libraries to `functions-framework-cpp` to validate\nnew  designs, expose experimental (or otherwise not generally available)\nfeatures, or simply because a library is not yet complete. Such libraries\nwill have `experimental` in their CMake target and Bazel rule. The README\nfile for these libraries will also document that they are experimental.\nSuch libraries are subject to change, including removal, without notice.\nThis includes, but it is not limited to, all their symbols, pre-processor\nmacros, files, targets, rules, and installed artifacts.\n\n### CMake targets and packages\n\nOnly CMake packages starting with the `functions_framework_cpp_` prefix are\nintended for customer use. Only targets starting with\n`functions-framework-cpp::` are intended for customer use. Experimental targets\nhave `experimental` in their name (e.g.\n`functions-framework-cpp::experimental-foo`), as previously stated,\nexperimental targets are subject to change or removal without notice.\n\n### pkg-config modules\n\nOnly modules starting with `functions_framework_cpp_` are intended for customer\nuse.\n\n### Unsupported use cases\n\nWe try to provide stable names for the previously described mechanisms:\n\n* CMake targets loaded via `find_package()`,\n* pkg-config modules\n\nIt is certainly possible to use the library through other mechanisms,\nand while these may work, we may accidentally break these from time to time.\nExamples of such, and the recommended alternatives, include:\n\n* CMake's `FetchContent` and/or git submodules: in these approaches the\n  `functions-framework-cpp` library becomes a sub-directory of a larger CMake\n  build. We do not test `functions-framework-cpp` in this configuration, and we\n  find it brittle as **all** CMake targets become visible to the larger\n  project. This is both prone to conflicts, and makes it impossible to enforce\n  that some targets are only for testing or implementation. Applications may\n  want to consider source package managers, such as `vcpkg`, or CMake super\n  builds via `ExternalProject_Add()` as alternatives.\n\n* Using library names directly: applications should not use the\n  library names, e.g., by using `-lfunctions_framework_cpp` in build scripts. We\n  may need to split or merge libraries over time, making such names unstable.\n  Applications should use CMake targets, e.g.,\n  `functions-framework-cpp::framework`, or pkg-config modules, e.g.,\n  `$(pkg-config functions_framework_cpp --libs)`.\n\n### Documentation and Comments\n\nThe documentation (and its links) is intended for human consumption and not\nthird party websites, or automation (such as scripts scrapping the contents).\nThe contents and links of our documentation may change without notice.\n\n### Other Interface Points\n\nWe think this covers all interface points, if we missed something please\nfile a [GitHub issue][github-issue].\n\n## Contributing changes\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md) for details on how to contribute to\nthis project, including how to build and test your changes as well as how to\nproperly format your code.\n\n## Licensing\n\nApache 2.0; see [`LICENSE`](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Ffunctions-framework-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglecloudplatform%2Ffunctions-framework-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Ffunctions-framework-cpp/lists"}