pip_services3_grpc 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

Pip.Services Logo #

gRPC for Dart #

This framework is a part of the Pip.Services project. It provides the following synchronous communication components:

  • gRPC - gRPC [services] and [clients]

Quick Links:

Acknowledgements #

The Dart version of Pip.Services is created and maintained by:

  • Sergey Seroukhov
  • Levichev Dmitry

The documentation is written by:

  • Mark Makarychev
  • Levichev Dmitry

1.0.0 #

  • Initial version, created by Sergey Seroukhov and Dmitry Levichev

example/main.dart

import 'package:pip_services3_commons/pip_services3_commons.dart';

import './DummyController.dart';
import './services/DummyCommandableGrpcService.dart';
import './clients/DummyCommandableGrpcClient.dart';
import './Dummy.dart';

var grpcConfig = ConfigParams.fromTuples([
  'connection.protocol',
  'http',
  'connection.host',
  'localhost',
  'connection.port',
  3002
]);

void main() async {
  DummyCommandableGrpcService service;
  DummyCommandableGrpcClient client;

  var ctrl = DummyController();

  service = DummyCommandableGrpcService();
  service.configure(grpcConfig);

  var references = References.fromTuples([
    Descriptor(
        'pip-services-dummies', 'controller', 'default', 'default', '1.0'),
    ctrl,
    Descriptor('pip-services-dummies', 'service', 'grpc', 'default', '1.0'),
    service
  ]);
  service.setReferences(references);
  await service.open('123');

  client = DummyCommandableGrpcClient();

  client.configure(grpcConfig);
  client.setReferences(References());
  await client.open('123');
//----------------------------------------------
  var dummy1 = Dummy(id:'', key:'Key 1', content:'Content 1');

  // Create one dummy
  var dummy = await client.createDummy('123', dummy1);

  // Get all dummies
  var dummies =
      await client.getDummies('123', FilterParams(), PagingParams(0, 5, false));

  // Update the dummy
  dummy1.content = 'Updated Content 1';
  dummy = await client.updateDummy('123', dummy1);

  // Delete dummy
  await client.deleteDummy('123', dummy1.id);

  // Try to get delete dummy
  dummy = await client.getDummyById('123', dummy1.id);

//----------------------------------------------
  await client.close('123');
  await service.close('123');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pip_services3_grpc: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pip_services3_grpc/pip_services3_grpc.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
87
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Jul 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14

Analysis suggestions

Package not compatible with SDK flutter

Because it is not compatible with any of the supported runtimes: flutter-native, flutter-web

Package not compatible with runtime flutter-native on android

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on ios

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on linux

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on macos

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on windows

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-web on web

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime js

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime native-aot

Because:

  • package:pip_services3_grpc/pip_services3_grpc.dart that imports:
  • package:pip_services3_grpc/src/build/build.dart that imports:
  • package:pip_services3_grpc/src/build/DefaultGrpcFactory.dart that imports:
  • package:pip_services3_grpc/src/services/GrpcEndpoint.dart that imports:
  • package:pip_services3_rpc/pip_services3_rpc.dart that imports:
  • package:pip_services3_rpc/src/build/build.dart that imports:
  • package:pip_services3_rpc/src/build/DefaultRpcFactory.dart that imports:
  • package:pip_services3_rpc/src/services/StatusRestService.dart that imports:
  • package:pip_services3_rpc/src/services/RestService.dart that imports:
  • package:pip_services3_rpc/src/services/HttpResponseSender.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Health suggestions

Fix lib/src/generated/commandable.pbjson.dart. (-12.66 points)

Analysis of lib/src/generated/commandable.pbjson.dart reported 27 hints, including:

line 8 col 31: Avoid const keyword.

line 10 col 8: Avoid const keyword.

line 11 col 5: Avoid const keyword.

line 12 col 5: Avoid const keyword.

line 13 col 5: Avoid const keyword.

Fix lib/src/services/GrpcService.dart. (-0.50 points)

Analysis of lib/src/services/GrpcService.dart reported 1 hint:

line 93 col 10: The value of the field '_serviceName' isn't used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
fixnum ^0.10.11 0.10.11
grpc ^2.1.3 2.2.0
pip_services3_commons >=1.0.2 <2.0.0 1.0.11
pip_services3_components >=1.0.4 <2.0.0 1.0.6
pip_services3_rpc >=1.0.1 <2.0.0 1.0.7
protobuf ^1.0.1 1.0.1
Transitive dependencies
angel_container 1.1.0
angel_framework 2.1.1
angel_http_exception 1.1.0
angel_model 1.0.3
angel_route 3.1.0+1
async 2.4.2
charcode 1.1.3
code_buffer 1.0.1
collection 1.14.13
combinator 1.1.0
convert 2.1.1
crypto 2.1.5
dart2_constant 1.0.2+dart2
file 5.2.1
googleapis_auth 0.2.12
http 0.12.1
http2 1.0.0
http_parser 3.1.4
http_server 0.9.8+3
intl 0.16.1
logging 0.11.4
matcher 0.12.8
merge_map 1.0.2
meta 1.2.1
mime 0.9.6+3
mock_request 1.0.7
mustache4dart2 0.1.0
path 1.7.0
pedantic 1.9.1
quiver 2.1.3
quiver_hashcode 2.0.0
recase 2.0.1 3.0.0
source_span 1.7.0
sprintf 4.0.2
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.2.0
uuid 2.2.0
yaml 2.2.1
Dev dependencies
test >=1.14.2 <2.0.0