万本电子书0元读

万本电子书0元读

顶部广告

Go Cookbook电子书

售       价:¥

36人正在读 | 0人评论 6.2

作       者:Aaron Torres

出  版  社:Packt Publishing

出版时间:2017-07-07

字       数:39.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Bridge the gap between basic understanding of Go and use of its advanced features About This Book ? Discover a number of recipes and approaches to develop modern back-end applications ? Put to use the best practices to combine the recipes for sophisticated parallel tools ? This book is based on Go 1.8, which is the latest version Who This Book Is For This book is for web developers, programmers, and enterprise developers. Basic knowledge of the Go language is assumed. Experience with back-end application development is not necessary, but may help understand the motivation behind some of the recipes. What You Will Learn ? Test your application using advanced testing methodologies ? Develop an awareness of application structures, interface design, and tooling ? Create strategies for third-party packages, dependencies, and vendoring ? Get to know tricks on treating data such as collections ? Handle errors and cleanly pass them along to calling functions ? Wrap dependencies in interfaces for ease of portability and testing ? Explore reactive programming design patterns in Go In Detail Go (a.k.a. Golang) is a statically-typed programming language first developed at Google. It is derived from C with additional features such as garbage collection, type safety, dynamic-typing capabilities, additional built-in types, and a large standard library. This book takes off where basic tutorials on the language leave off. You can immediately put into practice some of the more advanced concepts and libraries offered by the language while avoiding some of the common mistakes for new Go developers. The book covers basic type and error handling. It explores applications that interact with users, such as websites, command-line tools, or via the file system. It demonstrates how to handle advanced topics such as parallelism, distributed systems, and performance tuning. Lastly, it finishes with reactive and serverless programming in Go. Style and approach This guide is a handy reference for developers to quickly look up Go development patterns. It is a companion to other resources and a reference that will be useful long after reading it through the first time. Each recipe includes working, simple, and tested code that can be used as a reference or foundation for your own applications.
目录展开

Title Page

Copyright

Go Cookbook

Credits

About the Author

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

Preface

What this book covers

What you need for this book

Who this book is for

Sections

Getting ready

How to do it…

How it works…

There's more…

See also

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

I/O and File Systems

Introduction

Using the common I/O interfaces

Getting ready

How to do it...

How it works...

Using the bytes and strings packages

Getting ready

How to do it...

How it works...

Working with directories and files

Getting ready

How to do it...

How it works...

Working with the CSV format

Getting ready

How to do it...

How it works...

Working with temporary files

Getting ready

How to do it...

How it works...

Working with text/template and HTML/templates

Getting ready

How to do it...

How it works...

Command-Line Tools

Introduction

Using command-line flags

Getting ready

How to do it...

How it works...

Using command-line arguments

Getting ready

How to do it...

How it works...

Reading and setting environment variables

Getting ready

How to do it...

How it works...

Configuration using TOML, YAML, and JSON

Getting ready

How to do it...

How it works...

Working with Unix pipes

Getting ready

How to do it...

How it works...

Catching and handling signals

Getting ready

How to do it...

How it works...

An ANSI coloring application

Getting ready

How to do it...

How it works...

Data Conversion and Composition

Introduction

Converting data types and interface casting

Getting ready

How to do it...

How it works...

Working with numeric data types using math and math/big

Getting ready

How to do it...

How it works...

Currency conversions and float64 considerations

Getting ready

How to do it...

How it works...

Using pointers and SQL NullTypes for encoding and decoding

Getting ready

How to do it...

How it works...

Encoding and decoding Go data

Getting ready

How to do it...

How it works...

Struct tags and basic reflection in Go

Getting ready

How to do it...

How it works...

Implementing collections via closures

Getting ready

How to do it...

How it works...

Error Handling in Go

Introduction

Handling errors and the Error interface

Getting ready

How to do it...

How it works...

Using the pkg/errors package and wrapping errors

Getting ready

How to do it...

How it works...

Using the log package and understanding when to log errors

Getting ready

How to do it...

How it works...

Structured logging with the apex and logrus packages

Getting ready

How to do it...

How it works...

Logging with the context package

Getting ready

How to do it...

How it works...

Using package-level global variables

Getting ready

How to do it...

How it works...

Catching panics for long running processes

Getting ready

How to do it...

How it works...

All about Databases and Storage

Introduction

The database/sql package with MySQL

Getting ready

How to do it...

How it works...

Executing a database transaction interface

Getting ready

How to do it...

How it works...

Connection pooling, rate limiting, and timeouts for SQL

Getting ready

How to do it...

How it works...

Working with Redis

Getting ready

How to do it...

How it works...

Using NoSQL with MongoDB and mgo

Getting ready

How to do it...

How it works...

Creating storage interfaces for data portability

Getting ready

How to do it...

How it works...

Web Clients and APIs

Introduction

Initializing, storing, and passing http.Client structs

Getting ready

How to do it...

How it works...

Writing a client for a REST API

Getting ready

How to do it...

How it works...

Executing parallel and async client requests

Getting ready

How to do it...

How it works...

Making use of OAuth2 clients

Getting ready

How to do it...

How it works...

Implementing an OAuth2 token storage interface

Getting ready

How to do it...

How it works...

Wrapping a client in added functionality and function composition

Getting ready

How to do it...

How it works...

Understanding GRPC clients

Getting ready

How to do it...

How it works...

Microservices for Applications in Go

Introduction

Working with web handlers, requests, and ResponseWriters

Getting ready

How to do it...

How it works...

Using structs and closures for stateful handlers

Getting ready

How to do it...

How it works...

Validating input for Go structs and user inputs

Getting ready

How to do it...

How it works...

Rendering and content negotiation

Getting ready

How to do it...

How it works...

Implementing and using middleware

Getting ready

How to do it...

How it works...

Building a reverse proxy application

Getting ready

How to do it...

How it works...

Exporting GRPC as a JSON API

Getting ready

How to do it...

How it works...

Testing

Introduction

Mocking using the standard library

Getting ready

How to do it...

How it works...

Using the Mockgen package

Getting ready

How to do it...

How it works...

Using table-driven tests to improve coverage

Getting ready

How to do it...

How it works...

Using third-party testing tools

Getting ready

How to do it...

How it works...

Practical fuzzing

Getting ready

How to do it...

How it works...

Behavior testing using Go

Getting ready

How to do it...

How it works...

Parallelism and Concurrency

Introduction

Using channels and the select statement

Getting ready

How to do it...

How it works...

Performing async operations with sync.WaitGroup

Getting ready

How to do it...

How it works...

Using atomic operations and mutex

Getting ready

How to do it...

How it works...

Using the context package

Getting ready

How to do it...

How it works...

Executing state management for channels

Getting ready

How to do it...

How it works...

Using the worker pool design pattern

Getting ready

How to do it...

How it works...

Using workers to create pipelines

Getting ready

How to do it...

How it works...

Distributed Systems

Introduction

Using service discovery with Consul

Getting ready

How to do it...

How it works...

Implementing basic consensus using Raft

Getting ready

How to do it...

How it works...

Using containerization with Docker

Getting ready

How to do it...

How it works...

Orchestration and deployment strategies

Getting ready

How to do it...

How it works...

Monitoring applications

Getting ready

How to do it...

How it works...

Collecting metrics

Getting ready

How to do it...

How it works...

Reactive Programming and Data Streams

Introduction

Goflow for dataflow programming

Getting ready

How to do it...

How it works...

Reactive programming with RxGo

Getting ready

How to do it...

How it works...

Using Kafka with Sarama

Getting ready

How to do it...

How it works...

Using async producers with Kafka

Getting ready

How to do it...

How it works...

Connecting Kafka to Goflow

Getting ready

How to do it...

How it works...

Writing a GraphQL server in Go

Getting ready

How to do it...

How it works...

Serverless Programming

Introduction

Go programming on Lambda with Apex

Getting ready

How to do it...

How it works...

Apex serverless logging and metrics

Getting ready

How to do it...

How it works...

Google App Engine with Go

Getting ready

How to do it...

How it works...

Working with Firebase using zabawaba99/firego

Getting ready

How to do it...

How it works...

Performance Improvements, Tips, and Tricks

Introduction

Speeding up compilation and testing cycles

Getting ready

How to do it...

How it works...

Using the pprof tool

Getting ready

How to do it...

How it works...

Benchmarking and finding bottlenecks

Getting ready

How to do it...

How it works...

Memory allocation and heap management

Getting ready

How to do it...

How it works...

Vendoring and project layout

Getting ready

How to do it...

How it works...

Using fasthttprouter and fasthttp

Getting ready

How to do it...

How it works...

累计评论(0条) 2个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部