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

[kawaii] nested namespaces #16

Open
olivedae opened this issue Aug 18, 2016 · 0 comments
Open

[kawaii] nested namespaces #16

olivedae opened this issue Aug 18, 2016 · 0 comments

Comments

@olivedae
Copy link
Owner

Allow namespaces (and it's accompanying path) to be defined along with related details (e.g. routes and/or nested namespaces).

The 可愛い!(scaffold <etc>) was meant to support nesting due to rustless implementing Nesting and ApiHandler for both Api and Namespace.

A rough example is given below (does include dependency injection).

fn test<'a>(client: Client<'a>, example: String) -> Response<'a> {
    // ...
}

fn other_test<'a>(client: Client<'a>) -> Response<'a> {
    // ...
}

fn main() {
    let application = 
         可愛い!(
             namespace (first/example:string) [
                 get (one) -> test;
                 get (two) -> test;
             ]
             namespace (second/example) [
                 get (one) -> other_test;   
             ]
             get (last/example:string) -> test;
         );

    // ...
}

To be honest, I'm not a huge fan of the brackets but there needs to be some way to tell when the current namespace ends.

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

No branches or pull requests

1 participant