datahub 0.16.5 copy "datahub: ^0.16.5" to clipboard
datahub: ^0.16.5 copied to clipboard

DataHub is a Cloud Development Ecosystem aiming to bring the power of Dart into the Cloud.

example/datahub_example.dart

// ignore: unused_import
import 'dart:io';

import 'package:datahub/datahub.dart';

void main(List<String> args) async {
  final host = ApplicationHost(
    [
      () => TestService('test'),
    ],
    onInitialized: onInit,
  );
  await host.run();

  // required because of signal catching inside ServiceHost
  exit(0);
}

class TestService extends BaseService {
  // use ioc to inject other services
  final log = resolve<LogService>();

  TestService(String configPath) : super(configPath);

  @override
  Future<void> initialize() async {
    // some logs
    log.debug('Some debug message.');
    log.verbose('Some verbose message.');
    log.info('Some info message.');
    log.warn('Some warn message.');
    log.error('Some error message.');
    log.critical('Some critical message.');
  }
}

void onInit() {
  resolve<LogService>().info('Initialization done!');
}
3
likes
80
pub points
55%
popularity

Publisher

verified publisherdatahubproject.net

DataHub is a Cloud Development Ecosystem aiming to bring the power of Dart into the Cloud.

Homepage

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

args, boost, dart_amqp, http, http2, intl, minio, path, pointycastle, postgres, rxdart, test, uuid, yaml

More

Packages that depend on datahub