Creating a RESTful client
Creating a RESTful client is much easier than programming a server mainly because you do not have to work with the database on the client side. The only thing that the client needs to do is send the right amount and kind of data to the server and receive back and interpret the server response. The full RESTful client implementation can be found in ./ch11/client
of the book GitHub repository.
The supported first-level cobra commands are going to be the following:
list
: This command accesses the/getall
endpoint and returns the list of all available users.time
: This command is for visiting the/time
endpoint.update
: This command is for updating user records—the user ID cannot change.logged
: This command lists all logged-in users.delete
: This command deletes an existing user.login
: This command is for logging in a user.logout
: This command is for logging out a user.add
: This command is for...