feat(message): refactor

This commit is contained in:
Philipp Kunz 2018-05-07 18:50:07 +02:00
parent 547c159dc4
commit 01765fa50f
4 changed files with 66 additions and 18 deletions

View File

@ -10,15 +10,18 @@ stages:
- security - security
- test - test
- release - release
- trigger - metadata
- pages
# ====================
# security stage
# ====================
mirror: mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
tags: tags:
- docker - docker
- notpriv
snyk: snyk:
stage: security stage: security
@ -28,7 +31,11 @@ snyk:
- npmci command snyk test - npmci command snyk test
tags: tags:
- docker - docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY: testLEGACY:
stage: test stage: test
script: script:
@ -38,6 +45,7 @@ testLEGACY:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
allow_failure: true allow_failure: true
testLTS: testLTS:
@ -49,6 +57,7 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
testSTABLE: testSTABLE:
stage: test stage: test
@ -59,34 +68,60 @@ testSTABLE:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci npm prepare - npmci node install stable
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger: trigger:
stage: trigger stage: metadata
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: pages stage: metadata
script: script:
- npmci command yarn global add npmpage - npmci command yarn global add npmpage
- npmci command npmpage - npmci command npmpage
tags: tags:
- docker - docker
- notpriv
only: only:
- tags - tags
artifacts: artifacts:

View File

@ -16,7 +16,5 @@ export class UniverseManager {
* @param channelName the name of the channel * @param channelName the name of the channel
* @param authSecret the secret against which to verify members of the channel * @param authSecret the secret against which to verify members of the channel
*/ */
public async registerChannel(channelName: string, authSecret: string) { public async registerChannel(channelName: string, authSecret: string) {}
}
} }

View File

@ -10,6 +10,14 @@ export class UniverseChannel {
* stores the channels that are available within the universe * stores the channels that are available within the universe
*/ */
public static channelStore = new Objectmap(); public static channelStore = new Objectmap();
/**
* the credentials for the channel
*/
private credentials: {
user: string;
password: string;
};
/** /**
* creates new channels * creates new channels
@ -18,11 +26,6 @@ export class UniverseChannel {
*/ */
public static createChannel = (channelArg: string, secretArg: string) => { public static createChannel = (channelArg: string, secretArg: string) => {
}
credentials: {
user: string;
password: string;
}; };
/** /**

View File

@ -14,9 +14,21 @@ export class UniverseMessage {
* avoids duplications though * avoids duplications though
*/ */
public id: number; public id: number;
/**
* the universe store the message is attached to
*/
public universeStore: UniverseStore; public universeStore: UniverseStore;
public timestamp: TimeStamp; // when has this message been created
public topic: string; // enables unprotected grouping of messages for efficiency purposes. /**
* time of creation
*/
public timestamp: TimeStamp;
/**
* enables unprotected grouping of messages for efficiency purposes.
*/
public universeChannel: string;
public message: string; // the actual message public message: string; // the actual message
public attachedPayload: any; // any attached payloads. Can be of binary format. public attachedPayload: any; // any attached payloads. Can be of binary format.
public destructionTimer: Timer; // a timer to take care of message destruction public destructionTimer: Timer; // a timer to take care of message destruction
@ -24,9 +36,9 @@ export class UniverseMessage {
/** /**
* the constructor to create a universe message * the constructor to create a universe message
* @param parentUniverseStore * @param parentUniverseStore
* @param messageArg * @param messageArg
* @param attachedPayloadArg * @param attachedPayloadArg
* @param selfdestructAfterArg * @param selfdestructAfterArg
*/ */
constructor( constructor(
parentUniverseStore: UniverseStore, parentUniverseStore: UniverseStore,