Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: samples/dartiverse_search/lib/search_engine.dart

Issue 752303004: Delete dartiverse-search from the repo and update dart:io documentation to point (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 search_engine;
6
7 import 'dart:async';
8 import 'dart:convert' show JSON;
9 import 'dart:io' show HttpStatus;
10 import 'package:http/http.dart' as http_client;
11
12 part 'github_search_engine.dart';
13 part 'stack_overflow_search_engine.dart';
14
15
16 /**
17 * A [SearchEngine] provides the ability to search for a given string.
18 */
19 abstract class SearchEngine {
20 /**
21 * Get the name of the search engine.
22 */
23 String get name;
24
25 /**
26 * Perform a search for [input]. The returned [Stream] will complete
27 * when there are no more results.
28 */
29 Stream<SearchResult> search(String input);
30 }
31
32
33 /**
34 * A [SearchResult] entry, returned by [SearchEngine.search].
35 */
36 class SearchResult {
37 /**
38 * The title of the result.
39 */
40 final String title;
41
42 /**
43 * The link of the result.
44 */
45 final String link;
46
47 /**
48 * Create a new [SearchResult] from a title and a link.
49 */
50 SearchResult(this.title, this.link);
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698