Skip to content

Commit ee6a1c4

Browse files
committed
Add appengine/gcloud/mustache dependencies.
This CL includes the following packages added to pkg: - pkg/appengine - v0.2.5 (v0.2.4 with https://codereview.chromium.org/775043002/) - pkg/gcloud - v0.1.3 - pkg/mustache - v0.1.8 [email protected] Review URL: https://codereview.chromium.org//804973002
1 parent 5d75ec5 commit ee6a1c4

File tree

155 files changed

+28014
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+28014
-3
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ packages/
99
*.js_
1010
*.js.deps
1111
*.js.map
12-
13-
# Include when developing application packages.
14-
pubspec.lock

AUTHORS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Dart project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright 2014, the Dart project authors. All rights reserved.
2+
Redistribution and use in source and binary forms, with or without
3+
modification, are permitted provided that the following conditions are
4+
met:
5+
* Redistributions of source code must retain the above copyright
6+
notice, this list of conditions and the following disclaimer.
7+
* Redistributions in binary form must reproduce the above
8+
copyright notice, this list of conditions and the following
9+
disclaimer in the documentation and/or other materials provided
10+
with the distribution.
11+
* Neither the name of Google Inc. nor the names of its
12+
contributors may be used to endorse or promote products derived
13+
from this software without specific prior written permission.
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

PATENTS

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Additional IP Rights Grant (Patents)
2+
3+
"This implementation" means the copyrightable works distributed by
4+
Google as part of the Dart Project.
5+
6+
Google hereby grants to you a perpetual, worldwide, non-exclusive,
7+
no-charge, royalty-free, irrevocable (except as stated in this
8+
section) patent license to make, have made, use, offer to sell, sell,
9+
import, transfer, and otherwise run, modify and propagate the contents
10+
of this implementation of Dart, where such license applies only to
11+
those patent claims, both currently owned by Google and acquired in
12+
the future, licensable by Google that are necessarily infringed by
13+
this implementation of Dart. This grant does not include claims that
14+
would be infringed only as a consequence of further modification of
15+
this implementation. If you or your agent or exclusive licensee
16+
institute or order or agree to the institution of patent litigation
17+
against any entity (including a cross-claim or counterclaim in a
18+
lawsuit) alleging that this implementation of Dart or any code
19+
incorporated within this implementation of Dart constitutes direct or
20+
contributory patent infringement, or inducement of patent
21+
infringement, then any patent rights granted to you under this License
22+
for this implementation of Dart shall terminate as of the date such
23+
litigation is filed.

codereview.settings

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CODE_REVIEW_SERVER: http://codereview.chromium.org/
2+
VIEW_VC: https://github.com/dart-lang/pub-dartlang-dart/commit/
3+

pkg/appengine/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pubspec.lock
2+
packages
3+
.pub

pkg/appengine/AUTHORS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Dart project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

pkg/appengine/CHANGELOG.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## 0.2.4
2+
3+
* Added withAppEngineServices() function which allows running arbitrary code
4+
using AppEngine services via a service scope.
5+
6+
## 0.2.4
7+
8+
* Run request handlers inside a service scope
9+
(see `package:gcloud/service_scope.dart`).
10+
* Insert an authenticated HTTP client into the service scope.
11+
* Insert a `memcacheService` into the service scope.
12+
* Added `isDevelopmentServer` and `isProductionEnvironment` getter to client
13+
context.
14+
* Make hostnames returned from modules service use -dot- naming to support
15+
HTTPS.
16+
* Mark `package:appengine/remote_api.dart` as deprecated.
17+
18+
## 0.2.3
19+
20+
* Small bugfix in the lowlevel memcache API implementation.
21+
22+
## 0.2.2
23+
24+
* Updated `README.md`
25+
* Widen googleapis_auth constraint to include version 0.2.0
26+
27+
## 0.2.1
28+
29+
* Small bugfix in storage API implementation
30+
* respect DART_PUB_SERVE url only in developer mode
31+
* sync db/datastore tests to the ones used in gcloud
32+
33+
## 0.2.0
34+
35+
* Use datastore/db APIs from package:gcloud
36+
* simplified annotation system
37+
* paging-based query API
38+
* Added module service
39+
* Some bugfixes
40+
41+
## 0.1.0
42+
43+
* Alpha release

pkg/appengine/LICENSE

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright 2014, the Dart project authors. All rights reserved.
2+
Redistribution and use in source and binary forms, with or without
3+
modification, are permitted provided that the following conditions are
4+
met:
5+
* Redistributions of source code must retain the above copyright
6+
notice, this list of conditions and the following disclaimer.
7+
* Redistributions in binary form must reproduce the above
8+
copyright notice, this list of conditions and the following
9+
disclaimer in the documentation and/or other materials provided
10+
with the distribution.
11+
* Neither the name of Google Inc. nor the names of its
12+
contributors may be used to endorse or promote products derived
13+
from this software without specific prior written permission.
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkg/appengine/PATENTS

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Additional IP Rights Grant (Patents)
2+
3+
"This implementation" means the copyrightable works distributed by
4+
Google as part of the Dart Project.
5+
6+
Google hereby grants to you a perpetual, worldwide, non-exclusive,
7+
no-charge, royalty-free, irrevocable (except as stated in this
8+
section) patent license to make, have made, use, offer to sell, sell,
9+
import, transfer, and otherwise run, modify and propagate the contents
10+
of this implementation of Dart, where such license applies only to
11+
those patent claims, both currently owned by Google and acquired in
12+
the future, licensable by Google that are necessarily infringed by
13+
this implementation of Dart. This grant does not include claims that
14+
would be infringed only as a consequence of further modification of
15+
this implementation. If you or your agent or exclusive licensee
16+
institute or order or agree to the institution of patent litigation
17+
against any entity (including a cross-claim or counterclaim in a
18+
lawsuit) alleging that this implementation of Dart or any code
19+
incorporated within this implementation of Dart constitutes direct or
20+
contributory patent infringement, or inducement of patent
21+
infringement, then any patent rights granted to you under this License
22+
for this implementation of Dart shall terminate as of the date such
23+
litigation is filed.

pkg/appengine/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
This package provide support for running Dart on
2+
[Google App Engine Managed VMs][managed-vms].
3+
4+
### Getting started
5+
6+
Visit [dartlang.org/cloud](https://www.dartlang.org/cloud) for more information
7+
on the requirements for getting started.
8+
9+
When you are up and running a simple hello world application looks like this:
10+
11+
```
12+
import 'dart:io';
13+
import 'package:appengine/appengine.dart';
14+
15+
void requestHandler(HttpRequest request) {
16+
request.response
17+
..write('Hello, world!');
18+
..close();
19+
}
20+
21+
void main() {
22+
runAppEngine(requestHandler).then((_) {
23+
// Server running.
24+
});
25+
}
26+
```
27+
28+
Add the application configuration in a `app.yaml` file and run it locally using
29+
by running:
30+
31+
gcloud preview app run app.yaml
32+
33+
When you are ready to deploy your application, make sure you have authenticated
34+
with `gcloud` and defined your current project. Then run:
35+
36+
gcloud preview app deploy app.yaml
37+
38+
### Send Feedback
39+
40+
We'd love to hear from you! If you encounter a bug, have suggestions for our
41+
APIs or is missing a feature, file it an issue on the
42+
[GitHub issue tracker](https://github.com/dart-lang/appengine/issues/new).
43+
44+
**Note** The Dart support for App Engine is currently in beta.
45+
46+
[managed-vms]: https://developers.google.com/appengine/docs/managed-vms/

pkg/appengine/codereview.settings

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CODE_REVIEW_SERVER: http://codereview.chromium.org/
2+
VIEW_VC: https://github.com/dart-lang/appengine/commit/
3+

pkg/appengine/lib/api/errors.dart

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library appengine.api.errors;
6+
7+
import 'dart:io';
8+
9+
class AppEngineError implements Exception {
10+
final String message;
11+
12+
AppEngineError(this.message);
13+
14+
String toString() => "AppEngineException: $message";
15+
}
16+
17+
class NetworkError extends AppEngineError implements IOException {
18+
NetworkError(String message) : super(message);
19+
20+
String toString() => "NetworkError: $message";
21+
}
22+
23+
class ProtocolError extends AppEngineError implements IOException {
24+
static ProtocolError INVALID_RESPONSE = new ProtocolError("Invalid response");
25+
26+
ProtocolError(String message) : super(message);
27+
28+
String toString() => "ProtocolError: $message";
29+
}
30+
31+
class ServiceError extends AppEngineError {
32+
final String serviceName;
33+
34+
ServiceError(String message, {this.serviceName: 'ServiceError'})
35+
: super(message);
36+
37+
String toString() => "$serviceName: $message";
38+
}
39+
40+
class ApplicationError extends AppEngineError {
41+
ApplicationError(String message) : super(message);
42+
43+
String toString() => "ApplicationError: $message";
44+
}

pkg/appengine/lib/api/logging.dart

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library appengine.api.logging;
6+
7+
import 'dart:async';
8+
9+
import 'package:gcloud/service_scope.dart' as ss;
10+
11+
class LogLevel {
12+
static const LogLevel CRITICAL = const LogLevel._('Critical', 4);
13+
static const LogLevel ERROR = const LogLevel._('Error', 3);
14+
static const LogLevel WARNING = const LogLevel._('Warning', 2);
15+
static const LogLevel INFO = const LogLevel._('Info', 1);
16+
static const LogLevel DEBUG = const LogLevel._('Debug', 0);
17+
18+
final String name;
19+
final int level;
20+
21+
const LogLevel._(this.name, this.level);
22+
23+
String toString() => name;
24+
}
25+
26+
abstract class Logging {
27+
void critical(String string, {DateTime timestamp}) {
28+
log(LogLevel.CRITICAL, string, timestamp: timestamp);
29+
}
30+
31+
void error(String string, {DateTime timestamp}) {
32+
log(LogLevel.ERROR, string, timestamp: timestamp);
33+
}
34+
35+
void warning(String string, {DateTime timestamp}) {
36+
log(LogLevel.WARNING, string, timestamp: timestamp);
37+
}
38+
39+
void info(String string, {DateTime timestamp}) {
40+
log(LogLevel.INFO, string, timestamp: timestamp);
41+
}
42+
43+
void debug(String string, {DateTime timestamp}) {
44+
log(LogLevel.DEBUG, string, timestamp: timestamp);
45+
}
46+
47+
void log(LogLevel level, String message, {DateTime timestamp});
48+
49+
Future flush();
50+
}
51+
52+
/**
53+
* Register a new [Logging] object.
54+
*
55+
* Calling this outside of a service scope or calling it more than once inside
56+
* the same service scope will result in an error.
57+
*
58+
* See the `package:gcloud/service_scope.dart` library for more information.
59+
*/
60+
void registerLoggingService(Logging service) {
61+
ss.register(#_appengine.logging, service);
62+
}
63+
64+
/**
65+
* The logging service.
66+
*
67+
* Request handlers will be run inside a service scope which contains the
68+
* modules service.
69+
*/
70+
Logging get loggingService => ss.lookup(#_appengine.logging);

pkg/appengine/lib/api/memcache.dart

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library appengine.api.memcache;
6+
7+
import 'package:gcloud/service_scope.dart' as ss;
8+
import 'package:memcache/memcache.dart';
9+
10+
/**
11+
* Register a new [Memcache] object.
12+
*
13+
* Calling this outside of a service scope or calling it more than once inside
14+
* the same service scope will result in an error.
15+
*
16+
* See the `package:gcloud/service_scope.dart` library for more information.
17+
*/
18+
void registerMemcacheService(Memcache service) {
19+
ss.register(#_appengine.memcache, service);
20+
}
21+
22+
/**
23+
* The memcache service.
24+
*
25+
* Request handlers will be run inside a service scope which contains the
26+
* memcache service.
27+
*/
28+
Memcache get memcacheService => ss.lookup(#_appengine.memcache);

0 commit comments

Comments
 (0)