Skip to content

Commit

Permalink
Working on http
Browse files Browse the repository at this point in the history
  • Loading branch information
UIMSolutions committed Dec 28, 2024
1 parent 6fa2e18 commit fa19a8b
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 62 deletions.
2 changes: 1 addition & 1 deletion collections/uim/collections/exceptions/exception.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class DCollectionsException : UIMException {
mixin(ExceptionCalls!("Collections"));

unittest {
testException(new D_CollectionsException);
testException(new DCollectionsException);
}
6 changes: 6 additions & 0 deletions http/uim/http/interfaces/stream.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module uim.http.interfaces.stream;

import uim.http;

@safe:
interface IStream {}
6 changes: 6 additions & 0 deletions http/uim/http/interfaces/table.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module uim.http.interfaces.table;

import uim.http;

@safe:
interface IHTTPTable {}
6 changes: 6 additions & 0 deletions http/uim/http/interfaces/uploadedfile.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module uim.http.interfaces.uploadedfile;

import uim.http;

@safe:
interface IUploadedFile {}
9 changes: 9 additions & 0 deletions http/uim/http/interfaces/uri.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module uim.http.interfaces.uri;

import uim.http;

@safe:

interface IUri {

}
18 changes: 9 additions & 9 deletions http/uim/http/mixins/middleware.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
* License: Subject to the terms of the Apache 2.0 license, as written in the included LICENSE.txt file. *
* Authors: Ozan Nurettin Süel (aka UIManufaktur) *
*****************************************************************************************************************/
module uim.http.mixins.middleware;
module uim.http.mixins.httpmiddleware;

import uim.http;
@safe:

string middlewareThis(string name = null) {
string fullName = name ~ "Middleware";
string httpMiddlewareThis(string name = null) {
string fullName = name ~ "HTTPMiddleware";
return objThis(fullName);
}

template MiddlewareThis(string name = null) {
const char[] MiddlewareThis = middlewareThis(name);
template HTTPMiddlewareThis(string name = null) {
const char[] HTTPMiddlewareThis = httpMiddlewareThis(name);
}

string middlewareCalls(string name) {
string fullName = name ~ "Middleware";
string httpMiddlewareCalls(string name) {
string fullName = name ~ "HTTPMiddleware";
return objCalls(fullName);
}

template MiddlewareCalls(string name) {
const char[] MiddlewareCalls = middlewareCalls(name);
template HTTPMiddlewareCalls(string name) {
const char[] HTTPMiddlewareCalls = httpMiddlewareCalls(name);
}
1 change: 1 addition & 0 deletions http/uim/http/mixins/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public {
import uim.http.mixins.middleware;
import uim.http.mixins.request;
import uim.http.mixins.response;
import uim.http.mixins.session;
}
27 changes: 27 additions & 0 deletions http/uim/http/mixins/session.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/****************************************************************************************************************
* Copyright: © 2017-2024 Ozan Nurettin Süel (aka UIManufaktur) *
* License: Subject to the terms of the Apache 2.0 license, as written in the included LICENSE.txt file. *
* Authors: Ozan Nurettin Süel (aka UIManufaktur) *
*****************************************************************************************************************/
module uim.http.mixins.session;

import uim.http;
@safe:

string sessionThis(string name = null) {
string fullName = name ~ "Session";
return objThis(fullName);
}

template SessionThis(string name = null) {
const char[] SessionThis = sessionThis(name);
}

string sessionCalls(string name) {
string fullName = name ~ "Session";
return objCalls(fullName);
}

template SessionCalls(string name) {
const char[] SessionCalls = sessionCalls(name);
}
25 changes: 15 additions & 10 deletions jsonbases/dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
"fileVersion": 1,
"versions": {
"colored": "0.0.31",
"diet-ng": "1.8.1",
"eventcore": "0.9.26",
"diet-ng": "1.8.2",
"eventcore": "0.9.35",
"libasync": "0.8.6",
"memutils": "1.0.9",
"mir-linux-kernel": "1.0.1",
"openssl": "3.3.3",
"openssl-static": "1.0.2+3.0.8",
"mir-linux-kernel": "1.2.1",
"openssl": "3.3.4",
"openssl-static": "1.0.5+3.0.8",
"silly": "1.1.1",
"stdx-allocator": "2.77.5",
"taggedalgebraic": "0.11.22",
"unit-threaded": "2.1.7",
"vibe-container": "1.0.0",
"vibe-core": "2.4.0",
"vibe-d": "0.9.7"
"taggedalgebraic": "0.11.23",
"uim": {"path":"../"},
"unit-threaded": "2.1.9",
"vibe-container": "1.4.0",
"vibe-core": "2.9.6",
"vibe-d": "0.10.1",
"vibe-http": "1.2.1",
"vibe-inet": "1.1.0",
"vibe-serialization": "1.0.7",
"vibe-stream": "1.1.1"
}
}
22 changes: 11 additions & 11 deletions jsonbases/uim/jsonbases/classes/collections/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ class DMemoryJsonCollection : DJsonCollection {
version (test_uim_jsonbase) {
unittest {

auto col = MemoryJsonCollection;
/* auto col = MemoryJsonCollection;
assert(test_removeMany_id(col));
assert(test_removeMany_id_allVersions(col));
assert(test_removeMany_id_allVersions(col)); */
}
}

Expand All @@ -274,12 +274,12 @@ class DMemoryJsonCollection : DJsonCollection {

foreach (id, itemId; _items) {
if (allVersions) {
foreach (vNumber, item; itemId) {
if (checkVersion(item, select)) {
counter++;
_items[id].removeKey(vNumber);
}
}
itemId.byKeyValue
.filter!(versItem => checkVersion(versItem.value, select))
.each!((versItem) {
counter++;
_items[id].removeKey(versItem.key);
});
} else {
if (auto item = lastVersion(itemId)) {
if (checkVersion(item, select)) {
Expand All @@ -297,10 +297,10 @@ class DMemoryJsonCollection : DJsonCollection {

version (test_uim_jsonbase) {
unittest {

auto col = MemoryJsonCollection;
// TODO
/* auto col = MemoryJsonCollection;
assert(test_removeMany_select(col));
assert(test_removeMany_select_allVersions(col));
assert(test_removeMany_select_allVersions(col)); */
}
}

Expand Down
50 changes: 20 additions & 30 deletions jsonbases/uim/jsonbases/classes/collections/null_.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ class DNullJsonCollection : DJsonCollection {
return null;
}

version (test_uim_jsonbase) {
unittest {
unittest {

auto col = NullJsonCollection;
assert(!col.findMany(toJson(["name": "aName"])));
assert(!col.findMany(toJson(["name": "aName"]), true));
// TODO
}
// auto col = NullJsonCollection;
// assert(!col.findMany(toJson(["name": "aName"])));
// assert(!col.findMany(toJson(["name": "aName"]), true));
// TODO
}
// #endregion findMany

Expand Down Expand Up @@ -125,14 +123,12 @@ class DNullJsonCollection : DJsonCollection {
return Json(null);
}

version (test_uim_jsonbase) {
unittest {
unittest {

auto col = NullJsonCollection;
/* auto col = NullJsonCollection;
assert(col.findOne(toJson(["name": "aName"])).isEmpty);
assert(col.findOne(toJson(["name": "aName"]), true).isEmpty);
// TODO
}
*/ // TODO
}
// #endregion findOne

Expand All @@ -141,13 +137,11 @@ class DNullJsonCollection : DJsonCollection {
return findOne(newData);
}

version (test_uim_jsonbase) {
unittest {

auto col = NullJsonCollection;
assert(col.insertOne(toJson(["name": "aName"])).isEmpty);
/* auto col = NullJsonCollection;
assert(col.insertOne(toJson(["name": "aName"])).isEmpty); */
// TODO
}
}
// #endregion insertOne

Expand All @@ -156,15 +150,13 @@ class DNullJsonCollection : DJsonCollection {
return 0;
}

version (test_uim_jsonbase) {
unittest {
unittest {

auto col = NullJsonCollection;
/* auto col = NullJsonCollection;
assert(col.updateMany(toJson(["id": randomUUID.toString]), toJson([
"name": "aName"
])) == 0);
// TODO
}
])) == 0); */
// TODO
}
// #endregion updateMany

Expand All @@ -176,10 +168,10 @@ class DNullJsonCollection : DJsonCollection {
version (test_uim_jsonbase) {
unittest {

auto col = NullJsonCollection;
/* auto col = NullJsonCollection;
assert(col.updateOne(toJson(["id": randomUUID.toString]), toJson([
"name": "aName"
])) == 0);
])) == 0); */
// TODO
}
}
Expand Down Expand Up @@ -221,14 +213,12 @@ class DNullJsonCollection : DJsonCollection {
return 0;
}

version (test_uim_jsonbase) {
unittest {

auto col = NullJsonCollection;
/* auto col = NullJsonCollection;
assert(col.removeMany(toJson(["name": "aName"])) == 0);
assert(col.removeMany(toJson(["name": "aName"]), true) == 0);
assert(col.removeMany(toJson(["name": "aName"]), true) == 0); */
// TODO
}
}
// #endregion removeMany

Expand Down Expand Up @@ -283,9 +273,9 @@ class DNullJsonCollection : DJsonCollection {
version (test_uim_jsonbase) {
unittest {

auto col = NullJsonCollection;
/* auto col = NullJsonCollection;
assert(!col.removeOne(toJson(["name": "aName"])));
assert(!col.removeOne(toJson(["name": "aName"]), true));
assert(!col.removeOne(toJson(["name": "aName"]), true)); */
// TODO
}
}
Expand Down
2 changes: 1 addition & 1 deletion jsonbases/uim/jsonbases/classes/tenants/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class DMemoryJsonTenant : DJsonTenant {
mixin(JsonTenantCalls!("Memory"));

unittest {
testTenant(MemoryJsonTenant);
testJsonTenant(MemoryJsonTenant);
}

0 comments on commit fa19a8b

Please sign in to comment.