Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 2.34 KB

readme.md

File metadata and controls

34 lines (27 loc) · 2.34 KB

Search Engine Application

To see Go in action we are going to build a complete Go program. The program implements functionality that can be found in many Go programs being developed today. The program provides a sample to the html package to create a simple search engine. The engine supports Google, Bing and Blekko searches. You can request results for all three engines or ask for just the first result. Searches are performed concurrently. Use the GOMAXPROCS environment variables to run the searches in parallel.

Program Architecture

Image of App.

The program is broken into several distinct steps that run across different goroutines. We will explore the code as it flows from the main goroutine into the searching goroutines and then back to the main goroutine. To start, let's review the structure of the project:

cd $GOPATH/src/github.com/ArdanStudios/web_app/sample

The code is organized within two packages. The service package handles the processing of HTTP requests and responses. HTML templates are used to render the views. The search package handles the processing of searches agains the different search engines. An interface called Searcher is declared to support the implementation of new Searchers.