Skip to content

Commit

Permalink
Add Promise support for http callout
Browse files Browse the repository at this point in the history
fix licenses and bazel (maybe)

Signed-off-by: jizhuozhi.george <jizhuozhi.george@bytedance.com>
  • Loading branch information
jizhuozhi committed Oct 19, 2024
1 parent dc6e39f commit d797999
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cargo_build_script(

rust_library(
name = "proxy_wasm",
srcs = glob(["src/*.rs"]),
srcs = glob(["src/*.rs", "src/callout/*.rs"]),
edition = "2018",
visibility = ["//visibility:public"],
deps = [
Expand Down
14 changes: 14 additions & 0 deletions src/callout/http.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License 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.

use crate::callout::promise::Promise;
use crate::hostcalls;
use std::collections::HashMap;
Expand Down
14 changes: 14 additions & 0 deletions src/callout/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License 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.

pub mod http;
pub mod promise;
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod allocator;
pub mod callout;
mod dispatcher;
pub mod hostcalls;
mod logger;
pub mod traits;
pub mod types;

mod allocator;
mod dispatcher;
mod logger;

// For crate-type="cdylib".
#[cfg(not(wasi_exec_model_reactor))]
#[macro_export]
Expand Down

0 comments on commit d797999

Please sign in to comment.