万本电子书0元读

万本电子书0元读

顶部广告

Hands-On Full Stack Development with Go电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Mina Andrawos

出  版  社:Packt Publishing

出版时间:2019-03-28

字       数:35.5万

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

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Create a real-world application in Go and explore various frameworks and methodologies for full-stack development Key Features * Organize your isomorphic codebase to enhance the maintainability of your application * Build web APIs and middleware in the Go language by making use of the popular Gin framework * Implement real-time web application functionality with WebSockets Book Description The Go programming language has been rapidly adopted by developers for building web applications. With its impressive performance and ease of development, Go enjoys the support of a wide variety of open source frameworks, for building scalable and high-performant web services and apps. Hands-On Full Stack Development with Go is a comprehensive guide that covers all aspects of full stack development with Go. This clearly written, example-rich book begins with a practical exposure to Go development and moves on to build a frontend with the popular React framework. From there, you will build RESTful web APIs utilizing the Gin framework. After that, we will dive deeper into important software backend concepts, such as connecting to the database via an ORM, designing routes for your services, securing your services, and even charging credit cards via the popular Stripe API. We will also cover how to test, and benchmark your applications efficiently in a production environment. In the concluding chapters, we will cover isomorphic developments in pure Go by learning about GopherJS. As you progress through the book, you'll gradually build a musical instrument online store application from scratch. By the end of the book, you will be confident in taking on full stack web applications in Go. What you will learn * Understand Go programming by building a real-world application * Learn the React framework to develop a frontend for your application * Understand isomorphic web development utilizing the GopherJS framework * Explore methods to write RESTful web APIs in Go using the Gin framework * Learn practical topics such as ORM layers, secure communications, and Stripe's API * Learn methods to benchmark and test web APIs in Go Who this book is for Hands-On Full Stack Development with Go will appeal to developers who are looking to start building amazing full stack web applications in Go. Basic knowhow of Go language and JavaScript is expected. The book targets web developers who are looking to move to the Go language.
目录展开

Title Page

Copyright and Credits

Hands-On Full Stack Development with Go

Dedication

About Packt

Why subscribe?

Packt.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Section 1: The Go Language

Welcome to Full Stack Go

What is full stack development?

What will we build?

The application architecture

The outline of this book

Building Blocks of the Go Language

Technical requirements

Go's playground

Setting up Go's workspace

Packages, variables, data types, and pointers

Packages

Variables and data types

Pointers

Functions and closures

Functions – the basics

Functions – accessing functions from other packages

Closures

Go data structures

Arrays

Slices

Maps

Struct

Methods

Type embedding

Interfaces

Conditional statements and loops

The if statement

The switch statement

Loops

Panics, recovers, and defers

Summary

Questions

Further reading

Go Concurrency

What is concurrency?

Goroutines

Go channels

Regular channels

Buffered channels

The select statement

The sync package

The simple mutex

The read-write mutex

Wait groups

Summary

Questions

Further reading

Section 2: The Frontend

Frontend with React.js

Prerequisites and technical requirements

The GoMusic project

Node.js and the npm

HTML, CSS, and Bootstrap

Project code

The React framework

How to construct React applications

Setting up the project

Installing React

Preparing the new project

JSX and React elements

React components

React application design

Props

State

Initializing the state object

Setting our state

Developer tools

Summary

Questions

Further reading

Building a Frontend for GoMusic

Prerequisites and technical requirements

Building GoMusic

Main pages

The navigational menu

The Products and Promotions pages

The About page

Modal dialog windows and handling credit cards

The Buy Item modal window outline

Credit card handling with React and Stripe

Creating a child React component to host Stripe elements

Making use of Stripe elements to handle credit card information

Submitting a credit card token to the backend

Creating a parent StripeProvider component

The Sign in and Register modal windows

Handling forms in the React framework

The Sign in page

The Registration form

User pages

The orders page

The user page navigational menu

Putting it all together – routes

Summary

Questions

Further reading

Section 3: Web APIs and Middleware in Go

RESTful Web APIs in Go with the Gin Framework

Technical requirements

RESTful APIs

Overview

The client-server architecture

URLs

HTTP methods

The Gin framework

Models and the database layer

Models

The database layer interface

Implementing RESTful APIs using the Gin framework

Defining routes

Creating handlers

Getting a full list of available products

Getting a list of promotions

Sign in new users or add new users

Sign out requests

Getting orders for a specific user

Charging a credit card

Putting it all together

Summary

Questions

Further reading

Advanced Web Go Applications with Gin and React

Technical requirements

The database layer

Relational databases

Setting up

The customer table

The orders table

The products table

ORM

GORM

Implementing the database layer

Middleware

Custom middleware

Security

Certificates and private keys

Establishing trust between the client and the server

Agreeing on, and using an encryption key

Supporting HTTPS in Gin

Password hashing

Implementing password hashing

Comparing the password

Credit card handling

Credit card handling at the backend

Revisiting the frontend code

The app structure

Interactions between the frontend and the backend

Using cookies

Deploying the frontend application

Summary

Questions

Further reading

Testing and Benchmarking Your Web API

Testing in Go

Mocking

Creating a mock db type

Unit testing in Go

Table-driven development

Benchmarking

Summary

Questions

Further reading

Introduction to Isomorphic Go with GopherJS

Technical requirements

GopherJS fundamentals

GopherJS types

Object types

Calling JavaScript functions from your Go code

GopherJS commands

Go bindings

Exporting code

Go Methods

Goroutines

GopherJS with React

The project

The project application's architecture

Building the React application in Go

Building a custom component

Summary

Questions

Further reading

Where to Go from Here?

Cloud-native applications

Microservices

Containers

Serverless applications

Continuous delivery

React Native

What is React Native?

React.js versus React Native

Similarities between React.js and React Native

Differences between React.js and React Native

Expo

Summary

Questions

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部