-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9a8342
commit 69db8cd
Showing
19 changed files
with
187 additions
and
172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ corpus | |
artifacts | ||
coverage | ||
|
||
# OCI | ||
junit.xml | ||
report.html | ||
|
||
# Nix | ||
result | ||
result-dev | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# `hyper` example | ||
|
||
This is a mini implementation of an [Open Container Initiative (OCI) Distribution Specification](https://github.com/opencontainers/distribution-spec/blob/main/spec.md) registry. | ||
|
||
## Inspirations: | ||
- https://github.com/mcronce/oci-registry | ||
- https://github.com/Trow-Registry/trow |
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,32 @@ | ||
#![allow(clippy::unused_async)] | ||
|
||
use bytes::Bytes; | ||
use http_body_util::combinators::BoxBody; | ||
use hyper::Response; | ||
use index::index_route; | ||
use std::{convert::Infallible, future::Future, pin::Pin, sync::Arc}; | ||
use wayfind::{errors::InsertError, Parameter, Router}; | ||
|
||
pub mod index; | ||
|
||
type BoxFuture<'a> = Pin< | ||
Box< | ||
dyn Future<Output = Result<Response<BoxBody<Bytes, Infallible>>, anyhow::Error>> | ||
+ Send | ||
+ 'a, | ||
>, | ||
>; | ||
|
||
type HandlerFn = | ||
Arc<dyn for<'a> Fn(&'a str, &'a [Parameter<'_, 'a>]) -> BoxFuture<'a> + Send + Sync>; | ||
|
||
pub fn router() -> Result<Router<HandlerFn>, InsertError> { | ||
let mut router: Router<HandlerFn> = Router::new(); | ||
|
||
router.insert( | ||
"/", | ||
Arc::new(move |path, parameters| Box::pin(index_route(path, parameters))), | ||
)?; | ||
|
||
Ok(router) | ||
} |
Oops, something went wrong.