-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Xudong Sun <[email protected]>
- Loading branch information
1 parent
55aead4
commit 701a508
Showing
12 changed files
with
569 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2022 VMware, Inc. | ||
// SPDX-License-Identifier: MIT | ||
use crate::reconciler::exec::io::{VoidEReq, VoidEResp}; | ||
|
||
// A trait for the external api of a reconciler, whose core is a transition method, and the developer should wrap all | ||
// possible operations they may need in the function. | ||
// Input is the input type of the external api and also the ? of Request<?> of the reconciler, i.e., it completes the | ||
// request type of a reconciler. | ||
// Similarly, Output is the output type of the external api, which composes the Response<?> type of a reconciler. | ||
// Note that we can encapsulate all the required libraries here, so each reconciler only has one ExternalAPI type. | ||
pub trait ExternalShimLayer<EReq, EResp> { | ||
fn external_call(req: EReq) -> EResp; | ||
} | ||
|
||
// An empty library that implements External Library. | ||
// This can be used by those controllers that don't rely on a third-party library. | ||
pub struct VoidExternalShimLayer {} | ||
|
||
impl ExternalShimLayer<VoidEReq, VoidEResp> for VoidExternalShimLayer { | ||
fn external_call(_input: VoidEReq) -> VoidEResp { | ||
panic!("This should not be visited"); | ||
} | ||
} |
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
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
Oops, something went wrong.