Cargando…

Go Programming Blueprints : build real-world, production-ready solutions in Go using cutting-edge technology and techniques /

Intended for seasoned Go programmers who want to put their expertise in Go to use to solve big, real-world, modern problems. With a basic understanding of channels and goroutines, you will hone your skills to build tools and programs that are quick and simple. You need not be an expert in distribute...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Ryer, Mat (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, England : Packt Publishing, 2015.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Chat Application with Web Sockets; A simple web server; Templates; Doing things once; Using your own handlers; Properly building and executing Go programs; Modeling a chat room and clients on the server; Modeling the client; Modeling a room; Concurrency programming using idiomatic Go; Turning a room into an HTTP handler; Use helper functions to remove complexity; Creating and using rooms; Building an HTML and JavaScript chat client
  • Getting more out of templatesTracing code to get a look under the hood; Writing a package using TDD; Interfaces; Unit tests; Red-green testing; Implementing the interface; Unexported types being returned to users; Using our new trace package; Making tracing optional; Clean package APIs; Summary; Chapter 2: Adding Authentication; Handlers all the way down; Making a pretty social sign-in page; Endpoints with dynamic paths; OAuth2; Open source OAuth2 packages; Tell the authentication providers about your app; Implementing external logging in; Logging in; Handling the response from the provider
  • Presenting the user dataAugmenting messages with additional data; Summary; Chapter 3: Three Ways to Implement Profile Pictures; Avatars from the authentication server; Getting the avatar URL; Transmitting the avatar URL; Adding the avatar to the user interface; Logging out; Making things prettier; Implementing Gravatar; Abstracting the avatar URL process; The authentication service and the avatar's implementation; Using an implementation; Gravatar implementation; Uploading an avatar picture; User identification; An upload form; Handling the upload; Serving the images
  • The Avatar implementation for local filesSupporting different file types; Refactoring and optimizing our code; Replacing concrete types with interfaces; Changing interfaces in a test-driven way; Fixing existing implementations; Global variables versus fields; Implementing our new design; Tidying up and testing; Combining all three implementations; Summary; Chapter 4: Command-line Tools to Find Domain Names; Pipe design for command-line tools; Five simple programs; Sprinkle; Exercise
  • configurable transformations; Domainify; Exercise
  • making top-level domains configurable; Coolify; Synonyms
  • Using environment variables for configurationConsuming a web API; Getting domain suggestions; Available; Composing all five programs; One program to rule them all; Summary; Chapter 5: Building Distributed Systems and Working with Flexible Data; System design; Database design; Installing the environment; NSQ; NSQ driver for Go; MongoDB; MongoDB driver for Go; Start the environment; Votes from Twitter; Authorization with Twitter; Extracting the connection; Reading environment variables; Reading from MongoDB; Reading from Twitter; Signal channels; Publishing to NSQ