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

Split / move restutil module #340

Merged
merged 2 commits into from
Oct 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/vibe/core/concurrency.d
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ private struct IsolatedRef(T)
#line 1 "isolatedAggregateMethodsString"
mixin(isolatedAggregateMethodsString!T());
#line 336 "source/vibe/concurrency.d"
static assert(__LINE__ == 1336);
static assert(__LINE__ == 336);

@disable this(this);

Expand Down
9 changes: 5 additions & 4 deletions source/vibe/http/rest.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
*/
module vibe.http.rest;

import vibe.http.restutil;

import vibe.core.log;
import vibe.data.json;
import vibe.http.client;
import vibe.http.router;
import vibe.inet.url;
import vibe.textfilter.urlencode;
import vibe.utils.string;
import vibe.utils.meta.all;

import std.algorithm : filter;
import std.array;
import std.conv;
import std.exception;
import std.string;
import std.traits;
import std.typecons;
import std.typetuple;

/**
Generates registers a REST interface and connects it the the given instance.
Expand Down Expand Up @@ -133,7 +134,7 @@ void registerRestInterface(TImpl)(URLRouter router, TImpl instance, string urlPr
logDebug("REST route: %s %s %s", httpVerb, url, params.filter!(p => !p.startsWith("_") && p != "id")().array());
}

alias T = reduceToInterface!TImpl;
alias T = baseInterface!TImpl;

foreach( method; __traits(allMembers, T) ) {
foreach( overload; MemberFunctionsTuple!(T, method) ) {
Expand Down Expand Up @@ -175,7 +176,7 @@ void registerRestInterface(TImpl)(URLRouter router, TImpl instance, string urlPr
/// ditto
void registerRestInterface(TImpl)(URLRouter router, TImpl instance, MethodStyle style = MethodStyle.lowerUnderscored)
{
alias T = reduceToInterface!TImpl;
alias T = baseInterface!TImpl;
enum uda = extractUda!(RootPath, T);
static if (is(typeof(uda) == typeof(null)))
registerRestInterface!T(router, instance, "/", style);
Expand Down
Loading