My Account Log in

3 options

Building RESTful Web services with Go : learn how to build powerful RESTful APIs with Golang that scale gracefully / Naren Yellavula.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Yellavula, Naren, author.
Language:
English
Subjects (All):
Web sites--Security measures.
Web sites.
Physical Description:
1 online resource (297 pages) : illustrations
Edition:
1st edition
Other Title:
Building representational state transfer web services with Go
Place of Publication:
Birmingham, England : Packt Publishing, 2017.
System Details:
text file
Biography/History:
Yellavula Naren: Naren Yellavula, known in the developer community as Naren Arya, started his programming career in a somewhat surprising manner. He ditched mechanical engineering in favor of computer science after watching The Matrix for the first time. With domain expertise in cloud telephony and e-commerce, Naren has a total of 6 years' professional experience and 10 years of programming experience. His articles on open source have been read over a million times worldwide. Naren has spoken at the PyCon India conference on two occasions. He currently works as a software engineer, building microservices for Tradebyte Software GmbH (a Zalando enterprise). In his spare time, he travels to new places. He also loves reading nonfiction most of the time, and Victorian and Russian fiction on occasion.
Summary:
Explore the necessary concepts of REST API development by building few real world services from scratch. About This Book Follow best practices and explore techniques such as clustering and caching to achieve a reactive, scalable web service Leverage the Buffalo Framework to quickly implement RESTful endpoints Learn to implement a client library for a RESTful web service using Go Who This Book Is For This book is intended for those who want to learn to build RESTful web services with a framework like Buffalo. To make best use of the code samples included in the book, you should have a basic knowledge of Go programming. What You Will Learn Create HTTP handler and introspect the Gorilla Mux router OAuth 2 implementation with Go Build RESTFul API with go-restful, Revel.Go and Buffalo Go Create REST API with MongoDB and Go Build a working client library and unit test for REST API Debug, test, and profile RESTful APIs with each of the frameworks Optimize and scale REST API using microservices In Detail REST is an architectural style that tackles the challenges of building scalable web services and in today's connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs. The depth, breadth, and ease of use of Go, makes it a breeze for developers to work with it to build robust Web APIs. This book takes you through the design of RESTful web services and leverages a framework like Buffalo Go to implement these services. The book starts with a brief introduction to REST API development and how it transformed the modern web. You will learn how to handle routing and authentication of web services along with working with middleware for internal service. The book explains how to use Go frameworks to build RESTful web services and work with MongoDB to create REST API. You will learn how to integrate Postgres SQL and JSON with a Go web service and build a client library in Go for consuming REST API. You will learn how to scale APIs using the microservice architecture and deploy the REST APIs using Nginx as a proxy server. Finally you will learn how to metricize a REST API using an API Gateway. By the end of the book you will be proficient in building RESTful APIs in Go. Style and approach This book is a step-by-step, hands-on guide to designing and building RESTful web services. Explore the necessary concepts of REST API development by building few real world servic...
Contents:
Cover
Title Page
Copyright
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Table of Contents
Preface
Chapter 1: Getting Started with REST API Development
Types of web services
REST API
Characteristics of REST services
REST verbs and status codes
GET
POST, PUT, and PATCH
DELETE and OPTIONS
Cross-Origin Resource Sharing (CORS)
Types of status codes
2xx family (successful)
3xx family (redirection)
4xx family (client error)
5xx family (server error)
Rise of REST API with Single Page Applications
Old and new ways of data flow in SPA
Why Go for REST API development?
Setting up the project and running the development server
Demystifying GOPATH
Building our first service - finding the Roman numeral
Breaking down the code
Live reloading the application with supervisord and Gulp
Monitoring your Go web server with supervisord
Installing supervisord
Using Gulp for creating auto code compiling and server reloading
Understanding the gulpfile
Summary
Chapter 2: Handling Routing for Our REST Services
Getting the code
Understanding Go's net/http package
Running the code
ServeMux, a basic router in Go
Adding multiple handlers using ServeMux
Introducing httprouter, a lightweight HTTP router
Installation
Program explanation
Building the simple static file server in minutes
Introducing Gorilla Mux, a powerful HTTP router
Fundamentals of Gorilla Mux
Reverse mapping URL
Custom paths
Path Prefix
Strict Slash
Encoded paths
Query-based matching
Host-based matching
SQL injections in URLs and ways to avoid them
Creating a basic API layout for URL shortening services
Summary.
Chapter 3: Working with Middleware and RPC
What is middleware?
Creating a basic middleware
Multiple middleware and chaining
Painless middleware chaining with Alice
Using Gorilla's Handlers middleware for Logging
What is RPC?
Creating an RPC server
Creating an RPC client
JSON RPC using Gorilla RPC
Chapter 4: Simplifying RESTful Services with Popular Go Frameworks
go-restful, a framework for REST API creation
CRUD operations and SQLite3 basics
Building a Metro Rail API with go-restful
Design specification
Creating database models
Building RESTful APIs with the Gin framework
Building a RESTful API with Revel.go
Chapter 5: Working with MongoDB and Go to Create REST APIs
Introduction to MongoDB
Installing MongoDB and using the shell
Working with the Mongo shell
Introducing mgo, a MongoDB driver for Go
RESTful API with Gorilla Mux and MongoDB
Boosting the querying performance with indexing
Designing an e-commerce data document model
Chapter 6: Working with Protocol Buffers and GRPC
Introduction to protocol buffers
Protocol buffer language
Scalar values
Enumerations and repeated fields
Compiling a protocol buffer with protoc
Introduction to GRPC
Bidirectional streaming with GRPC
Chapter 7: Working with PostgreSQL, JSON, and Go
Installing the PostgreSQL database
Adding users and databases in PostgreSQL
pq, a pure PostgreSQL database driver for Go
Implementing a URL shortening service using Postgres and pq
Defining the Base62 algorithm
Exploring the JSON store in PostgreSQL
GORM, a powerful ORM for Go
Implementing the e-commerce REST API
Chapter 8: Building a REST API Client in Go and Unit Testing
Plan for building a REST API client
Basics for writing a command-line tool in Go
CLI - a library for building beautiful clients
Collecting command-line arguments in CLI
grequests - a REST API package for Go
API overview of grequests
Getting comfortable with the GitHub REST API
Creating a CLI tool as an API client for the GitHub REST API
Using Redis for caching the API data
Creating a unit testing tool for our URL shortening service
Chapter 9: Scaling Our REST API Using Microservices
What are microservices?
Monolith versus microservices
Go Kit, a package for building microservices
Building a REST microservice with Go Kit
Adding logging to your microservice
Adding instrumentation to your microservice
Chapter 10: Deploying Our REST services
Installing and configuring Nginx
What is a proxy server?
Important Nginx paths
Using server blocks
Creating a sample Go application and proxying it
Load balancing with Nginx
Rate limiting our REST API
Securing our Nginx proxy server
Monitoring our Go API server with Supervisord
Installing Supervisord
Chapter 11: Using an API Gateway to Monitor and Metricize REST API
Why is an API gateway required?
Kong, an open-source API gateway
Introducing Docker
Installing a Kong database and Kong
Adding API to Kong
API logging in Kong
API authentication in Kong
API rate limiting in Kong
Kong CLI
Other API gateways
Chapter 12: Handling Authentication for Our REST Services
How authentication works
Session-based authentication
Introducing Postman, a tool for testing REST API.
Persisting client sessions with Redis
Introduction to JSON Web Tokens (JWT) and OAuth2
JSON web token format
Reserved claims
Private claims
Creating a JWT in Go
Reading a JWT in Go
OAuth 2 architecture and basics
Authentication versus authorization
Index.
Notes:
Includes index.
Description based on online resource; title from PDF title page (EBC, viewed February 6, 2018).
ISBN:
9781788291088
1788291085
OCLC:
1021887715

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account