mikemimik / collins

Glue for connecting service-gears together
GNU General Public License v3.0
0 stars 0 forks source link

Working Structure #1

Open mikemimik opened 8 years ago

mikemimik commented 8 years ago

Collins

├── brain/
├── configs/
│   ├── index.js
│   └── collins-{service-ger}.js
├── libs/
│   ├── Collins.js
│   ├── CollinsErrors.js
│   └── Triggers.js (I don't think this is needed)
├── utils/
│   ├── Loader.js
│   └── Runtime.js
└── Service (index.js)

Collins

class Collins extends Emitter.EventEmitter2 {
  constructor(config) {
    super({
      wildcard: true,
      delimiter: ':'
    });
    this.services = [];
  }

  use(service_gear) {
    this.services.push(service_gear);
  }
  start() {
  }
}

CollinsError

Loader

Configures, instantiates, initializes, and connects all the {service-gears} and {service-cogs}

static init(next) {
  let context = this;
  next(null);
}
static initConfig(next) {
  let context = this;
  next(null);
}
static initServices(next) {
  let context = this;
  next(null);
}
static connectServices(next) {
  let context = this;
  next(null);
}
static initServiceCogs(next) {
  let context = this;
  next(null);
}
static initActions(next) {
  let context = this;
  next(null);
}
static validateConfig(config) {
  let context = this;
  return config;
}

Runtime

Working Data Structure

working-structure

mikemimik commented 8 years ago

Question

What do we do with all the service-gear configurations? Where to those go, and where do they get configured?