From 59eedd6ec87f929858e48e2747cea9eee0e6729b Mon Sep 17 00:00:00 2001 From: PhilKunz Date: Wed, 28 Sep 2016 13:01:36 +0200 Subject: [PATCH] initial --- .gitignore | 4 +++ package.json | 25 +++++++++++++++++ test/index.ts | 2 ++ test/smartipc.classes.ipcclient.ts | 7 +++++ test/smartipc.classes.ipcserver.ts | 44 ++++++++++++++++++++++++++++++ test/smartipc.plugins.ts | 5 ++++ tslint.json | 3 ++ 7 files changed, 90 insertions(+) create mode 100644 .gitignore create mode 100644 package.json create mode 100644 test/index.ts create mode 100644 test/smartipc.classes.ipcclient.ts create mode 100644 test/smartipc.classes.ipcserver.ts create mode 100644 test/smartipc.plugins.ts create mode 100644 tslint.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2669fbe --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +coverage/ +pages/ +public/ diff --git a/package.json b/package.json new file mode 100644 index 0000000..d78b8f0 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "smartipc", + "version": "1.0.0", + "description": "smart subprocess handling", + "main": "dist/index.js", + "scripts": { + "test": "(npmts)" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@gitlab.com/pushrocks/smartipc.git" + }, + "author": "Lossless GmbH", + "license": "MIT", + "bugs": { + "url": "https://gitlab.com/pushrocks/smartipc/issues" + }, + "homepage": "https://gitlab.com/pushrocks/smartipc#README", + "dependencies": { + "@types/lodash": "^4.14.36", + "beautylog": "^5.0.23", + "lodash": "^4.16.2", + "typings-global": "^1.0.14" + } +} diff --git a/test/index.ts b/test/index.ts new file mode 100644 index 0000000..b19be5a --- /dev/null +++ b/test/index.ts @@ -0,0 +1,2 @@ +export * from './smartipc.classes.ipcserver' +export * from './smartipc.classes.ipcclient' diff --git a/test/smartipc.classes.ipcclient.ts b/test/smartipc.classes.ipcclient.ts new file mode 100644 index 0000000..5d4c493 --- /dev/null +++ b/test/smartipc.classes.ipcclient.ts @@ -0,0 +1,7 @@ +import * as plugins from './smartipc.plugins' + +export calss IpcClient { + constructor() { + + } +} \ No newline at end of file diff --git a/test/smartipc.classes.ipcserver.ts b/test/smartipc.classes.ipcserver.ts new file mode 100644 index 0000000..4cb2f48 --- /dev/null +++ b/test/smartipc.classes.ipcserver.ts @@ -0,0 +1,44 @@ +import * as plugins from './smartipc.plugins' + +interface IIpcServeOptions { + appspace?: string + socketRoot?: string + id?: string + networkHost?: string //should resolve to 127.0.0.1 or ::1 see the table below related to this + networkPort?: number + encoding?: string + rawBuffer?: boolean + sync?: boolean + silent?: boolean + logInColor?: boolean + logDepth?: number + maxConnections?: number + retry?: number + maxRetries?: boolean + stopRetrying?: boolean +} + +let defaultOptions: IIpcServeOptions = { + appspace: 'app.', + socketRoot: '/tmp/', + id: plugins.os.hostname(), + networkHost: 'localhost', //should resolve to 127.0.0.1 or ::1 see the table below related to this + networkPort: 8000, + encoding: 'utf8', + rawBuffer: false, + sync: false, + silent: false, + logInColor: true, + logDepth: 5, + maxConnections: 100, + retry: 500, + maxRetries: false, + stopRetrying: false +} + +export class IpcServe { + ipcOptions: IIpcServeOptions + constructor(ipcOptionsArg: IIpcServeOptions) { + this.ipcOptions = plugins.lodash.merge({},defaultOptions,ipcOptionsArg) + } +} \ No newline at end of file diff --git a/test/smartipc.plugins.ts b/test/smartipc.plugins.ts new file mode 100644 index 0000000..53aa26d --- /dev/null +++ b/test/smartipc.plugins.ts @@ -0,0 +1,5 @@ +import 'typings-global' +export import beautylog = require('beautylog') +export import lodash = require('lodash') +export let nodeIpc = require('node-ipc') +export import os = require('os') diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..45052ad --- /dev/null +++ b/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "tslint-config-standard" +}