platform/lib/src/http/metadata.dart

39 lines
880 B
Dart
Raw Normal View History

library angel_framework.http.metadata;
2016-12-10 14:05:40 +00:00
import 'hooked_service.dart' show HookedServiceEventListener;
2016-06-21 22:56:04 +00:00
/// Annotation to map middleware onto a handler.
class Middleware {
final List handlers;
2016-12-10 14:05:40 +00:00
const Middleware(this.handlers);
}
2016-06-21 22:56:04 +00:00
/// Annotation to set a service up to release hooks on every action.
class Hooked {
const Hooked();
2016-06-27 00:20:42 +00:00
}
2016-12-10 14:05:40 +00:00
/// Attaches hooks to a [HookedService].
class Hooks {
final List<HookedServiceEventListener> before;
final List<HookedServiceEventListener> after;
const Hooks({this.before: const [], this.after: const []});
}
/// Exposes a [Controller] to the Internet.
2016-06-27 00:20:42 +00:00
class Expose {
final String method;
final Pattern path;
final List middleware;
final String as;
final List<String> allowNull;
2016-12-10 14:05:40 +00:00
const Expose(this.path,
{this.method: "GET",
this.middleware: const [],
this.as: null,
this.allowNull: const []});
}