Book Image

Mastering Go Web Services

By : Nathan Kozyra
Book Image

Mastering Go Web Services

By: Nathan Kozyra

Overview of this book

<p>This book will take you through the most important aspects of designing, building, and deploying a web service utilizing idiomatic REST practices with a focus on speed, security, and flexibility. You will begin by building your first API in Go using the HTTP package. You will look at designing and building your application including popular design structures like Model-View-Controller. You will also understand methods for deploying code to staging and development. Finally, you will see how the security features in Go can be used for protection against SQL injection, and sensitive data compromise.</p> <p>By the end of this book, you will have achieved a high level of proficiency in building and deploying web services and web APIs with Go.</p>
Table of Contents (18 chapters)
Mastering Go Web Services
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Viewing other users


Once we are logged in, we should be able to surface other users to an authenticated user to allow them to initiate a connection.

Here's how we can quickly view other users within our users.html Angular template:

<div class="container">
  <div class="row">
    <div ng-repeat="user in users">
      <div class="col-lg-3">{{user.Name}} <a ng-click="createConnection({{user.ID}});">Connect</a></div>
      <div class="col-lg-8">{{user.First}} {{user.Last}}</div>
    </div>
  
  </div>
</div>

We make a call to our /api/users endpoint, which returns a list of users who are logged in. You may recall that we put this behind the authentication wall in the last chapter.

There's not a lot of flair with this view. This is just a way to see people who you may be interested in connecting with or friending in our social application.