Skip to content

Commit

Permalink
Added MIT license. More precise documentation for module headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
NCrashed authored and NCrashed committed Mar 12, 2014
1 parent d35f925 commit 40585d8
Show file tree
Hide file tree
Showing 35 changed files with 172 additions and 10 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 DSoftOut Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
34 changes: 34 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
/**
* Application contains four build configurations: production, unittests, integration test 1,
* integration test 2 and test client.
*
* Unittests configuration produce dummy executable the only purpose is to run module unittests.
*
* Production configuration is main and default configuration. There the configuration files and
* argument parameters are parsed, daemon or terminal mode is selected and actual rpc server starts.
*
* Integration test 1 performs simple tests on real PostgreSQL instance. The configuration expects
* '--conn' parameter with valid connection string to test database. The main thing that is tested
* is connection pool operational correctness.
*
* Integration test 2 performs major tests on real PostgreSQL instance. The configuration expects
* '--conn' parameter with valid connection string to test database. There are many tests for
* binary converting from libpq format. This test is the most important one as it should expose
* libp binary format changing while updating to new versions.
*
* Test client is most general integration tests set. First client expects that there is an instance
* of production configuration is running already. The '--host' argument specifies URL the server is
* binded to (usually 'http://localhost:8080). The '--serverpid' argument should hold the server
* process PID to enable automatic server reloading while changing json-rpc table. '--conn' and
* '--tableName' specifies connection string to PostgreSQL and json-rpc table respectively that are
* used in server being tested.
*
* Test client performs automatic rules addition to json-rpc table, testing request sending to
* the production server and checking returned results. Finally test client cleans up used
* testing rules in json-rpc table.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
* Zaramzan <shamyan.roman@gmail.com>
*/
module app;

import stdlog;
Expand Down
2 changes: 2 additions & 0 deletions source/client/client.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* This module defines rpc client class for testing rpc server.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module client.client;
Expand Down
2 changes: 2 additions & 0 deletions source/client/rpcapi.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* This module defines rest api to communicate with rpc server.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module client.rpcapi;
Expand Down
2 changes: 2 additions & 0 deletions source/client/test/simple.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Module describes simple testcases for rpc-server.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module client.test.simple;
Expand Down
2 changes: 2 additions & 0 deletions source/client/test/testcase.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Test case includes json_rpc table row description,
* test params and expected response.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module client.test.testcase;
Expand Down
3 changes: 2 additions & 1 deletion source/daemon.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* fallback to terminal mode.
*
* See_Also: terminal
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*
*/
module daemon;

Expand Down
30 changes: 28 additions & 2 deletions source/db/asyncPool.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
// Written in D programming language
/**
*
* Authors: NCrashed <ncrashed@gmail.com>
* Default implementation of IConnectionPool. It is consists of four worker thread that holding
* corresponding connection lists: closed connections, connecting connections, free connections and
* quering connections.
*
* Closed connections thread accepts connection to a SQL server and waits specified moment to
* start establishing process. All failed connections are passed into the worker to try again
* later.
*
* Connecting connections thread handles connection establishing procedure. Connection establishing
* process is done in asynchronous way (non-blocking polling). All new connections are passed to
* the worker. If connection is failed, it is passed to closed connections thread, else if it successes,
* it is passed to free connections thread.
*
* Free connections thread watch after idle connections. If one want to make a query, pool asks the
* free connections worker for one. If there is no free connection for specified amount of time,
* timeout exception is thrown, else returned connection is binded with transaction information and
* is sent to quering connections worker. Also free connections worker watches after health of each
* connection, if a free connection dies, it is sent to closed connections process to try to open later.
*
* And finally the most interesting one is quering connections worker. The worker accepts all requested
* transaction to be proceeded on a remote SQL server (several connection could be linked to different servers).
* Worker starts the transaction, setups all needed local variables and proceeds all requested commands,
* collects results and transfer them to pool inner queue of finished transactions. Transaction is ended with
* "COMMIT;" before sending connection to free connections worker.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.asyncPool;

Expand Down
7 changes: 5 additions & 2 deletions source/db/connection.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Written in D programming language
/**
*
* Authors: NCrashed <ncrashed@gmail.com>
* Medium sized wrapper around PostgreSQL connection.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.connection;

Expand Down
2 changes: 2 additions & 0 deletions source/db/pool.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* several connections to one or more sql servers. If connection
* is lost, pool tries to reconnect over $(B reconnectTime) duration.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pool;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/api.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* <li>Create layer that can be mocked in purpose of unittesting</li>
* </ul>
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.api;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/connection.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Module describes a real connection to PostgreSQL server.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.connection;
Expand Down
3 changes: 3 additions & 0 deletions source/db/pq/libpq.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* This module defines realization of high-level libpq api.
*
* See_Also: db.pq.api
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.libpq;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL typed arrays binary data format.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.array;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/conv.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Utilities for conversion from PostgreSQL binary format.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.conv;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/geometric.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL geometric types binary format.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.geometric;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/inet.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL network types binary format.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.inet;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/numeric.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL numeric format
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.numeric;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/oids.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL major types oids.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.oids;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/plain.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* PostgreSQL common types binary format.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.plain;
Expand Down
2 changes: 2 additions & 0 deletions source/db/pq/types/test.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Utilities for integration test of binary format conversion.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.test;
Expand Down
3 changes: 3 additions & 0 deletions source/db/pq/types/time.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
* <li>$(B tinterval) - interval between two points in time. Consists of two abstime values: begin and end.
* Correponding D type - $(B PGInterval) wrapper around $(B std.datetime.Interval).</li>
* </ul>
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*/
module db.pq.types.time;
Expand Down
3 changes: 2 additions & 1 deletion source/json_rpc/error.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
* See_Also:
* $(LINK http://www.jsonrpc.org/specification)
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
module json_rpc.error;

Expand Down
2 changes: 2 additions & 0 deletions source/json_rpc/request.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* See_Also:
* $(LINK http://www.jsonrpc.org/specification)
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
Expand Down
2 changes: 2 additions & 0 deletions source/json_rpc/response.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* See_Also:
* $(LINK http://www.jsonrpc.org/specification)
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
Expand Down
2 changes: 2 additions & 0 deletions source/log.d
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
* }
* ---------
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*
*/
Expand Down
3 changes: 2 additions & 1 deletion source/server/cache.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/**
* Caching system
*
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
Expand Down
3 changes: 2 additions & 1 deletion source/server/config.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*
* Ctor $(B AppConfig(string)) create a config from file.
*
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*/
module server.config;
Expand Down
2 changes: 2 additions & 0 deletions source/server/database.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Contains database using logic
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*/
module server.database;
Expand Down
2 changes: 2 additions & 0 deletions source/server/options.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* Module describes application startup options.
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
* NCrashed <ncrashed@gmail.com>
*/
Expand Down
2 changes: 2 additions & 0 deletions source/server/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*
* Contains http logic
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
Expand Down
2 changes: 2 additions & 0 deletions source/server/sql_json.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*
* Loads on SIGHUP or on startup
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: Zaramzan <shamyan.roman@gmail.com>
*
*/
Expand Down
10 changes: 10 additions & 0 deletions source/stdlog.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
* DEALINGS IN THE SOFTWARE.
*/
// This file is written in D programming language
/**
* Default synchronized log realization. The logging process performs
* instantly (if it can be processed properly). Logger puts message
* style string and current timestamp before the message.
*
* Tested to be able operate in daemon mode and under heavy concurrent
* writing.
*
* Authors: NCrashed <ncrashed@gmail.com>
*/
module stdlog;

public import log;
Expand Down
3 changes: 3 additions & 0 deletions source/terminal.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* is called when SIGHUP signal is caught (linux only).
*
* See_Also: daemon
*
* Copyright: © 2014 DSoftOut
* License: Subject to the terms of the MIT license, as written in the included LICENSE file.
* Authors: NCrashed <ncrashed@gmail.com>
*
*/
Expand Down
Loading

0 comments on commit 40585d8

Please sign in to comment.