diff --git a/analysis_options.yaml b/analysis_options.yaml index ddb7c9b..01c74eb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -18,3 +18,4 @@ linter: - prefer_single_quotes - test_types_in_equals - use_super_parameters + - prefer_relative_imports diff --git a/example/grpc-web/lib/app.dart b/example/grpc-web/lib/app.dart index 48196f9..bdc920f 100644 --- a/example/grpc-web/lib/app.dart +++ b/example/grpc-web/lib/app.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:html'; -import 'package:grpc_web/src/generated/echo.pbgrpc.dart'; +import 'src/generated/echo.pbgrpc.dart'; class EchoApp { final EchoServiceClient _service; diff --git a/lib/grpc.dart b/lib/grpc.dart index e56f3c2..5f79523 100644 --- a/lib/grpc.dart +++ b/lib/grpc.dart @@ -36,6 +36,7 @@ export 'src/client/options.dart' BackoffStrategy, defaultBackoffStrategy, ChannelOptions; +export 'src/client/proxy.dart' show Proxy; export 'src/client/transport/http2_credentials.dart' show BadCertificateHandler, allowBadCertificates, ChannelCredentials; diff --git a/lib/src/auth/auth_io.dart b/lib/src/auth/auth_io.dart index e8368b2..681ee59 100644 --- a/lib/src/auth/auth_io.dart +++ b/lib/src/auth/auth_io.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'dart:convert'; import 'dart:io'; diff --git a/lib/src/client/client_keepalive.dart b/lib/src/client/client_keepalive.dart index 9dcd54e..c088e59 100644 --- a/lib/src/client/client_keepalive.dart +++ b/lib/src/client/client_keepalive.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'dart:async'; import 'package:clock/clock.dart'; diff --git a/lib/src/client/client_transport_connector.dart b/lib/src/client/client_transport_connector.dart index 08bfa03..3d2a982 100644 --- a/lib/src/client/client_transport_connector.dart +++ b/lib/src/client/client_transport_connector.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'dart:async'; import 'package:http2/transport.dart'; diff --git a/lib/src/client/http2_connection.dart b/lib/src/client/http2_connection.dart index 77cab5e..998410a 100644 --- a/lib/src/client/http2_connection.dart +++ b/lib/src/client/http2_connection.dart @@ -18,7 +18,6 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; -import 'package:grpc/src/client/proxy.dart'; import 'package:http2/transport.dart'; import '../shared/codec.dart'; @@ -29,6 +28,7 @@ import 'client_transport_connector.dart'; import 'connection.dart' hide ClientConnection; import 'connection.dart' as connection; import 'options.dart'; +import 'proxy.dart'; import 'transport/http2_credentials.dart'; import 'transport/http2_transport.dart'; import 'transport/transport.dart'; diff --git a/lib/src/client/interceptor.dart b/lib/src/client/interceptor.dart index 131105b..5318725 100644 --- a/lib/src/client/interceptor.dart +++ b/lib/src/client/interceptor.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'call.dart'; import 'common.dart'; import 'method.dart'; diff --git a/lib/src/client/proxy.dart b/lib/src/client/proxy.dart index b4f889c..14d0f8d 100644 --- a/lib/src/client/proxy.dart +++ b/lib/src/client/proxy.dart @@ -1,3 +1,19 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/// Proxy data class with optional authentication. class Proxy { final String host; final int port; diff --git a/lib/src/server/interceptor.dart b/lib/src/server/interceptor.dart index ee9286c..81060f9 100644 --- a/lib/src/server/interceptor.dart +++ b/lib/src/server/interceptor.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'dart:async'; import '../shared/status.dart'; diff --git a/lib/src/server/server_keepalive.dart b/lib/src/server/server_keepalive.dart index 6bf6f8d..890e0fe 100644 --- a/lib/src/server/server_keepalive.dart +++ b/lib/src/server/server_keepalive.dart @@ -1,3 +1,18 @@ +// Copyright (c) 2023, the gRPC project authors. Please see the AUTHORS file +// for details. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import 'package:clock/clock.dart'; /// Options to configure a gRPC server for receiving keepalive signals. diff --git a/test/proxy_secure_test.dart b/test/proxy_secure_test.dart index 6afb9b2..24f6ff8 100644 --- a/test/proxy_secure_test.dart +++ b/test/proxy_secure_test.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'dart:io'; import 'package:grpc/grpc.dart'; -import 'package:grpc/src/client/proxy.dart'; import 'package:test/test.dart'; import 'src/generated/echo.pbgrpc.dart'; diff --git a/test/proxy_test.dart b/test/proxy_test.dart index 4cb6e8b..a4f9bcf 100644 --- a/test/proxy_test.dart +++ b/test/proxy_test.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:grpc/grpc.dart'; -import 'package:grpc/src/client/proxy.dart'; import 'package:test/test.dart'; import 'src/generated/echo.pbgrpc.dart'; diff --git a/test/src/client_utils.dart b/test/src/client_utils.dart index 58d5b59..fd5cd38 100644 --- a/test/src/client_utils.dart +++ b/test/src/client_utils.dart @@ -19,7 +19,6 @@ import 'dart:convert'; import 'package:grpc/grpc.dart'; import 'package:grpc/src/client/channel.dart' as base; import 'package:grpc/src/client/http2_connection.dart'; -import 'package:grpc/src/client/proxy.dart'; import 'package:grpc/src/shared/message.dart'; import 'package:http2/transport.dart'; import 'package:mockito/annotations.dart'; diff --git a/test/tools/http2_client.dart b/test/tools/http2_client.dart index d124037..46b8b42 100644 --- a/test/tools/http2_client.dart +++ b/test/tools/http2_client.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:grpc/grpc.dart'; import 'package:grpc/src/client/http2_connection.dart'; -import 'package:grpc/src/client/proxy.dart'; import 'package:http2/http2.dart'; Future main(List args) async {