Skip to content
Snippets Groups Projects
Commit 8e742722 authored by Andrej Rasevic's avatar Andrej Rasevic
Browse files

adding exercsise 3

parent 4513dc29
No related branches found
No related tags found
No related merge requests found
# Exercise 3:
## Due Date: Wednesday, January 19, 2022 11:59 PM
## Objectives: To get familiar with creating a wrapper for a Rest Client in Go and continue practice with creating a CLI in Go.
## Specifications/Requirements
In this exercise you will be creating a command line tool that will be our own version of the command line utility curl. It won't be duplicating all of the functionality of the curl utility, but will implement the following:
* ability to pass in the request type and what endpoint you are going to hit
* print out the results to the user as well as store the results in a log file
* provide the user with usage information on how to use the CLI
* retrieve the contents of the log and display it to the user
Details:
1. You are given a go module: __exercise3__. You need to implement your application in 2 files. Inside of __main.go__ you need to implement the interface for your CLI. Your CLI should implement the following flags:
* request - Http verb (type) for your request. Only need to support GET, POST, PUT and DELETE)
* endpoint - The url of the endpoint you are trying to hit
* logs - output the log of all of your session requests
* additionally your CLI should provide the user Usage information similar to the functionality in exercise 2
2. Inside of __client.go__ you will implement all of your http client handlers as well as the persistence of the results of your network calls to a file on your file system. You need to handle the possible errors of any failed network call and store those results as well.
To deliver your submission you will need to commit your changes locally and push to your repo on the university gitlab server.
__NOTE__: You should not commit any executables or binaries as a result of compiling and building your application.
package client
\ No newline at end of file
package main
import (
"flag"
"fmt"
"os"
"gitlab.cs.umd.edu/arasevic/cmsc398Bwinter2022-student/exercises/exercise3"
)
// Default file name
var log = "requestLogs.json"
\ No newline at end of file
module gitlab.cs.umd.edu/arasevic/cmsc398Bwinter2022-student/exercises/exercise3
go 1.17
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment