Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTP API to Plane controller #434

Conversation

paulgb
Copy link
Member

@paulgb paulgb commented Aug 17, 2023

This implements an HTTP API that is a subset of the NATS API. It aims for compatibility with jamsocket.com, so that jamsocket users can test locally with Plane.

@vercel
Copy link

vercel bot commented Aug 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
plane ⬜️ Ignored (Inspect) Visit Preview Aug 18, 2023 6:15pm

@paulgb paulgb requested a review from rolyatmax August 17, 2023 12:04
cluster: ClusterName,
image: String,
) -> Result<ScheduleRequest> {
let max_idle_secs = Duration::from_secs(self.grace_period_seconds.unwrap_or_else(|| 600));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unwrap_or should be fine here, also would be good to put this in a const at the the top of the file.


impl HttpSpawnRequest {
pub fn into_spawn_request(
&self,
Copy link
Contributor

@pretentious7 pretentious7 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either call this as_* (is that what it wants?) or silence the clippy complaint by turning off wrong_self_convention

let service = server_state
.services
.get(&service)
.ok_or_else(|| StatusCode::NOT_FOUND)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fine to use ok_or here too

Copy link
Contributor

@pretentious7 pretentious7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some clippy stuff, looks great otherwise!

@paulgb paulgb merged commit 8afdb7d into main Aug 18, 2023
5 checks passed
@paulgb paulgb deleted the paul/dis-1221-add-a-jamsocket-compatible-http-server-to-plane-controller branch August 18, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants