Skip to content

Commit cac6ed7

Browse files
Add Vercel ingress skeleton and fix lint violations.
1 parent e2763e2 commit cac6ed7

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

src/adapters/ingresses/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub trait Ingress: Shutdownable {
4747

4848
mod apig;
4949
mod cloudflare;
50+
mod vercel;
5051

5152
#[cfg(test)]
5253
mod tests {

src/adapters/ingresses/vercel.rs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#![allow(dead_code)]
2+
// This will not be dead once we plug it into a the Platform.
3+
4+
use crate::{
5+
Shutdownable, WholePercent, adapters::backend::IngressConfig, subsystems::ShutdownResult,
6+
};
7+
8+
use super::Ingress;
9+
use async_trait::async_trait;
10+
use derive_getters::Getters;
11+
use miette::Result;
12+
13+
// Placeholder: we know we need a Vercel HTTP client here,
14+
// but we don't have one in place just yet.
15+
#[allow(dead_code)]
16+
type VercelClient = ();
17+
18+
#[allow(dead_code)]
19+
#[derive(Getters)]
20+
pub struct Vercel {
21+
client: VercelClient,
22+
}
23+
24+
impl Vercel {
25+
pub fn new(client: VercelClient) -> Self {
26+
Self { client }
27+
}
28+
}
29+
30+
#[async_trait]
31+
impl Ingress for Vercel {
32+
fn get_config(&self) -> IngressConfig {
33+
todo!();
34+
}
35+
36+
async fn release_canary(
37+
&mut self,
38+
baseline_version_id: String,
39+
canary_version_id: String,
40+
) -> Result<()> {
41+
let _ = baseline_version_id;
42+
let _ = canary_version_id;
43+
todo!();
44+
}
45+
46+
async fn set_canary_traffic(&mut self, percent: WholePercent) -> Result<()> {
47+
let _ = percent;
48+
todo!();
49+
}
50+
51+
async fn rollback_canary(&mut self) -> Result<()> {
52+
todo!();
53+
}
54+
55+
async fn promote_canary(&mut self) -> Result<()> {
56+
todo!();
57+
}
58+
}
59+
60+
#[async_trait]
61+
impl Shutdownable for Vercel {
62+
async fn shutdown(&mut self) -> ShutdownResult {
63+
todo!();
64+
}
65+
}

0 commit comments

Comments
 (0)