The 1th chapter of the course introduction
Welcome to the in-depth lecture on go language. This course will start from the basic grammar, and gradually deepen, to help students understand the go language interface-oriented, functional programming, error handling, testing, parallel computing and other elements, and lead you to achieve a distributed crawler real-combat projects.
2nd Chapter Basic Grammar
volume, constant, type, selection, loop, function, pointer, this chapter leads you to learn the necessary grammatical knowledge for a new language. Let everyone have a preliminary understanding of the go language!
3rd Chapter Built-in container
In This section we will learn about arrays, slices, maps, and strings. In the go language, we don't typically use arrays directly, but instead use slices to manage the linear table structure, which is syntactically similar to the Python list, but more powerful. Of course, map and string learning are also essential. At this point, we can write some simple algorithm, brush Leetcode, we will try. ...
the 4th Chapter is for "Object"
The go language has no class, only struct. Let's take a look at how struct is used, and the go language is very characteristic of defining similar methods or member functions for structs. We will also learn about the concept of the Go language package, how to encapsulate it, how to extend the existing type, and so on. We will also learn about the directory structure of the Gopath and go language projects, and how to download a range of project-related knowledge from the Web with dependency packs. We will use the structure and traversal of the "tree" as a cross-section ...
5th Chapter Interface-oriented
This chapter begins with the concept of duck typing and explores the support of duck typing in other languages, which leads to the concept of interfaces. We will delve into the internal implementation of the Go Language interface and the patterns used to implement the combination of interfaces.
6th Chapter Functional Programming
In other common languages, functional programming is the "advanced" concept, but it is very basic for the go language. In this chapter we will explain the concept of functional programming and compare the implementation methods of functional programming in other languages. We will focus on understanding closures. In this chapter we will use a variety of examples to help you better understand the closure, function as a class citizen and its common concepts and application methods. ...
Chapter 7th error Handling and resource management
This will be the most "boring" chapter of the course, but it is a key capability to differentiate between good software engineers. The unique defer/panic/recover of the go language, as well as the error mechanisms, are widely debated in the community. Let's take a closer look at the error handling mechanism of the go language and see how the Go language distinguishes between errors and exceptions. Finally, we implement a Web application micro-project, the use of business services error-handling ideas, combined with functional programming, to demonstrate the Go language errors ...
8th Chapter test and Performance Tuning
The go language test differs from other concepts such as the "form-driven test" used in Junit,go languages. We will learn and understand this concept, and use the Go Language Test Support library to practice table-driven testing, and do code coverage and performance testing, through the built-in performance tuning tool to optimize our previous algorithm. Finally, a variety of granularity tests are demonstrated for HTTP servers. ...
9th Chapter Goroutine
This chapter begins with the concurrent programming we enter. We explain goroutine, the concept of the association, and the go language scheduler behind it.
10th Chapter Channel
The channel is a bridge between Goroutine and it is a class citizen like a function. After the introduction of the channel syntax and operation mode, we will use a number of examples to demonstrate the most common task of the Go Language concurrent programming solution mode.
11th HTTP and other standard libraries
Here we briefly describe the very important and well-encapsulated HTTP standard library in the Go language, recalling and implementing the HTTP client and server. We also introduced the other standard libraries in the Go language.
12th Chapter Maze of breadth First search
In This chapter we will use the learned knowledge to achieve a breadth-first algorithm to solve the maze, for the next combat project to do the technical and algorithmic preparation. Breadth-first algorithm is not only a common technique in interview and work, but also is more complicated than most other algorithms, and it is a classic example to check whether a language is mastered. Let's give it a try. ...
The 13th chapter starts the actual combat project
so far, congratulations to the students completed the course Go language part of the study. Next we will enter the actual combat project. This chapter will introduce the specific content of the project, the choice of the topic, the technology selection, the overall structure, and the implementation steps.
14th One-task version crawler
we should first consider correctness before considering performance. The single-tasking crawler ensures that we are able to correctly crawl the information we need. We have applied the breadth-first algorithm previously practiced, abstracted out parser and fetcher, learned regular expressions, and successfully implemented and run a single-task version of the crawler.
15th Chapter Concurrent version Crawler
in order to improve the performance of reptiles, we abstract the concept of worker, and add a scheduler to implement the concurrent version of the crawler. We apply the concept of the interface to accomplish the implementation of multiple schedulers from simple to complex. Students can more realistically experience and learn the various patterns of Go language concurrent programming in actual combat projects.
16th Chapter Data Storage and Presentation
It's time to test the results of our project. We will use Docker+elasticsearch to store the information we crawl. After a brief look at Docker and Elasticsearch, we will use the Elasticsearch's go language client to write the crawl data. We then used the Go Language template engine to quickly implement the front-end Web display. At this point, we can already try our favorite search terms to see the data. ...
17th Chapter Distributed crawler
This chapter, after a brief introduction to the distributed concept, rewrites our concurrent crawlers into distributed. We add JSONRPC client/server to implement and deploy distributed crawlers with little change. At last, we discuss more improvement programs of actual combat projects.
The 18th Chapter of the course summary
Thanks to the students to learn here, congratulations to the students to their own technology stack plus a very important go language skills. Hope that the students with this course to learn the knowledge, better participate in the project to jointly promote the development of the go language.
: Baidu Network disk download
Original address: http://linyunbbs.com/thread-2147-1-1.html
Google senior Engineer in-depth on Go language Video course Go Crawler combat course