...
 
Commits (3)
......@@ -497,7 +497,13 @@ boost_library(
name = "iterator",
hdrs = [
"boost/function_output_iterator.hpp",
"boost/generator_iterator.hpp",
"boost/indirect_reference.hpp",
"boost/iterator_adaptors.hpp",
"boost/next_prior.hpp",
"boost/pointee.hpp",
"boost/shared_container_iterator.hpp",
],
deps = [
":detail",
......@@ -1045,6 +1051,12 @@ boost_library(
":tuple",
":type_traits",
],
defines = [
"BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION",
"BOOST_THREAD_PROVIDES_EXECUTORS",
"BOOST_THREAD_PROVIDES_FUTURE",
],
)
boost_library(
......
......@@ -18,7 +18,9 @@ cc_library(
"-DNO_SSL",
"-DNO_FILES",
],
linkopts = ["-pthread"],
strip_include_prefix = 'include',
textual_hdrs = [
......
SBASE = 'Release/src'
HBASE = 'Release/include'
licenses(['notice'])
cc_library(
name='stdafx',
hdrs=[SBASE + '/pch/stdafx.h'],
srcs=[SBASE + '/pch/stdafx.h'],
strip_include_prefix=SBASE + '/pch')
cc_library(
name='cpprestsdk',
srcs=glob(
[
SBASE + '/**/*.cpp',
SBASE + '/**/*.h',
HBASE + '/**/*.h',
],
exclude=[
SBASE + '/pplx/pplxapple.cpp',
SBASE + '/pplx/pplxwin.cpp',
SBASE + '/streams/fileio_winrt.cpp',
SBASE + '/streams/fileio_win32.cpp',
SBASE + '/http/listener/http_server_httpsys.cpp',
SBASE + '/http/client/http_client_winrt.cpp',
SBASE + '/http/client/http_client_winhttp.cpp',
SBASE + '/websockets/**',
]),
hdrs=glob([
HBASE + '/pplx/*.h',
HBASE + '/cpprest/**/*.h*',
HBASE + '/cpprest/**/*.hpp*',
HBASE + '/cpprest/**/*.dat*',
]),
strip_include_prefix=HBASE,
linkopts=['-lcrypto', '-lssl'],
deps=[
':stdafx',
'@boost//:system',
'@boost//:regex',
'@boost//:filesystem',
'@boost//:chrono',
'@boost//:atomic',
'@boost//:asio',
'@boost//:thread',
'@boost//:random',
],
visibility=['//visibility:public'])
licenses(['restricted'])
cc_library(
name='influxdb_cpp_rest',
deps=[
'@cpprestsdk//:cpprestsdk',
'@fmtlib//:fmt',
'@rxcpp//:rxcpp',
],
hdrs=glob(['src/influxdb-cpp-rest/*.h']),
srcs=glob([
'src/influxdb-cpp-rest/*.cpp',
'src/influxdb-cpp-rest/*.h',
]),
includes=['src/influxdb-cpp-rest/'],
strip_include_prefix='src/influxdb-cpp-rest/',
include_prefix='influxdb',
visibility=['//visibility:public'])
licenses(["notice"]) # BSD license
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
cc_proto_library(
name = "prometheus_client_model",
srcs = ["metrics.proto"],
default_runtime = "@com_google_protobuf//:protobuf",
protoc = "@com_google_protobuf//:protoc",
visibility = ["//visibility:public"],
)
cc_library(
name = "prometheus_cpp",
srcs = [
"lib/check_names.cc",
"lib/counter.cc",
"lib/counter_builder.cc",
"lib/exposer.cc",
"lib/gauge.cc",
"lib/gauge_builder.cc",
"lib/handler.cc",
"lib/handler.h",
"lib/histogram.cc",
"lib/histogram_builder.cc",
"lib/registry.cc",
"lib/summary.cc",
"lib/summary_builder.cc",
"lib/text_serializer.cc",
],
hdrs = glob(
["include/prometheus/*.h"],
),
linkstatic = 1,
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"@civetweb//:civetweb",
"@com_google_protobuf//:protobuf",
],
)
\ No newline at end of file
......@@ -17,19 +17,6 @@ def load_gtest():
"58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8",
build_file="@rules_iota//:build/BUILD.gtest")
def load_influxdb_cpp_rest():
native.new_http_archive(
name="influxdb_cpp_rest",
url=
"https://github.com/d-led/influxdb-cpp-rest/archive/50f597b2fbfa361dede850d4d54288f1c40c6f74.zip",
strip_prefix=
"influxdb-cpp-rest-50f597b2fbfa361dede850d4d54288f1c40c6f74",
sha256=
"a6f3508d24ead6c92e54f87d117a73ee056e971d08d0ead9a1846c1d3247d250",
build_file="@rules_iota//:build/BUILD.influxdb-cpp-rest")
def load_glog():
native.new_http_archive(
name="glog",
......@@ -64,10 +51,10 @@ def load_libsodium():
def load_libzmq():
native.new_http_archive(
name="libzmq",
url="https://github.com/zeromq/libzmq/archive/v4.2.2.tar.gz",
strip_prefix="libzmq-4.2.2",
url="https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz",
strip_prefix="libzmq-4.2.5",
sha256=
"ea5eecbb9cc231a750535a7b74f887b18656014cc92601e8ab34734db799b796",
"f33807105ce47f684c26751ce4e27a708a83ce120cbabbc614c8df21252b238c",
build_file="@rules_iota//:build/BUILD.libzmq")
......@@ -84,40 +71,19 @@ def load_cppzmq():
def load_fmtlib():
native.new_http_archive(
name="fmtlib",
url="https://github.com/fmtlib/fmt/archive/4.0.0.tar.gz",
strip_prefix="fmt-4.0.0",
url="https://github.com/fmtlib/fmt/archive/5.0.0.tar.gz",
strip_prefix="fmt-5.0.0",
sha256=
"35300a0d356529447a79ed5ccf419239d8b34f916e5d4625f046fd37afa3650a",
"fc33d64d5aa2739ad2ca1b128628a7fc1b7dca1ad077314f09affc57d59cf88a",
build_file="@rules_iota//:build/BUILD.fmt")
def load_cpprestsdk():
native.new_http_archive(
name="cpprestsdk",
url="https://github.com/Microsoft/cpprestsdk/archive/v2.10.0.tar.gz",
strip_prefix="cpprestsdk-2.10.0",
sha256=
"de333da67f1cb3d1b30be118860531092467f18d24ca6b4d36f6623fecab0de0",
build_file="@rules_iota//:build/BUILD.cpprestsdk")
def load_nanomsg():
native.new_http_archive(
name="nanomsg",
url="https://github.com/nanomsg/nanomsg/archive/1.1.2.tar.gz",
strip_prefix="nanomsg-1.1.2",
sha256=
"3c52165a735c2fb597d2306593ae4b17900688b90113d4115ad8480288f28ccb",
build_file="@rules_iota//:build/BUILD.nanomsg")
def load_unity():
native.new_http_archive(
name="unity",
url="https://github.com/ThrowTheSwitch/Unity/archive/v2.4.2.tar.gz",
strip_prefix="Unity-2.4.2",
url="https://github.com/ThrowTheSwitch/Unity/archive/v2.4.3.tar.gz",
strip_prefix="Unity-2.4.3",
sha256=
"633bda7e0bd298aac404e50f6189a29213f3edf61657dda125409ad35290a603",
"a8c5e384f511a03c603bbecc9edc24d2cb4a916998d51a29cf2e3a2896920d03",
build_file="@rules_iota//:build/BUILD.unity")
......@@ -153,25 +119,14 @@ def load_civetweb():
build_file="@rules_iota//:build/BUILD.civetweb")
def load_prometheus_client_model():
native.new_http_archive(
name="prometheus_client_model",
url=
"https://github.com/prometheus/client_model/archive/99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c.zip",
strip_prefix="client_model-99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c",
sha256=
"799ba403fa3879fcb60d6644d7583bd01cb3a4927c442211783c07f59ff99450",
build_file="@rules_iota//:build/BUILD.prometheus_client_model")
def load_com_google_protobuf():
native.http_archive(
name="com_google_protobuf",
sha256=
"8e0236242106e680b4f9f576cc44b8cd711e948b20a9fc07769b0a20ceab9cc4",
strip_prefix="protobuf-3.4.1",
"826425182ee43990731217b917c5c3ea7190cfda141af4869e6d4ad9085a740f",
strip_prefix="protobuf-3.5.1",
urls=[
"https://github.com/google/protobuf/archive/v3.4.1.tar.gz",
"https://github.com/google/protobuf/archive/v3.5.1.tar.gz",
], )
......@@ -179,20 +134,20 @@ def load_prometheus_cpp():
native.http_archive(
name="prometheus_cpp",
url=
"https://github.com/th0br0/prometheus-cpp/archive/11057d8cc5618ee7f1e77051dcd67d7d8255c13a.zip",
strip_prefix="prometheus-cpp-11057d8cc5618ee7f1e77051dcd67d7d8255c13a",
"https://github.com/jupp0r/prometheus-cpp/archive/6f7d712eba93f807cca58d144f525ac53147a234.zip",
strip_prefix="prometheus-cpp-6f7d712eba93f807cca58d144f525ac53147a234",
sha256=
"63d8be02166ed2ca520750e414146bf3727872a63194ddbe803585b456b618e4")
"42f4854c83aad5d6688f130375d55bb14e000062c541050c58ba533d5aedb8ee")
def load_yaml_cpp():
native.new_http_archive(
name="yaml_cpp",
url=
"https://github.com/jbeder/yaml-cpp/archive/5d5bb52ec2825eb4c0c932a9c2d50dc3699f932f.zip",
strip_prefix="yaml-cpp-5d5bb52ec2825eb4c0c932a9c2d50dc3699f932f",
"https://github.com/jbeder/yaml-cpp/archive/4fb1c4b92bf8d94b32ebccdd890407d45b3bc794.zip",
strip_prefix="yaml-cpp-4fb1c4b92bf8d94b32ebccdd890407d45b3bc794",
sha256=
"107a0c0711ba2d57e3e8acb148974e8b9c15f3bdc13d88de70dbb21e377a35ab",
"e434837d4eb49832fa982c111c7da4e3c9c2b8d5627736f295dd129199559f42",
build_file="@rules_iota//:build/BUILD.yaml_cpp")
......@@ -212,25 +167,24 @@ def load_libcuckoo():
native.new_http_archive(
name="libcuckoo",
url=
"https://github.com/efficient/libcuckoo/archive/1156aa8b1076da9931409b9d409d8edb377b50f3.zip",
strip_prefix="libcuckoo-1156aa8b1076da9931409b9d409d8edb377b50f3",
"https://github.com/efficient/libcuckoo/archive/6591795a944fa8c7268848d181ba2852f4a7897f.zip",
strip_prefix="libcuckoo-6591795a944fa8c7268848d181ba2852f4a7897f",
build_file="@rules_iota//:build/BUILD.libcuckoo",
sha256=
"9571b74f00436f86d8baed0c439a7331fb8e1ce5880617200a9f443aef28761b")
"c31f300fe33a5668528027174150715b238c96f9e9a77cd1d933d7ba43480452")
def load_cjson():
native.new_http_archive(
name="cJSON",
url="https://github.com/DaveGamble/cJSON/archive/v1.7.4.tar.gz",
strip_prefix="cJSON-1.7.4",
url="https://github.com/DaveGamble/cJSON/archive/v1.7.7.tar.gz",
strip_prefix="cJSON-1.7.7",
sha256=
"c3fc800cf9106db4ef5a5ef1fba7d144b21d73b68ad78234e182ebab12079277",
"6eb9d852a97ffbe149e747f54d63e39a674fa248bb24902a14c079803067949a",
build_file="@rules_iota//:build/BUILD.cJSON")
def iota_cpp_repositories():
load_cpprestsdk()
load_fmtlib()
load_cppzmq()
load_libzmq()
......@@ -239,13 +193,10 @@ def iota_cpp_repositories():
load_glog()
load_gtest()
load_gflags()
load_influxdb_cpp_rest()
load_nanomsg()
load_unity()
load_yaml()
load_rb_tree()
load_com_google_protobuf()
load_prometheus_client_model()
load_civetweb()
load_prometheus_cpp()
load_yaml_cpp()
......
cc_test(name="nanomsg_test",
size="small",
srcs=["nanomsg_test.c"],
deps=["@nanomsg//:nanomsg"])
cc_test(name="yaml_test",
size="small",
srcs=["yaml_test.c"],
......@@ -23,11 +18,6 @@ cc_test(name="prometheus_test",
srcs=["prometheus_test.cc"],
deps=["@prometheus_cpp//:prometheus_cpp"])
cc_test(name="cpprestsdk_test",
size="small",
srcs=["cpprestsdk_test.cc"],
deps=["@cpprestsdk//:cpprestsdk"])
cc_test(name="sodium_test",
srcs=glob(['sodium/*.c', 'sodium/*.h', 'sodium/*.exp']),
deps=["@libsodium//:sodium"])
......
/***
* Copyright (C) Microsoft. All rights reserved.
* Licensed under the MIT license.
* See https://raw.githubusercontent.com/Microsoft/cpprestsdk/master/license.txt
*
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* bingrequest.cpp - Simple cmd line application that makes an HTTP GET request to bing searching and outputting
* the resulting HTML response body into a file.
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
using namespace utility;
using namespace web::http;
using namespace web::http::client;
using namespace concurrency::streams;
/* Can pass proxy information via environment variable http_proxy.
Example:
Linux: export http_proxy=http://192.1.8.1:8080
*/
web::http::client::http_client_config client_config_for_proxy()
{
web::http::client::http_client_config client_config;
#ifdef _WIN32
wchar_t* pValue = nullptr;
std::unique_ptr<wchar_t, void(*)(wchar_t*)> holder(nullptr, [](wchar_t* p) { free(p); });
size_t len = 0;
auto err = _wdupenv_s(&pValue, &len, L"http_proxy");
if (pValue)
holder.reset(pValue);
if (!err && pValue && len) {
std::wstring env_http_proxy_string(pValue, len - 1);
#else
if(const char* env_http_proxy = std::getenv("http_proxy")) {
std::string env_http_proxy_string(env_http_proxy);
#endif
if (env_http_proxy_string == U("auto"))
client_config.set_proxy(web::web_proxy::use_auto_discovery);
else
client_config.set_proxy(web::web_proxy(env_http_proxy_string));
}
return client_config;
}
#ifdef _WIN32
int wmain(int argc, wchar_t *args[])
#else
int main(int argc, char *args[])
#endif
{
const string_t searchTerm = "foo";
http_client client(U("http://www.bing.com/"), client_config_for_proxy());
client.request(methods::GET, uri_builder(U("/search")).append_query(U("q"), searchTerm).to_string())
// Write the response body into the file buffer.
.then([=](http_response response) -> int
{
printf("Response status code %u returned.\n", response.status_code());
return 0;
});
return 0;
}
#include <stdio.h>
#include <string.h>
#include <nanomsg/nn.h>
#include <nanomsg/pipeline.h>
int main(const int argc, const char **argv) {
int sock = nn_socket(AF_SP, NN_PUSH);
nn_shutdown(sock, 0);
return 0;
}